mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Merge branch 'ver/1.21.11' into feat/lightning-affects-blocks
This commit is contained in:
@@ -5,27 +5,31 @@ Subject: [PATCH] LivingEntity safeFallDistance
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 19e58e62ae442ef9be02ca7fa2f55e370a54afa4..c5dcfd380206603c2979aa02e7094fef27348eab 100644
|
||||
index b777e530122549455dcce6fac8d4a151c1c0af42..57a3e330043077f042a284c99e2631e1582cb32c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1192,4 +1192,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -1447,4 +1447,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
*/
|
||||
void setBodyYaw(float bodyYaw);
|
||||
// Paper end
|
||||
// Paper end - body yaw API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Gets the distance (in blocks) this entity can safely fall without taking damage
|
||||
+ *
|
||||
+ * @return Safe fall distance
|
||||
+ * @deprecated use {@link org.bukkit.attribute.Attribute#GENERIC_SAFE_FALL_DISTANCE} instead
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ float getSafeFallDistance();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the distance (in blocks) this entity can safely fall without taking damage
|
||||
+ *
|
||||
+ * @param safeFallDistance Safe fall distance
|
||||
+ * @deprecated use {@link org.bukkit.attribute.Attribute#GENERIC_SAFE_FALL_DISTANCE} instead
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ void setSafeFallDistance(float safeFallDistance);
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -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 c8ab330ef171795d08fa201cf8320703c7f1c66b..93e2ea220dc03c122f82af65d5e9fda5b582290c 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 {
|
||||
@@ -33,6 +33,7 @@ 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";
|
||||
@@ -24,34 +16,46 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
private final int amplifier;
|
||||
private final int duration;
|
||||
private final PotionEffectType type;
|
||||
private final boolean ambient;
|
||||
@@ -40,6 +41,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
private final boolean particles;
|
||||
private final boolean icon;
|
||||
private final PotionEffect hiddenEffect; // Paper
|
||||
+ @Nullable private final NamespacedKey key; // Purpur
|
||||
|
||||
/**
|
||||
* Creates a potion effect.
|
||||
@@ -49,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -50,11 +52,12 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
|
||||
* @param particles the particle status, see {@link PotionEffect#hasParticles()}
|
||||
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
|
||||
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
|
||||
* @param hiddenEffect the hidden PotionEffect
|
||||
* @hidden Internal-- hidden effects are only shown internally
|
||||
*/
|
||||
@org.jetbrains.annotations.ApiStatus.Internal // Paper
|
||||
- public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect) { // Paper
|
||||
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect, @Nullable NamespacedKey key) { // Paper // Purpur
|
||||
Preconditions.checkArgument(type != null, "effect type cannot be null");
|
||||
this.type = type;
|
||||
this.duration = duration;
|
||||
@@ -62,6 +65,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
this.ambient = ambient;
|
||||
this.particles = particles;
|
||||
this.icon = icon;
|
||||
+ this.key = key; // Purpur
|
||||
// Paper start
|
||||
this.hiddenEffect = hiddenEffect;
|
||||
}
|
||||
@@ -77,10 +81,27 @@ 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) {
|
||||
+ // Purpur start
|
||||
+ this(type, duration, amplifier, ambient, particles, icon, null);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Create a potion effect.
|
||||
+ * @param duration measured in ticks, see {@link
|
||||
+ * PotionEffect#getDuration()}
|
||||
+ * @param amplifier the amplifier, see {@link PotionEffect#getAmplifier()}
|
||||
+ * @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
|
||||
+ * @param particles the particle status, see {@link PotionEffect#hasParticles()}
|
||||
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
|
||||
+ */
|
||||
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, @Nullable NamespacedKey key) {
|
||||
+ this(type, duration, amplifier, ambient, particles, particles, key);
|
||||
+ }
|
||||
+
|
||||
- this(type, duration, amplifier, ambient, particles, icon, null);
|
||||
+ this(type, duration, amplifier, ambient, particles, icon, null, null); // Purpur
|
||||
// Paper end
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Creates a potion effect.
|
||||
+ * @param type effect type
|
||||
@@ -64,24 +68,19 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
|
||||
+ */
|
||||
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable NamespacedKey key) {
|
||||
+ // Purpur end
|
||||
Preconditions.checkArgument(type != null, "effect type cannot be null");
|
||||
this.type = type;
|
||||
this.duration = duration;
|
||||
@@ -56,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
this.ambient = ambient;
|
||||
this.particles = particles;
|
||||
this.icon = icon;
|
||||
+ this.key = key; // Purpur - add key
|
||||
}
|
||||
|
||||
+ this(type, duration, amplifier, ambient, particles, icon, null, key);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
@@ -103,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* Creates a potion effect with no defined color.
|
||||
*
|
||||
@@ -126,33 +147,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
* @param map the map to deserialize from
|
||||
*/
|
||||
public PotionEffect(@NotNull Map<String, Object> map) {
|
||||
- this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)));
|
||||
+ this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), getKey(map)); // Purpur - getKey
|
||||
- this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT)); // Paper
|
||||
+ this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT), getKey(map)); // Paper // Purpur - getKey
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -115,6 +114,10 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
|
||||
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,6 +190,13 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Purpur start
|
||||
@@ -126,8 +129,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;
|
||||
@@ -201,6 +229,17 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return def;
|
||||
}
|
||||
|
||||
@@ -145,40 +148,28 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
@Override
|
||||
@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);
|
||||
+ if(key != null) {
|
||||
@@ -215,6 +254,11 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
if (this.hiddenEffect != null) {
|
||||
builder.put(HIDDEN_EFFECT, this.hiddenEffect);
|
||||
}
|
||||
+ // Purpur start
|
||||
+ if (key != null) {
|
||||
+ builder.put(KEY, key.toString());
|
||||
+ }
|
||||
+ return builder.build();
|
||||
+ // Purpur end
|
||||
return builder.build();
|
||||
// Paper end
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,7 +250,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -243,7 +287,7 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return false;
|
||||
}
|
||||
PotionEffect that = (PotionEffect) obj;
|
||||
- return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon;
|
||||
+ return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && this.key == that.key; // Purpur - add key
|
||||
- return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect); // Paper
|
||||
+ return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect) && this.key == that.key; // Paper // Purpur - add key
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,6 +346,24 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -339,6 +383,24 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@@ -203,11 +194,11 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 1;
|
||||
@@ -303,6 +378,6 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -354,6 +416,6 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
- return type.getName() + (ambient ? ":(" : ":") + duration + "t-x" + amplifier + (ambient ? ")" : "");
|
||||
+ return type.getName() + (ambient ? ":(" : ":") + duration + "t-x" + amplifier + (ambient ? ")" : "") + (hasKey() ? "(" + key + ")" : ""); // Purpur - add key if not null
|
||||
- return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + '}'; // Paper
|
||||
+ return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + ", key=" + key + '}'; // Paper // Purpur - add key
|
||||
}
|
||||
}
|
||||
44
patches/1-20-6/dropped-api/0049-Add-hover-lines-API.patch
Normal file
44
patches/1-20-6/dropped-api/0049-Add-hover-lines-API.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Meln Cat <melncatuwu@gmail.com>
|
||||
Date: Mon, 2 Oct 2023 17:42:19 -0700
|
||||
Subject: [PATCH] Add hover lines API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
index 98a970a6582dca22e719a31559c7becea4725cb2..1cd2962ceb4fa0a0a3e28a09fa4ccef5802cd5c4 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
@@ -353,4 +353,14 @@ public interface ItemFactory {
|
||||
*/
|
||||
@NotNull ItemStack enchantWithLevels(@NotNull ItemStack itemStack, @org.jetbrains.annotations.Range(from = 1, to = 30) int levels, boolean allowTreasure, @NotNull java.util.Random random);
|
||||
// Paper end - enchantWithLevels API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Returns the lines of text shown when hovering over an item
|
||||
+ * @param itemStack The ItemStack
|
||||
+ * @param advanced Whether advanced tooltips are shown
|
||||
+ * @return the list of Components
|
||||
+ */
|
||||
+ @NotNull java.util.List<net.kyori.adventure.text.@NotNull Component> getHoverLines(@NotNull ItemStack itemStack, boolean advanced);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 6e9b4cbc81878616b1c48add5db534286d267b05..e497575b2f44bb8b3bb6fdda3ae2f5247cbb4679 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -1644,5 +1644,14 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
}
|
||||
return random.nextInt(unbreaking + 1) > 0;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the lines of text shown when hovering over the item
|
||||
+ * @param advanced Whether advanced tooltips are shown
|
||||
+ * @return the list of Components
|
||||
+ */
|
||||
+ public @NotNull List<net.kyori.adventure.text.@NotNull Component> getHoverLines(boolean advanced) {
|
||||
+ return Bukkit.getItemFactory().getHoverLines(this, advanced);
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 5 May 2019 12:58:45 -0500
|
||||
Subject: [PATCH] LivingEntity safeFallDistance
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index aa351df679f300018367244c7ccb3e5a59e9276f..39c2a9f732b8e2452fd2dca07193a173d0c2ba1c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1173,4 +1173,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
this.getHandle().setYBodyRot(bodyYaw);
|
||||
}
|
||||
// Paper end - body yaw API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public float getSafeFallDistance() {
|
||||
+ return (float) getHandle().getAttributeValue(Attributes.SAFE_FALL_DISTANCE);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setSafeFallDistance(float safeFallDistance) {
|
||||
+ getHandle().getAttribute(Attributes.SAFE_FALL_DISTANCE).setBaseValue(safeFallDistance);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
223
patches/1-20-6/dropped-server/0220-Potion-NamespacedKey.patch
Normal file
223
patches/1-20-6/dropped-server/0220-Potion-NamespacedKey.patch
Normal file
@@ -0,0 +1,223 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Racci <tangentmoons@gmail.com>
|
||||
Date: Sat, 4 Dec 2021 00:07:05 +1100
|
||||
Subject: [PATCH] Potion NamespacedKey
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
|
||||
index 32cf6ea96aaa2e6bd0cc28fa88492ceea3d34052..9787dd4fc6ca2ed8aba3db7674ad2dc26a529a7a 100644
|
||||
--- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
|
||||
+++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
|
||||
@@ -53,6 +53,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
private boolean showIcon;
|
||||
@Nullable
|
||||
public MobEffectInstance hiddenEffect;
|
||||
+ private org.bukkit.NamespacedKey key; // Purpur - add key
|
||||
private final MobEffectInstance.BlendState blendState = new MobEffectInstance.BlendState();
|
||||
|
||||
public MobEffectInstance(Holder<MobEffect> effect) {
|
||||
@@ -71,8 +72,14 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
this(effect, duration, amplifier, ambient, visible, visible);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public MobEffectInstance(Holder<MobEffect> effect, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable org.bukkit.NamespacedKey key) {
|
||||
+ this(effect, duration, amplifier, ambient, showParticles, showIcon, null, key);
|
||||
+ // Purpur end
|
||||
+ }
|
||||
+
|
||||
public MobEffectInstance(Holder<MobEffect> effect, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon) {
|
||||
- this(effect, duration, amplifier, ambient, showParticles, showIcon, null);
|
||||
+ this(effect, duration, amplifier, ambient, showParticles, showIcon, null, null); // Purpur
|
||||
}
|
||||
|
||||
public MobEffectInstance(
|
||||
@@ -82,7 +89,8 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
boolean ambient,
|
||||
boolean showParticles,
|
||||
boolean showIcon,
|
||||
- @Nullable MobEffectInstance hiddenEffect
|
||||
+ @Nullable MobEffectInstance hiddenEffect,
|
||||
+ @Nullable org.bukkit.NamespacedKey key // Purpur
|
||||
) {
|
||||
this.effect = effect;
|
||||
this.duration = duration;
|
||||
@@ -90,6 +98,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
this.ambient = ambient;
|
||||
this.visible = showParticles;
|
||||
this.showIcon = showIcon;
|
||||
+ this.key = key; // Purpur - add key
|
||||
this.hiddenEffect = hiddenEffect;
|
||||
}
|
||||
|
||||
@@ -135,6 +144,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
this.ambient = that.ambient;
|
||||
this.visible = that.visible;
|
||||
this.showIcon = that.showIcon;
|
||||
+ this.key = that.key; // Purpur - add key
|
||||
}
|
||||
|
||||
public boolean update(MobEffectInstance that) {
|
||||
@@ -179,6 +189,13 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
bl = true;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (that.key != this.key) {
|
||||
+ this.key = that.key;
|
||||
+ bl = true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
return bl;
|
||||
}
|
||||
|
||||
@@ -222,6 +239,17 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
return this.showIcon;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public boolean hasKey() {
|
||||
+ return this.key != null;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public org.bukkit.NamespacedKey getKey() {
|
||||
+ return this.key;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public boolean tick(LivingEntity entity, Runnable overwriteCallback) {
|
||||
if (this.hasRemainingDuration()) {
|
||||
int i = this.isInfiniteDuration() ? entity.tickCount : this.duration;
|
||||
@@ -286,6 +314,12 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
string = string + ", Show Icon: false";
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (this.hasKey()) {
|
||||
+ string = string + ", Key: " + this.key;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
return string;
|
||||
}
|
||||
|
||||
@@ -300,6 +334,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
|
||||
&& this.duration == mobEffectInstance.duration
|
||||
&& this.amplifier == mobEffectInstance.amplifier
|
||||
&& this.ambient == mobEffectInstance.ambient
|
||||
+ && this.key == mobEffectInstance.key // Purpur - add key
|
||||
&& this.effect.equals(mobEffectInstance.effect);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java
|
||||
index 4a9e6a679530025caa710a152c5249299ceffdf9..ea4f3f606aad69965384c73eb1273ed0644297b8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java
|
||||
@@ -42,6 +42,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||
static final ItemMetaKey POTION_EFFECTS = new ItemMetaKey("custom-effects");
|
||||
static final ItemMetaKey POTION_COLOR = new ItemMetaKey("custom-color");
|
||||
static final ItemMetaKey DEFAULT_POTION = new ItemMetaKey("potion-type");
|
||||
+ static final ItemMetaKey KEY = new ItemMetaKey("key", "namespacedkey"); // Purpur - add key
|
||||
|
||||
private PotionType type;
|
||||
private List<PotionEffect> customEffects;
|
||||
@@ -91,7 +92,13 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||
boolean ambient = effect.isAmbient();
|
||||
boolean particles = effect.isVisible();
|
||||
boolean icon = effect.showIcon();
|
||||
- this.customEffects.add(new PotionEffect(type, duration, amp, ambient, particles, icon));
|
||||
+ // Purpur start
|
||||
+ NamespacedKey key = null;
|
||||
+ if (tag.contains(CraftMetaPotion.KEY.NBT)) {
|
||||
+ key = NamespacedKey.fromString(effect.getString(CraftMetaPotion.KEY.NBT));
|
||||
+ }
|
||||
+ this.customEffects.add(new PotionEffect(type, duration, amp, ambient, particles, icon, key));
|
||||
+ // Purpur end
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -130,6 +137,11 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||
if (this.customEffects != null) {
|
||||
for (PotionEffect effect : this.customEffects) {
|
||||
effectList.add(new MobEffectInstance(CraftPotionEffectType.bukkitToMinecraftHolder(effect.getType()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon()));
|
||||
+ // Purpur start
|
||||
+ if (effect.hasKey()) {
|
||||
+ effectData.putString(CraftMetaPotion.KEY.NBT, effect.getKey().toString());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +208,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||
if (index != -1) {
|
||||
if (overwrite) {
|
||||
PotionEffect old = this.customEffects.get(index);
|
||||
- if (old.getAmplifier() == effect.getAmplifier() && old.getDuration() == effect.getDuration() && old.isAmbient() == effect.isAmbient()) {
|
||||
+ if (old.getAmplifier() == effect.getAmplifier() && old.getDuration() == effect.getDuration() && old.isAmbient() == effect.isAmbient() && old.getKey() == effect.getKey()) { // Purpur - add key
|
||||
return false;
|
||||
}
|
||||
this.customEffects.set(index, effect);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
|
||||
index 14c58cf8d255c51473fd3d0092faeaf5a3c1ae0c..3ee9c14440046872b83de628b7f460d0782e9315 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java
|
||||
@@ -11,7 +11,7 @@ public class CraftPotionUtil {
|
||||
public static MobEffectInstance fromBukkit(PotionEffect effect) {
|
||||
Holder<MobEffect> type = CraftPotionEffectType.bukkitToMinecraftHolder(effect.getType());
|
||||
// Paper - Note: do not copy over the hidden effect, as this method is only used for applying to entities which we do not want to convert over.
|
||||
- return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon()); // Paper
|
||||
+ return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon(), effect.getKey()); // Paper // Purpur - add key
|
||||
}
|
||||
|
||||
public static PotionEffect toBukkit(MobEffectInstance effect) {
|
||||
@@ -20,7 +20,7 @@ public class CraftPotionUtil {
|
||||
int duration = effect.getDuration();
|
||||
boolean ambient = effect.isAmbient();
|
||||
boolean particles = effect.isVisible();
|
||||
- return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.hiddenEffect == null ? null : toBukkit(effect.hiddenEffect)); // Paper
|
||||
+ return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.hiddenEffect == null ? null : toBukkit(effect.hiddenEffect), effect.getKey()); // Paper // Purpur - add key
|
||||
}
|
||||
|
||||
public static boolean equals(Holder<MobEffect> mobEffect, PotionEffectType type) {
|
||||
diff --git a/src/test/java/org/bukkit/potion/PotionTest.java b/src/test/java/org/bukkit/potion/PotionTest.java
|
||||
index cbcd1c21646308b2a9706095e2e12177ca06734d..b3ccaea713e858e334cc91d1ae498e589e3daafa 100644
|
||||
--- a/src/test/java/org/bukkit/potion/PotionTest.java
|
||||
+++ b/src/test/java/org/bukkit/potion/PotionTest.java
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.item.alchemy.Potion;
|
||||
import org.bukkit.craftbukkit.legacy.FieldRename;
|
||||
+import org.bukkit.NamespacedKey; // Purpur
|
||||
import org.bukkit.craftbukkit.potion.CraftPotionEffectType;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -47,4 +48,27 @@ public class PotionTest extends AbstractTestingBase {
|
||||
assertEquals(bukkit, byName, "Same type not returned by name " + key);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Test
|
||||
+ public void testNamespacedKey() {
|
||||
+ NamespacedKey key = new NamespacedKey("testnamespace", "testkey");
|
||||
+ PotionEffect namedSpacedEffect = new PotionEffect(PotionEffectType.DOLPHINS_GRACE, 20, 0, true, true, true, key);
|
||||
+ assertNotNull(namedSpacedEffect.getKey());
|
||||
+ assertTrue(namedSpacedEffect.hasKey());
|
||||
+ assertFalse(namedSpacedEffect.withKey(null).hasKey());
|
||||
+
|
||||
+ PotionEffect effect = new PotionEffect(PotionEffectType.DOLPHINS_GRACE, 20, 0, true, true, true);
|
||||
+ assertNull(effect.getKey());
|
||||
+ assertFalse(effect.hasKey());
|
||||
+ assertTrue(namedSpacedEffect.withKey(key).hasKey());
|
||||
+
|
||||
+ Map<String, Object> s1 = namedSpacedEffect.serialize();
|
||||
+ Map<String, Object> s2 = effect.serialize();
|
||||
+ assertTrue(s1.containsKey("namespacedKey"));
|
||||
+ assertFalse(s2.containsKey("namespacedKey"));
|
||||
+ assertNotNull(new PotionEffect(s1).getKey());
|
||||
+ assertNull(new PotionEffect(s2).getKey());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -37,24 +37,23 @@ index 9967ba762567631f2bdb1e4f8fe16a13ea927b46..6c945ae8fe8b1517e312c688f829fab4
|
||||
|
||||
FoodProperties(int hunger, float saturationModifier, boolean meat, boolean alwaysEdible, boolean snack, List<Pair<MobEffectInstance, Float>> statusEffects) {
|
||||
diff --git a/src/main/java/net/minecraft/world/food/Foods.java b/src/main/java/net/minecraft/world/food/Foods.java
|
||||
index b16d9e2eaa589f19c563ee70b1a56d67dbcdecb0..71beab673f04cd051c46ea37f8c847316885d38d 100644
|
||||
index 4569cf30b33167a415256a8542820557ad38f89e..9c65eefa855f3622b6c9ae2a698cf332ba225c7f 100644
|
||||
--- a/src/main/java/net/minecraft/world/food/Foods.java
|
||||
+++ b/src/main/java/net/minecraft/world/food/Foods.java
|
||||
@@ -4,6 +4,9 @@ import net.minecraft.world.effect.MobEffectInstance;
|
||||
@@ -4,6 +4,8 @@ import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
|
||||
public class Foods {
|
||||
+ public static final java.util.Map<String, FoodProperties> ALL_PROPERTIES = new java.util.HashMap<>(); // Purpur
|
||||
+ public static final java.util.Map<String, FoodProperties> DEFAULT_PROPERTIES = new java.util.HashMap<>(); // Purpur
|
||||
+
|
||||
public static final FoodProperties APPLE = (new FoodProperties.Builder()).nutrition(4).saturationMod(0.3F).build();
|
||||
public static final FoodProperties BAKED_POTATO = (new FoodProperties.Builder()).nutrition(5).saturationMod(0.6F).build();
|
||||
public static final FoodProperties BEEF = (new FoodProperties.Builder()).nutrition(3).saturationMod(0.3F).meat().build();
|
||||
public static final FoodProperties APPLE = new FoodProperties.Builder().nutrition(4).saturationMod(0.3F).build();
|
||||
public static final FoodProperties BAKED_POTATO = new FoodProperties.Builder().nutrition(5).saturationMod(0.6F).build();
|
||||
public static final FoodProperties BEEF = new FoodProperties.Builder().nutrition(3).saturationMod(0.3F).meat().build();
|
||||
diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java
|
||||
index 31f5ed9dd1727eee24804a384817d2b76a45676b..5fbb13ebef0ca66419f3e5006d19e4a5918a038a 100644
|
||||
index bb2103a488964f25335393fa91e8ae5749eca333..249c887af68f56739c3609bad2405ba2cbe11762 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/Items.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/Items.java
|
||||
@@ -1309,6 +1309,13 @@ public class Items {
|
||||
@@ -1715,6 +1715,13 @@ public class Items {
|
||||
((BlockItem)item).registerBlocks(Item.BY_BLOCK, item);
|
||||
}
|
||||
|
||||
@@ -69,10 +68,10 @@ index 31f5ed9dd1727eee24804a384817d2b76a45676b..5fbb13ebef0ca66419f3e5006d19e4a5
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 730a4a2e46aeb233d8036e8d7e1749dcb397e6c0..fa81039056af14c37426a508b7b2da77e8b50737 100644
|
||||
index 0e28cf20a870f3f3662bd1d8f7a4f2cbf13c48bf..ce3ab604e6ed6669f38abf83d40b500148277b9d 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -461,4 +461,75 @@ public class PurpurConfig {
|
||||
@@ -466,4 +466,75 @@ public class PurpurConfig {
|
||||
String setPattern = getString("settings.username-valid-characters", defaultPattern);
|
||||
usernameValidCharactersPattern = java.util.regex.Pattern.compile(setPattern == null || setPattern.isBlank() ? defaultPattern : setPattern);
|
||||
}
|
||||
@@ -3,12 +3,13 @@ From: Ben Kerllenevich <ben@omega24.dev>
|
||||
Date: Wed, 13 Jul 2022 16:27:43 -0400
|
||||
Subject: [PATCH] Send client custom name of BE
|
||||
|
||||
https://modrinth.com/mod/know-my-name
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
index 2f19f6ac5de454845f5d13a3ebb93af625b2afc8..3431f1a00ae2918b91a6b7a449e613e6e12ff6d4 100644
|
||||
index 4ea15e17a1393864422edb6d5c57962651abf69a..a78ed43288cfefaeb2592ed0a33fd11565dea2b2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
@@ -205,10 +205,24 @@ public abstract class BlockEntity {
|
||||
@@ -256,10 +256,24 @@ public abstract class BlockEntity {
|
||||
|
||||
@Nullable
|
||||
public Packet<ClientGamePacketListener> getUpdatePacket() {
|
||||
@@ -22,7 +23,7 @@ index 2f19f6ac5de454845f5d13a3ebb93af625b2afc8..3431f1a00ae2918b91a6b7a449e613e6
|
||||
return null;
|
||||
}
|
||||
|
||||
public CompoundTag getUpdateTag() {
|
||||
public CompoundTag getUpdateTag(HolderLookup.Provider registryLookup) {
|
||||
+ // Purpur start
|
||||
+ if (this instanceof net.minecraft.world.Nameable nameable && nameable.hasCustomName()) {
|
||||
+ CompoundTag nbt = this.saveWithoutMetadata();
|
||||
@@ -3,12 +3,13 @@ From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 20 Sep 2022 17:56:21 -0500
|
||||
Subject: [PATCH] Allay respect item NBT
|
||||
|
||||
https://github.com/PurpurMC/Purpur/discussions/1127
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
index d50bf1b980231a1045c1c9df622a9a50fc2ed893..7166f4a39fd615e10d7b1f53c57363832a41f365 100644
|
||||
index bca7b7192debb3a34a08047010a2438e7b7e2a78..53765198483e137d411e227119e4f912964aefe3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -407,9 +407,31 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
@@ -399,9 +399,31 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
|
||||
@Override
|
||||
public boolean wantsToPickUp(ItemStack stack) {
|
||||
@@ -44,10 +45,10 @@ index d50bf1b980231a1045c1c9df622a9a50fc2ed893..7166f4a39fd615e10d7b1f53c5736383
|
||||
|
||||
private boolean allayConsidersItemEqual(ItemStack stack, ItemStack stack2) {
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 5f4b6d211e1a310ca2efcc94686e2757cff973ec..a4c5c469fed51b46727783ddefa293e53b9c66ca 100644
|
||||
index 5b12c08a1d8e6f62c5653c95071a1d36d735d039..94e29919ddc7f507d54e14c3360f7a3e8bb831a7 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1087,10 +1087,13 @@ public class PurpurWorldConfig {
|
||||
@@ -1138,10 +1138,13 @@ public class PurpurWorldConfig {
|
||||
public boolean allayRidable = false;
|
||||
public boolean allayRidableInWater = true;
|
||||
public boolean allayControllable = true;
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add item packet serialize event
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
index 9938bb90bef84cf784f9a1ceb02a1a45aa8b48a1..1f4b64a5f812376c499c98cb4be62469bd0b7dbe 100644
|
||||
index b863249ff7e13cf4939c8961601f0564c62fd661..bdcfd80f937c34956911373905d66424bbff8e1d 100644
|
||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -98,6 +98,8 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -95,6 +95,8 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
private static final int MAX_PUBLIC_KEY_LENGTH = 512;
|
||||
private static final Gson GSON = new Gson();
|
||||
|
||||
@@ -17,7 +17,7 @@ index 9938bb90bef84cf784f9a1ceb02a1a45aa8b48a1..1f4b64a5f812376c499c98cb4be62469
|
||||
public FriendlyByteBuf(ByteBuf parent) {
|
||||
this.source = parent;
|
||||
}
|
||||
@@ -679,6 +681,17 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -640,6 +642,17 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
this.writeBoolean(false);
|
||||
} else {
|
||||
this.writeBoolean(true);
|
||||
@@ -36,22 +36,22 @@ index 9938bb90bef84cf784f9a1ceb02a1a45aa8b48a1..1f4b64a5f812376c499c98cb4be62469
|
||||
|
||||
this.writeId(BuiltInRegistries.ITEM, item);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 798586a3b01814548d702d16faddd406cdd5acec..99fd775e7a564aaef327a62bb7742da07b2d2829 100644
|
||||
index 4611116f3328c0f8d5b37c8765feca36b2448ffe..60b5e0643d933393b5473681ac9261db29fe2416 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1559,6 +1559,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1731,6 +1731,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
//MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper // Purpur
|
||||
|
||||
this.isIteratingOverLevels = true; // Paper
|
||||
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
||||
+ net.minecraft.network.FriendlyByteBuf.hasItemSerializeEvent = org.purpurmc.purpur.event.packet.NetworkItemSerializeEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
|
||||
Iterator iterator = this.getAllLevels().iterator(); // Paper - move down
|
||||
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
|
||||
while (iterator.hasNext()) {
|
||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 9b488a98fdf06515ff267040dd6d654004665207..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0bd757eec 100644
|
||||
index 872be72e24017fdcb3060f6e4e9a92c342d59fc1..f7ac60e1aa188ec25a4c5d326cdd4a109a54101c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3545,6 +3545,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3382,6 +3382,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,10 +65,10 @@ index 9b488a98fdf06515ff267040dd6d654004665207..9cc3ab8cd3f7ab7f8fbf4d9d14f25ea0
|
||||
boolean flag1 = packet.getSlotNum() >= 1 && packet.getSlotNum() <= 45;
|
||||
boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 568bb53e91dda4804cd328a81ba12ce735c52603..62aabfc021fa3349b0ab46744a9ec78d57f058b0 100644
|
||||
index 5313ba91ffc625b27d5bb99395f0e719829f6bda..5329ad6493950a561bd46045e35a9bd70ac4405f 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -563,4 +563,9 @@ public class PurpurConfig {
|
||||
@@ -568,4 +568,9 @@ public class PurpurConfig {
|
||||
}
|
||||
});
|
||||
}
|
||||
28
patches/1-20-6/dropped-server/0292-Add-hover-lines-API.patch
Normal file
28
patches/1-20-6/dropped-server/0292-Add-hover-lines-API.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Meln Cat <melncatuwu@gmail.com>
|
||||
Date: Mon, 2 Oct 2023 17:42:26 -0700
|
||||
Subject: [PATCH] Add hover lines API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index 6e2a6ce5cf456bd9f6c8c18a58f08e2285dc77ed..b27d16e74c3f99aa693b38590c1fb62db8204509 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -619,4 +619,17 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
return CraftItemStack.asCraftMirror(enchanted);
|
||||
}
|
||||
// Paper end - enchantWithLevels API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public @org.jetbrains.annotations.NotNull java.util.List<net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component> getHoverLines(@org.jetbrains.annotations.NotNull ItemStack itemStack, boolean advanced) {
|
||||
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(
|
||||
+ CraftItemStack.asNMSCopy(itemStack).getTooltipLines(
|
||||
+ null,
|
||||
+ advanced ? net.minecraft.world.item.TooltipFlag.ADVANCED
|
||||
+ : net.minecraft.world.item.TooltipFlag.NORMAL
|
||||
+ )
|
||||
+ );
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -5,19 +5,20 @@ Subject: [PATCH] LivingEntity#broadcastItemBreak
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index c5dcfd380206603c2979aa02e7094fef27348eab..accefccca9993edd00f72b4e5779fce0b3ee628f 100644
|
||||
index 5c29956c6db53440322330ff723c7087193641f1..e1079c5c4be99e75a646c090189678dd131f210e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1207,5 +1207,12 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param safeFallDistance Safe fall distance
|
||||
@@ -1447,4 +1447,13 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
*/
|
||||
void setSafeFallDistance(float safeFallDistance);
|
||||
void setBodyYaw(float bodyYaw);
|
||||
// Paper end - body yaw API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Play item break animation for the item in specified equipment slot
|
||||
+ *
|
||||
+ * @param slot Equipment slot to play break animation for
|
||||
+ */
|
||||
+ void broadcastItemBreak(@NotNull org.bukkit.inventory.EquipmentSlot slot);
|
||||
// Purpur end
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -5,14 +5,14 @@ Subject: [PATCH] End gateway should check if entity can use portal
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
index 1ec80f9c901dff1c9f29befa5a8e3c3f6f37aaf7..9717b37aef9f487502e696c209ae209ab3b8f000 100644
|
||||
index 93bd70c1dc2ba8b893a6087730071c81fb1132f4..60b343edc4383c8bc450f106f483349850432fa3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
@@ -177,6 +177,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
@@ -167,6 +167,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
|
||||
public static void teleportEntity(Level world, BlockPos pos, BlockState state, Entity entity, TheEndGatewayBlockEntity blockEntity) {
|
||||
if (world instanceof ServerLevel && !blockEntity.isCoolingDown()) {
|
||||
if (world instanceof ServerLevel worldserver && !blockEntity.isCoolingDown()) {
|
||||
+ if (!entity.canChangeDimensions()) return; // Purpur
|
||||
ServerLevel worldserver = (ServerLevel) world;
|
||||
|
||||
blockEntity.teleportCooldown = 100;
|
||||
BlockPos blockposition1;
|
||||
|
||||
@@ -5,18 +5,19 @@ Subject: [PATCH] LivingEntity#broadcastItemBreak
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index f7ae6d11c6043a2037dbfd160b409579bd9a35fd..f39747767d9a8da86bb25c34415b06172f39bcfc 100644
|
||||
index a1e715629313346f670bce92483996122b0f1d7b..386647f6000c71c59ab8d7875219eefdc5a3d7ef 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1105,5 +1105,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public void setSafeFallDistance(float safeFallDistance) {
|
||||
getHandle().safeFallDistance = safeFallDistance;
|
||||
@@ -1181,4 +1181,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
this.getHandle().setYBodyRot(bodyYaw);
|
||||
}
|
||||
// Paper end - body yaw API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public void broadcastItemBreak(org.bukkit.inventory.EquipmentSlot slot) {
|
||||
+ if (slot == null) return;
|
||||
+ getHandle().broadcastBreakEvent(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot));
|
||||
+ }
|
||||
// Purpur end
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -5,19 +5,19 @@ Subject: [PATCH] Allow infinite and mending enchantments together
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java b/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
|
||||
index 518d85a13c37a2f7d32ca0718323181048559986..2c4ce164ab3011f372ff1719c8d4a3331d8db55f 100644
|
||||
index 81cc05c929d612898609965d82454b89cd18f9f5..fa73c3d4b58ad8379963a9866d8f09e1d6abd663 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java
|
||||
@@ -19,6 +19,6 @@ public class ArrowInfiniteEnchantment extends Enchantment {
|
||||
@@ -7,6 +7,6 @@ public class ArrowInfiniteEnchantment extends Enchantment {
|
||||
|
||||
@Override
|
||||
public boolean checkCompatibility(Enchantment other) {
|
||||
- return other instanceof MendingEnchantment ? false : super.checkCompatibility(other);
|
||||
+ return other instanceof MendingEnchantment ? org.purpurmc.purpur.PurpurConfig.allowInfinityMending : super.checkCompatibility(other);
|
||||
- return !(other instanceof MendingEnchantment) && super.checkCompatibility(other);
|
||||
+ return !(other instanceof MendingEnchantment) && super.checkCompatibility(other) || other instanceof MendingEnchantment && org.purpurmc.purpur.PurpurConfig.allowInfinityMending; // Purpur
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 6470f383b6f044877f0a4d8c91119d0eae451b8f..de1a9b08946005d1235264c7658b51bbdc2c47c2 100644
|
||||
index 2f68cf2fc064a38ca059504a39d563d95d01643e..6d621a93aaf94927fa6c73e649dcdb8bbbaadd2a 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -246,6 +246,16 @@ public class PurpurConfig {
|
||||
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <ben@omega24.dev>
|
||||
Date: Thu, 18 Mar 2021 12:25:29 -0400
|
||||
Subject: [PATCH] Allow infinity on crossbows
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
index 1f52feb5684ee1bab710e1557cf69b43b4d4dfd4..d2bb5c84e1895f28afed03d1868a79338e4f3e58 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
@@ -107,7 +107,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
return CrossbowItem.tryLoadProjectiles(shooter, crossbow, true);
|
||||
}
|
||||
private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow, boolean consume) {
|
||||
- List<ItemStack> list = draw(crossbow, shooter.getProjectile(crossbow), shooter, consume);
|
||||
+ List<ItemStack> list = draw(crossbow, shooter.getProjectile(crossbow), shooter, (org.purpurmc.purpur.PurpurConfig.allowCrossbowInfinity && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.INFINITY, crossbow) > 0) || consume);
|
||||
// Paper end - Add EntityLoadCrossbowEvent
|
||||
if (!list.isEmpty()) {
|
||||
crossbow.set(DataComponents.CHARGED_PROJECTILES, ChargedProjectiles.of(list));
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 0587b0c7f34ae90f0d06f29d58fafbcf5b80ff13..c60d0d1861fd24b74bfa93228357f27d524f4ce7 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -284,6 +284,7 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static boolean allowInfinityMending = false;
|
||||
+ public static boolean allowCrossbowInfinity = true;
|
||||
private static void enchantmentSettings() {
|
||||
if (version < 5) {
|
||||
boolean oldValue = getBoolean("settings.enchantment.allow-infinite-and-mending-together", false);
|
||||
@@ -291,6 +292,7 @@ public class PurpurConfig {
|
||||
set("settings.enchantment.allow-infinite-and-mending-together", null);
|
||||
}
|
||||
allowInfinityMending = getBoolean("settings.enchantment.allow-infinity-and-mending-together", allowInfinityMending);
|
||||
+ allowCrossbowInfinity = getBoolean("settings.enchantment.allow-infinity-on-crossbow", allowCrossbowInfinity);
|
||||
}
|
||||
|
||||
public static boolean endermanShortHeight = false;
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add mending multiplier
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||
index b2233635b6acc35ea3668c36c56e57f15420ac62..724bf857bf1b89cb0947b8a82e0ce09a0bec0335 100644
|
||||
index 7130d483ccdce26526e715bd7e68d2e896e6215f..40d168d225932717b8ac8bdd27dfe2a202bc2808 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||
@@ -359,13 +359,15 @@ public class ExperienceOrb extends Entity {
|
||||
@@ -372,13 +372,15 @@ public class ExperienceOrb extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ index b2233635b6acc35ea3668c36c56e57f15420ac62..724bf857bf1b89cb0947b8a82e0ce09a
|
||||
public int getValue() {
|
||||
return this.value;
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 9365469584fd647dbc52176efb8c282c21dd28d6..76216ce3a481b7430bd5a3d60bb41798216fa692 100644
|
||||
index 02b8333222668c3419296ec5513c1c4e8e8d1a79..3c614b8f62c0d3839ebc4e948c952d52c4f66819 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -119,6 +119,7 @@ public class PurpurWorldConfig {
|
||||
@@ -38,7 +38,7 @@ index 9365469584fd647dbc52176efb8c282c21dd28d6..76216ce3a481b7430bd5a3d60bb41798
|
||||
public boolean alwaysTameInCreative = false;
|
||||
public boolean boatEjectPlayersOnLand = false;
|
||||
public boolean boatsDoFallDamage = false;
|
||||
@@ -146,6 +147,7 @@ public class PurpurWorldConfig {
|
||||
@@ -147,6 +148,7 @@ public class PurpurWorldConfig {
|
||||
public int mobLastHurtByPlayerTime = 100;
|
||||
private void miscGameplayMechanicsSettings() {
|
||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
@@ -0,0 +1,215 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
||||
Date: Mon, 3 Jan 2022 00:06:51 -0600
|
||||
Subject: [PATCH] Shears can have looting enchantment
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
index 44b79a7c2f8b95a484d1999fa2167ce588f7985b..68632372c8704058f35f12e0ae6cdd98ebd55937 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java
|
||||
@@ -104,7 +104,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior {
|
||||
if (ishearable.readyForShearing()) {
|
||||
// CraftBukkit start
|
||||
// Paper start - Add drops to shear events
|
||||
- org.bukkit.event.block.BlockShearEntityEvent event = CraftEventFactory.callBlockShearEntityEvent(entityliving, bukkitBlock, craftItem, ishearable.generateDefaultDrops());
|
||||
+ org.bukkit.event.block.BlockShearEntityEvent event = CraftEventFactory.callBlockShearEntityEvent(entityliving, bukkitBlock, craftItem, ishearable.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.LOOTING, CraftItemStack.asNMSCopy(craftItem)))); // Purpur
|
||||
if (event.isCancelled()) {
|
||||
// Paper end - Add drops to shear events
|
||||
continue;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Shearable.java b/src/main/java/net/minecraft/world/entity/Shearable.java
|
||||
index 2ee48ac3b665db2b02bcb1a30ec972d43a3725b0..59e8f5431ce5026209e1428b5fa5b5485dcfebc7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Shearable.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Shearable.java
|
||||
@@ -8,7 +8,7 @@ public interface Shearable {
|
||||
|
||||
boolean readyForShearing();
|
||||
// Paper start - custom shear drops; ensure all implementing entities override this
|
||||
- default java.util.List<net.minecraft.world.item.ItemStack> generateDefaultDrops() {
|
||||
+ default java.util.List<net.minecraft.world.item.ItemStack> generateDefaultDrops(int looting) { // Purpur
|
||||
return java.util.Collections.emptyList();
|
||||
}
|
||||
// Paper end - custom shear drops
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
index 06fac8dae42451f912c2db14d792461cee3dba83..e5a84dd5f1a375dd44b9d14dc7f44339bd8ddf3a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
@@ -161,7 +161,7 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
|
||||
} else if (itemstack.is(Items.SHEARS) && this.readyForShearing()) {
|
||||
// CraftBukkit start
|
||||
// Paper start - custom shear drops
|
||||
- java.util.List<ItemStack> drops = this.generateDefaultDrops();
|
||||
+ java.util.List<ItemStack> drops = this.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.LOOTING, itemstack)); // Purpur
|
||||
org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops);
|
||||
if (event != null) {
|
||||
if (event.isCancelled()) {
|
||||
@@ -209,13 +209,13 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder<Mushroo
|
||||
@Override
|
||||
public void shear(SoundSource shearedSoundCategory) {
|
||||
// Paper start - custom shear drops
|
||||
- this.shear(shearedSoundCategory, this.generateDefaultDrops());
|
||||
+ this.shear(shearedSoundCategory, this.generateDefaultDrops(0)); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
- public java.util.List<ItemStack> generateDefaultDrops() {
|
||||
+ public java.util.List<ItemStack> generateDefaultDrops(int looting) { // Purpur
|
||||
java.util.List<ItemStack> dropEntities = new java.util.ArrayList<>(5);
|
||||
- for (int i = 0; i < 5; ++i) {
|
||||
+ for (int i = 0; i < 5 + (org.purpurmc.purpur.PurpurConfig.allowShearsLooting ? looting : 0); ++i) { // Purpur
|
||||
dropEntities.add(new ItemStack(this.getVariant().getBlockState().getBlock()));
|
||||
}
|
||||
return dropEntities;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
index ca63c98bc45584812c0fb2af84a63aa08daa9a9e..17b49186293578c06144a476473324a9a1f6fcbb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
|
||||
@@ -296,7 +296,7 @@ public class Sheep extends Animal implements Shearable {
|
||||
if (!this.level().isClientSide && this.readyForShearing()) {
|
||||
// CraftBukkit start
|
||||
// Paper start - custom shear drops
|
||||
- java.util.List<ItemStack> drops = this.generateDefaultDrops();
|
||||
+ java.util.List<ItemStack> drops = this.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.LOOTING, itemstack)); // Purpur
|
||||
org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops);
|
||||
if (event != null) {
|
||||
if (event.isCancelled()) {
|
||||
@@ -321,12 +321,13 @@ public class Sheep extends Animal implements Shearable {
|
||||
@Override
|
||||
public void shear(SoundSource shearedSoundCategory) {
|
||||
// Paper start - custom shear drops
|
||||
- this.shear(shearedSoundCategory, this.generateDefaultDrops());
|
||||
+ this.shear(shearedSoundCategory, this.generateDefaultDrops(0)); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
- public java.util.List<ItemStack> generateDefaultDrops() {
|
||||
+ public java.util.List<ItemStack> generateDefaultDrops(int looting) { // Purpur
|
||||
int count = 1 + this.random.nextInt(3);
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.allowShearsLooting) count += looting; // Purpur
|
||||
java.util.List<ItemStack> dropEntities = new java.util.ArrayList<>(count);
|
||||
for (int j = 0; j < count; ++j) {
|
||||
dropEntities.add(new ItemStack(Sheep.ITEM_BY_DYE.get(this.getColor())));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
index b3bb0d55da0278d4981830f7073bb326bc836215..7bd2d2b9bb1275fa8e4bdc6d498a59e47838930f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
@@ -190,7 +190,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
if (itemstack.is(Items.SHEARS) && this.readyForShearing()) {
|
||||
// CraftBukkit start
|
||||
// Paper start - custom shear drops
|
||||
- java.util.List<ItemStack> drops = this.generateDefaultDrops();
|
||||
+ java.util.List<ItemStack> drops = this.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.LOOTING, itemstack)); // Purpur
|
||||
org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops);
|
||||
if (event != null) {
|
||||
if (event.isCancelled()) {
|
||||
@@ -223,11 +223,20 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
@Override
|
||||
public void shear(SoundSource shearedSoundCategory) {
|
||||
// Paper start - custom shear drops
|
||||
- this.shear(shearedSoundCategory, this.generateDefaultDrops());
|
||||
+ this.shear(shearedSoundCategory, this.generateDefaultDrops(0)); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
- public java.util.List<ItemStack> generateDefaultDrops() {
|
||||
+ // Purpur start
|
||||
+ public java.util.List<ItemStack> generateDefaultDrops(int looting) {
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.allowShearsLooting) {
|
||||
+ java.util.ArrayList<ItemStack> list = new java.util.ArrayList<>();
|
||||
+ for (int i = 0; i < 1 + looting; i++) {
|
||||
+ list.add(new ItemStack(Items.CARVED_PUMPKIN));
|
||||
+ }
|
||||
+ return java.util.Collections.unmodifiableList(list);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
return java.util.Collections.singletonList(new ItemStack(Items.CARVED_PUMPKIN));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Bogged.java b/src/main/java/net/minecraft/world/entity/monster/Bogged.java
|
||||
index 71efea7a6bfb5662890dae5faae27a3c80afad2b..f3aae2c50d05a05ad4aef36d432b87b431ba07e8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Bogged.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Bogged.java
|
||||
@@ -104,7 +104,7 @@ public class Bogged extends AbstractSkeleton implements Shearable {
|
||||
if (itemstack.is(Items.SHEARS) && this.readyForShearing()) {
|
||||
// CraftBukkit start
|
||||
// Paper start - expose drops in event
|
||||
- java.util.List<net.minecraft.world.item.ItemStack> drops = generateDefaultDrops();
|
||||
+ java.util.List<net.minecraft.world.item.ItemStack> drops = generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.LOOTING, itemstack)); // Purpur
|
||||
final org.bukkit.event.player.PlayerShearEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops);
|
||||
if (event != null) {
|
||||
if (event.isCancelled()) {
|
||||
@@ -171,7 +171,7 @@ public class Bogged extends AbstractSkeleton implements Shearable {
|
||||
@Override
|
||||
public void shear(SoundSource shearedSoundCategory) {
|
||||
// Paper start - shear drop API
|
||||
- this.shear(shearedSoundCategory, generateDefaultDrops());
|
||||
+ this.shear(shearedSoundCategory, generateDefaultDrops(0)); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -184,7 +184,7 @@ public class Bogged extends AbstractSkeleton implements Shearable {
|
||||
|
||||
private void spawnShearedMushrooms() {
|
||||
// Paper start - shear drops API
|
||||
- this.spawnDrops(generateDefaultDrops()); // Only here for people calling spawnSheardMushrooms. Not used otherwise.
|
||||
+ this.spawnDrops(generateDefaultDrops(0)); // Only here for people calling spawnSheardMushrooms. Not used otherwise. // Purpur
|
||||
}
|
||||
private void spawnDrops(java.util.List<net.minecraft.world.item.ItemStack> drops) {
|
||||
drops.forEach(stack -> {
|
||||
@@ -193,14 +193,22 @@ public class Bogged extends AbstractSkeleton implements Shearable {
|
||||
this.forceDrops = false;
|
||||
});
|
||||
}
|
||||
- private void generateShearedMushrooms(java.util.function.Consumer<ItemStack> stackConsumer) {
|
||||
+ private void generateShearedMushrooms(java.util.function.Consumer<ItemStack> stackConsumer, int looting) { // Purpur
|
||||
// Paper end - shear drops API
|
||||
Level world = this.level();
|
||||
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
LootTable loottable = worldserver.getServer().reloadableRegistries().getLootTable(BuiltInLootTables.BOGGED_SHEAR);
|
||||
LootParams lootparams = (new LootParams.Builder(worldserver)).withParameter(LootContextParams.ORIGIN, this.position()).withParameter(LootContextParams.THIS_ENTITY, this).create(LootContextParamSets.SHEARING);
|
||||
- ObjectListIterator objectlistiterator = loottable.getRandomItems(lootparams).iterator();
|
||||
+ // Purpur start
|
||||
+ it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> randomItemsList = loottable.getRandomItems(lootparams);
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.allowShearsLooting && looting > 0) {
|
||||
+ for (int i = 0; i < looting; i++) {
|
||||
+ randomItemsList.addAll(loottable.getRandomItems(lootparams));
|
||||
+ }
|
||||
+ }
|
||||
+ ObjectListIterator objectlistiterator = randomItemsList.iterator();
|
||||
+ // Purpur end
|
||||
|
||||
while (objectlistiterator.hasNext()) {
|
||||
ItemStack itemstack = (ItemStack) objectlistiterator.next();
|
||||
@@ -213,9 +221,9 @@ public class Bogged extends AbstractSkeleton implements Shearable {
|
||||
|
||||
// Paper start - shear drops API
|
||||
@Override
|
||||
- public java.util.List<ItemStack> generateDefaultDrops() {
|
||||
+ public java.util.List<ItemStack> generateDefaultDrops(int looting) { // Purpur
|
||||
final java.util.List<ItemStack> drops = new java.util.ArrayList<>();
|
||||
- this.generateShearedMushrooms(drops::add);
|
||||
+ this.generateShearedMushrooms(drops::add, looting); // Purpur
|
||||
return drops;
|
||||
}
|
||||
// Paper end - shear drops API
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 7ad309e81ec61a6f2553e9ffeb9a986f4d569b37..3d5c89238ee3fbd3c9b33107995ae47733539960 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -393,6 +393,7 @@ public class PurpurConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ public static boolean allowShearsLooting = false;
|
||||
public static boolean allowInapplicableEnchants = false;
|
||||
public static boolean allowIncompatibleEnchants = false;
|
||||
public static boolean allowHigherEnchantsLevels = false;
|
||||
@@ -416,6 +417,7 @@ public class PurpurConfig {
|
||||
}
|
||||
set("settings.enchantment.anvil.allow-unsafe-enchants", null);
|
||||
}
|
||||
+ allowShearsLooting = getBoolean("settings.enchantment.allow-looting-on-shears", allowShearsLooting);
|
||||
allowInapplicableEnchants = getBoolean("settings.enchantment.anvil.allow-inapplicable-enchants", allowInapplicableEnchants);
|
||||
allowIncompatibleEnchants = getBoolean("settings.enchantment.anvil.allow-incompatible-enchants", allowIncompatibleEnchants);
|
||||
allowHigherEnchantsLevels = getBoolean("settings.enchantment.anvil.allow-higher-enchants-levels", allowHigherEnchantsLevels);
|
||||
2108
patches/1-21-3/dropped-server/0247-Remove-Mojang-Profiler.patch
Normal file
2108
patches/1-21-3/dropped-server/0247-Remove-Mojang-Profiler.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 18 Feb 2020 20:30:03 -0600
|
||||
Subject: [PATCH] Purpur config files
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 8d8fe04e6b09d2a5b1cc05002073df5c58cdcb96..c71576fea7e0e7c3ad54912ed61d1ff20aaea4c2 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2121,6 +2121,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Purpur start
|
||||
+ @NotNull
|
||||
+ public org.bukkit.configuration.file.YamlConfiguration getPurpurConfig() {
|
||||
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public java.util.Properties getServerProperties() {
|
||||
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* Sends the component to the player
|
||||
*
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <ben@omega24.dev>
|
||||
Date: Sat, 12 Jun 2021 12:35:38 -0400
|
||||
Subject: [PATCH] Build System Changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 0330a20576c372c29ca4d98a2bc5b01e28303ac3..67f31886a0e5025c1a66b6fb04b44430a9a103fc 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -109,6 +109,8 @@ tasks.jar {
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
+ (options as StandardJavadocDocletOptions).addStringOption("-add-modules", "jdk.incubator.vector") // Purpur - our javadocs need this for pufferfish's SIMD patch
|
||||
+ (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") // Purpur - silence Paper's bajillion javadoc warnings
|
||||
val options = options as StandardJavadocDocletOptions
|
||||
options.overview = "src/main/javadoc/overview.html"
|
||||
options.use()
|
||||
@@ -1,24 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Fredthedoggy <45927799+fredthedoggy@users.noreply.github.com>
|
||||
Date: Thu, 19 Aug 2021 20:04:18 -0400
|
||||
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 f9dd00210c1762a40259f823aeb8d8a5ddc78e3e..9ee0d60775a00a99c8ac779e8602c619565e6a42 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3271,4 +3271,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Override
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Allows you to get if player uses Purpur Client
|
||||
+ *
|
||||
+ * @return True if Player uses Purpur Client
|
||||
+ */
|
||||
+ public boolean usesPurpurClient();
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 5 Jun 2020 23:32:38 -0500
|
||||
Subject: [PATCH] Default permissions
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
|
||||
index 7763d6101ac61900db1e2310966b99584539fd0e..d5a42707d365ffd72532bbb1a59a1ca7145f9918 100644
|
||||
--- a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
|
||||
+++ b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
|
||||
@@ -18,6 +18,7 @@ public final class CommandPermissions {
|
||||
DefaultPermissions.registerPermission(PREFIX + "plugins", "Allows the user to view the list of plugins running on this server", PermissionDefault.TRUE, commands);
|
||||
DefaultPermissions.registerPermission(PREFIX + "reload", "Allows the user to reload the server settings", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(PREFIX + "version", "Allows the user to view the version of the server", PermissionDefault.TRUE, commands);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "purpur", "Allows the user to use the purpur command", PermissionDefault.OP, commands); // Purpur
|
||||
|
||||
commands.recalculatePermissibles();
|
||||
return commands;
|
||||
diff --git a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
|
||||
index e1a4ddf2c07cdd242fa8054a0152522fe4039e85..8e481e3815f5645ee92f0d229e5ff25c8fc9a6c2 100644
|
||||
--- a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
|
||||
+++ b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
|
||||
@@ -89,6 +89,8 @@ public final class DefaultPermissions {
|
||||
CommandPermissions.registerPermissions(parent);
|
||||
BroadcastPermissions.registerPermissions(parent);
|
||||
|
||||
+ PurpurPermissions.registerPermissions(); // Purpur
|
||||
+
|
||||
parent.recalculatePermissibles();
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java b/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..baec4c87d7ea4d54934ca22fd1eb7b46dd69061b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java
|
||||
@@ -0,0 +1,87 @@
|
||||
+package org.bukkit.util.permissions;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.entity.Mob;
|
||||
+import org.bukkit.permissions.Permission;
|
||||
+import org.bukkit.permissions.PermissionDefault;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Set;
|
||||
+
|
||||
+public final class PurpurPermissions {
|
||||
+ private static final String ROOT = "purpur";
|
||||
+ private static final String PREFIX = ROOT + ".";
|
||||
+ private static final Set<String> mobs = new HashSet<>();
|
||||
+
|
||||
+ static {
|
||||
+ for (EntityType mob : EntityType.values()) {
|
||||
+ Class<? extends Entity> clazz = mob.getEntityClass();
|
||||
+ if (clazz != null && Mob.class.isAssignableFrom(clazz)) {
|
||||
+ mobs.add(mob.getName());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static Permission registerPermissions() {
|
||||
+ Permission purpur = DefaultPermissions.registerPermission(ROOT, "Gives the user the ability to use all Purpur utilities and commands", PermissionDefault.FALSE);
|
||||
+
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.six", "Gives the user six rows of enderchest space", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.five", "Gives the user five rows of enderchest space", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.four", "Gives the user four rows of enderchest space", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.three", "Gives the user three rows of enderchest space", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.two", "Gives the user two rows of enderchest space", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.one", "Gives the user one row of enderchest space", PermissionDefault.FALSE, purpur);
|
||||
+
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "debug.f3n", "Allows the user to use F3+N keybind to swap gamemodes", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "joinfullserver", "Allows the user to join a full server", PermissionDefault.OP, purpur);
|
||||
+
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "drop.spawners", "Allows the user to drop spawner cage when broken with diamond pickaxe with silk touch", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "place.spawners", "Allows the user to place spawner cage in the world", PermissionDefault.FALSE, purpur);
|
||||
+
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "mending_shift_click", "Allows the user to use shift-right-click to mend items", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "inventory_totem", "Uses a totem from anywhere in the user's inventory on death", PermissionDefault.FALSE, purpur);
|
||||
+
|
||||
+ Permission anvil = DefaultPermissions.registerPermission(PREFIX + "anvil", "Allows the user to use all anvil color and format abilities", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "anvil.color", "Allows the user to use color codes in an anvil", PermissionDefault.FALSE, anvil);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "anvil.minimessage", "Allows the user to use minimessage tags in an anvil", PermissionDefault.FALSE, anvil);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "anvil.remove_italics", "Allows the user to remove italics in an anvil", PermissionDefault.FALSE, anvil);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "anvil.format", "Allows the user to use format codes in an anvil", PermissionDefault.FALSE, anvil);
|
||||
+ anvil.recalculatePermissibles();
|
||||
+
|
||||
+ Permission book = DefaultPermissions.registerPermission(PREFIX + "book", "Allows the user to use color codes on books", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "book.color.edit", "Allows the user to use color codes on books when editing", PermissionDefault.FALSE, book);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "book.color.sign", "Allows the user to use color codes on books when signing", PermissionDefault.FALSE, book);
|
||||
+ book.recalculatePermissibles();
|
||||
+
|
||||
+ Permission sign = DefaultPermissions.registerPermission(PREFIX + "sign", "Allows the user to use all sign abilities", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "sign.edit", "Allows the user to click signs to open sign editor", PermissionDefault.FALSE, sign);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "sign.color", "Allows the user to use color codes on signs", PermissionDefault.FALSE, sign);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "sign.style", "Allows the user to use style codes on signs", PermissionDefault.FALSE, sign);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "sign.magic", "Allows the user to use magic/obfuscate code on signs", PermissionDefault.FALSE, sign);
|
||||
+ sign.recalculatePermissibles();
|
||||
+
|
||||
+ Permission ride = DefaultPermissions.registerPermission("allow.ride", "Allows the user to ride all mobs", PermissionDefault.FALSE, purpur);
|
||||
+ for (String mob : mobs) {
|
||||
+ DefaultPermissions.registerPermission("allow.ride." + mob, "Allows the user to ride " + mob, PermissionDefault.FALSE, ride);
|
||||
+ }
|
||||
+ ride.recalculatePermissibles();
|
||||
+
|
||||
+ Permission special = DefaultPermissions.registerPermission("allow.special", "Allows the user to use all mobs special abilities", PermissionDefault.FALSE, purpur);
|
||||
+ for (String mob : mobs) {
|
||||
+ DefaultPermissions.registerPermission("allow.special." + mob, "Allows the user to use " + mob + " special ability", PermissionDefault.FALSE, special);
|
||||
+ }
|
||||
+ special.recalculatePermissibles();
|
||||
+
|
||||
+ Permission powered = DefaultPermissions.registerPermission("allow.powered", "Allows the user to toggle all mobs powered state", PermissionDefault.FALSE, purpur);
|
||||
+ DefaultPermissions.registerPermission("allow.powered.creeper", "Allows the user to toggle creeper powered state", PermissionDefault.FALSE, powered);
|
||||
+ powered.recalculatePermissibles();
|
||||
+
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "portal.instant", "Allows the user to bypass portal wait time", PermissionDefault.FALSE, purpur);
|
||||
+
|
||||
+ purpur.recalculatePermissibles();
|
||||
+ return purpur;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,215 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 00:57:16 -0500
|
||||
Subject: [PATCH] Ridables
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index b7a2cecb334ce39fa09d8ab949a29eedbdc44c36..6f55ccfff74b361854bf424fd93f0428e66a6bd7 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -201,6 +201,12 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<Mob> CLIMB_ON_TOP_OF_POWDER_SNOW = GoalKey.of(Mob.class, NamespacedKey.minecraft("climb_on_top_of_powder_snow"));
|
||||
GoalKey<Wolf> WOLF_PANIC = GoalKey.of(Wolf.class, NamespacedKey.minecraft("wolf_panic"));
|
||||
|
||||
+ // Purpur start
|
||||
+ GoalKey<Mob> MOB_HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
|
||||
+ GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
|
||||
+ GoalKey<Llama> LLAMA_HAS_RIDER = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_has_rider"));
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* @deprecated removed in 1.16
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 762cb07861ca8ff058ce8d57ea6c15df1e588bf3..de60e8773e58ef62c15d8f7e293313a62dff674b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1049,4 +1049,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
@NotNull String getScoreboardEntryName();
|
||||
// Paper end - entity scoreboard name
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the riding player
|
||||
+ *
|
||||
+ * @return Riding player
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ Player getRider();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if entity is being ridden
|
||||
+ *
|
||||
+ * @return True if being ridden
|
||||
+ */
|
||||
+ boolean hasRider();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if entity is ridable
|
||||
+ *
|
||||
+ * @return True if ridable
|
||||
+ */
|
||||
+ boolean isRidable();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if entity is ridable in water
|
||||
+ *
|
||||
+ * @return True if ridable in water
|
||||
+ */
|
||||
+ boolean isRidableInWater();
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/RidableMoveEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/RidableMoveEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a037df01b07af9ffb98b67aca412c1d34fade03b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/RidableMoveEvent.java
|
||||
@@ -0,0 +1,103 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.entity.Mob;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Triggered when a ridable mob moves with a rider
|
||||
+ */
|
||||
+public class RidableMoveEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean canceled;
|
||||
+ private final Player rider;
|
||||
+ private Location from;
|
||||
+ private Location to;
|
||||
+
|
||||
+ public RidableMoveEvent(@NotNull Mob entity, @NotNull Player rider, @NotNull Location from, @NotNull Location to) {
|
||||
+ super(entity);
|
||||
+ this.rider = rider;
|
||||
+ this.from = from;
|
||||
+ this.to = to;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Mob getEntity() {
|
||||
+ return (Mob) entity;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public Player getRider() {
|
||||
+ return rider;
|
||||
+ }
|
||||
+
|
||||
+ public boolean isCancelled() {
|
||||
+ return canceled;
|
||||
+ }
|
||||
+
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ canceled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the location this entity moved from
|
||||
+ *
|
||||
+ * @return Location the entity moved from
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getFrom() {
|
||||
+ return from;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the location to mark as where the entity moved from
|
||||
+ *
|
||||
+ * @param from New location to mark as the entity's previous location
|
||||
+ */
|
||||
+ public void setFrom(@NotNull Location from) {
|
||||
+ validateLocation(from);
|
||||
+ this.from = from;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the location this entity moved to
|
||||
+ *
|
||||
+ * @return Location the entity moved to
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getTo() {
|
||||
+ return to;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the location that this entity will move to
|
||||
+ *
|
||||
+ * @param to New Location this entity will move to
|
||||
+ */
|
||||
+ public void setTo(@NotNull Location to) {
|
||||
+ validateLocation(to);
|
||||
+ this.to = to;
|
||||
+ }
|
||||
+
|
||||
+ private void validateLocation(@NotNull Location loc) {
|
||||
+ Preconditions.checkArgument(loc != null, "Cannot use null location!");
|
||||
+ Preconditions.checkArgument(loc.getWorld() != null, "Cannot use null location with null world!");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/RidableSpacebarEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/RidableSpacebarEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3d3a7d898e3278ce998d713dafbb4b354dad7fc7
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/RidableSpacebarEvent.java
|
||||
@@ -0,0 +1,37 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+public class RidableSpacebarEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ public RidableSpacebarEvent(@NotNull Entity entity) {
|
||||
+ super(entity);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 23 Jul 2019 06:50:55 -0500
|
||||
Subject: [PATCH] Allow inventory resizing
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
index cbce826add9dc2b3187c7bea00c27b785d7517df..3a98de6407d9a6307f89c207be1f09e639385ebe 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
@@ -151,7 +151,7 @@ public enum InventoryType {
|
||||
SMITHING_NEW(4, "Upgrade Gear"),
|
||||
;
|
||||
|
||||
- private final int size;
|
||||
+ private int size; public void setDefaultSize(int size) { this.size = size; } // Purpur - remove final and add setter
|
||||
private final String title;
|
||||
private final boolean isCreatable;
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 22:50:05 -0500
|
||||
Subject: [PATCH] Llama API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java
|
||||
index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc04d6a829 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Llama.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Llama.java
|
||||
@@ -119,4 +119,20 @@ public interface Llama extends ChestedHorse, RangedEntity { // Paper
|
||||
@org.jetbrains.annotations.Nullable
|
||||
Llama getCaravanTail();
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Check if this Llama should attempt to join a caravan
|
||||
+ *
|
||||
+ * @return True if Llama is allowed to join a caravan
|
||||
+ */
|
||||
+ boolean shouldJoinCaravan();
|
||||
+
|
||||
+ /**
|
||||
+ * Set if this Llama should attempt to join a caravan
|
||||
+ *
|
||||
+ * @param shouldJoinCaravan True to allow joining a caravan
|
||||
+ */
|
||||
+ void setShouldJoinCaravan(boolean shouldJoinCaravan);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/LlamaJoinCaravanEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/LlamaJoinCaravanEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..8849bb0becb16db907fa648cca2e98ab9d957c75
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/LlamaJoinCaravanEvent.java
|
||||
@@ -0,0 +1,61 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Llama;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a Llama tries to join a caravan.
|
||||
+ * <p>
|
||||
+ * Cancelling the event will not let the Llama join. To prevent future attempts
|
||||
+ * at joining a caravan use {@link Llama#setShouldJoinCaravan(boolean)}.
|
||||
+ */
|
||||
+public class LlamaJoinCaravanEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean canceled;
|
||||
+ private final Llama head;
|
||||
+
|
||||
+ public LlamaJoinCaravanEvent(@NotNull Llama llama, @NotNull Llama head) {
|
||||
+ super(llama);
|
||||
+ this.head = head;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Llama getEntity() {
|
||||
+ return (Llama) entity;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the Llama that this Llama is about to follow
|
||||
+ *
|
||||
+ * @return Llama about to be followed
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Llama getHead() {
|
||||
+ return head;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return canceled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ canceled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/LlamaLeaveCaravanEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/LlamaLeaveCaravanEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c268c35b541a222d50875c29770c846a8ffcc4f8
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/LlamaLeaveCaravanEvent.java
|
||||
@@ -0,0 +1,34 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Llama;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a Llama leaves a caravan
|
||||
+ */
|
||||
+public class LlamaLeaveCaravanEvent extends EntityEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ public LlamaLeaveCaravanEvent(@NotNull Llama llama) {
|
||||
+ super(llama);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Llama getEntity() {
|
||||
+ return (Llama) entity;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,111 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 10 Aug 2019 22:19:56 -0500
|
||||
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 9ee0d60775a00a99c8ac779e8602c619565e6a42..2ddacd7f74cba66f67ab6957e03522453de01117 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3279,5 +3279,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @return True if Player uses Purpur Client
|
||||
*/
|
||||
public boolean usesPurpurClient();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if player is AFK
|
||||
+ *
|
||||
+ * @return True if AFK
|
||||
+ */
|
||||
+ boolean isAfk();
|
||||
+
|
||||
+ /**
|
||||
+ * Set player as AFK
|
||||
+ *
|
||||
+ * @param setAfk Whether to set AFK or not
|
||||
+ */
|
||||
+ void setAfk(boolean setAfk);
|
||||
+
|
||||
+ /**
|
||||
+ * Reset the idle timer back to 0
|
||||
+ */
|
||||
+ void resetIdleTimer();
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/PlayerAFKEvent.java b/src/main/java/org/purpurmc/purpur/event/PlayerAFKEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..25e92af7710316ed2afedf846a59dbd672869b51
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/PlayerAFKEvent.java
|
||||
@@ -0,0 +1,70 @@
|
||||
+package org.purpurmc.purpur.event;
|
||||
+
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+public class PlayerAFKEvent extends PlayerEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final boolean setAfk;
|
||||
+ private boolean shouldKick;
|
||||
+ private String broadcast;
|
||||
+ private boolean cancel;
|
||||
+
|
||||
+ public PlayerAFKEvent(@NotNull Player player, boolean setAfk, boolean shouldKick, @Nullable String broadcast, boolean async) {
|
||||
+ super(player, async);
|
||||
+ this.setAfk = setAfk;
|
||||
+ this.shouldKick = shouldKick;
|
||||
+ this.broadcast = broadcast;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Whether player is going afk or coming back
|
||||
+ *
|
||||
+ * @return True if going afk. False is coming back
|
||||
+ */
|
||||
+ public boolean isGoingAfk() {
|
||||
+ return setAfk;
|
||||
+ }
|
||||
+
|
||||
+ public boolean shouldKick() {
|
||||
+ return shouldKick;
|
||||
+ }
|
||||
+
|
||||
+ public void setShouldKick(boolean shouldKick) {
|
||||
+ this.shouldKick = shouldKick;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public String getBroadcastMsg() {
|
||||
+ return broadcast;
|
||||
+ }
|
||||
+
|
||||
+ public void setBroadcastMsg(@Nullable String broadcast) {
|
||||
+ this.broadcast = broadcast;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancel = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,44 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 26 May 2019 15:18:40 -0500
|
||||
Subject: [PATCH] Bring back server name
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index f78b5fd3c3347d28da58777bff88903d2eb140f6..7338dad470cd75814cce5be40f82058554484607 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2756,4 +2756,15 @@ public final class Bukkit {
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the name of this server
|
||||
+ * @return the name of the server
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public static String getServerName() {
|
||||
+ return server.getServerName();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index c71576fea7e0e7c3ad54912ed61d1ff20aaea4c2..fc2ff6fce4d7b4466cb7936b530c1c0d17f9f24f 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2416,4 +2416,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
||||
// Paper end - Folia region threading API
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the name of this server
|
||||
+ * @return the name of the server
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ String getServerName();
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 31 May 2019 00:08:28 -0500
|
||||
Subject: [PATCH] ExecuteCommandEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
index ac9a28922f8a556944a4c3649d74c32c622f0cb0..e842d13febca67ffa1c89fb2c1324d2609fb81fd 100644
|
||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
@@ -143,6 +143,19 @@ public class SimpleCommandMap implements CommandMap {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ String[] parsedArgs = Arrays.copyOfRange(args, 1, args.length);
|
||||
+ org.purpurmc.purpur.event.ExecuteCommandEvent event = new org.purpurmc.purpur.event.ExecuteCommandEvent(sender, target, sentCommandLabel, parsedArgs);
|
||||
+ if (!event.callEvent()) {
|
||||
+ return true; // cancelled
|
||||
+ }
|
||||
+
|
||||
+ sender = event.getSender();
|
||||
+ target = event.getCommand();
|
||||
+ sentCommandLabel = event.getLabel();
|
||||
+ parsedArgs = event.getArgs();
|
||||
+ // Purpur end
|
||||
+
|
||||
// Paper start - Plugins do weird things to workaround normal registration
|
||||
if (target.timings == null) {
|
||||
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
|
||||
@@ -152,7 +165,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
try {
|
||||
try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources
|
||||
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
||||
- target.execute(sender, sentCommandLabel, Arrays.copyOfRange(args, 1, args.length));
|
||||
+ target.execute(sender, sentCommandLabel, parsedArgs); // Purpur
|
||||
} // target.timings.stopTiming(); // Spigot // Paper
|
||||
} catch (CommandException ex) {
|
||||
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/ExecuteCommandEvent.java b/src/main/java/org/purpurmc/purpur/event/ExecuteCommandEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..bc590c4d49d32f4365a50ceb5785e798702a8179
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/ExecuteCommandEvent.java
|
||||
@@ -0,0 +1,130 @@
|
||||
+package org.purpurmc.purpur.event;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * This event is called whenever someone runs a command
|
||||
+ */
|
||||
+public class ExecuteCommandEvent extends Event implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean cancel = false;
|
||||
+ private CommandSender sender;
|
||||
+ private Command command;
|
||||
+ private String label;
|
||||
+ private String[] args;
|
||||
+
|
||||
+ public ExecuteCommandEvent(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @Nullable String[] args) {
|
||||
+ this.sender = sender;
|
||||
+ this.command = command;
|
||||
+ this.label = label;
|
||||
+ this.args = args;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the command that the player is attempting to execute.
|
||||
+ *
|
||||
+ * @return Command the player is attempting to execute
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Command getCommand() {
|
||||
+ return command;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the command that the player will execute.
|
||||
+ *
|
||||
+ * @param command New command that the player will execute
|
||||
+ * @throws IllegalArgumentException if command is null or empty
|
||||
+ */
|
||||
+ public void setCommand(@NotNull Command command) throws IllegalArgumentException {
|
||||
+ Preconditions.checkArgument(command != null, "Command cannot be null");
|
||||
+ this.command = command;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the sender that this command will be executed as.
|
||||
+ *
|
||||
+ * @return Sender this command will be executed as
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public CommandSender getSender() {
|
||||
+ return sender;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the sender that this command will be executed as.
|
||||
+ *
|
||||
+ * @param sender New sender which this event will execute as
|
||||
+ * @throws IllegalArgumentException if the sender provided is null
|
||||
+ */
|
||||
+ public void setSender(@NotNull final CommandSender sender) throws IllegalArgumentException {
|
||||
+ Preconditions.checkArgument(sender != null, "Sender cannot be null");
|
||||
+ this.sender = sender;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the label used to execute this command
|
||||
+ *
|
||||
+ * @return Label used to execute this command
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getLabel() {
|
||||
+ return label;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set the label used to execute this command
|
||||
+ *
|
||||
+ * @param label Label used
|
||||
+ */
|
||||
+ public void setLabel(@NotNull String label) {
|
||||
+ this.label = label;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the args passed to the command
|
||||
+ *
|
||||
+ * @return Args passed to the command
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String[] getArgs() {
|
||||
+ return args;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set the args passed to the command
|
||||
+ *
|
||||
+ * @param args Args passed to the command
|
||||
+ */
|
||||
+ public void setArgs(@NotNull String[] args) {
|
||||
+ this.args = args;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancel = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,42 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 23 Jul 2019 10:07:24 -0500
|
||||
Subject: [PATCH] Lagging threshold
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 7338dad470cd75814cce5be40f82058554484607..a32155e0cc63d4e4714a953edbae0b19544ff3ef 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2766,5 +2766,14 @@ public final class Bukkit {
|
||||
public static String getServerName() {
|
||||
return server.getServerName();
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Check if server is lagging according to laggy threshold setting
|
||||
+ *
|
||||
+ * @return True if lagging
|
||||
+ */
|
||||
+ public static boolean isLagging() {
|
||||
+ return server.isLagging();
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index fc2ff6fce4d7b4466cb7936b530c1c0d17f9f24f..5b8ce8a5658021c6fdfeabca6c7bb31ebc58e71d 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2424,5 +2424,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
@NotNull
|
||||
String getServerName();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if server is lagging according to laggy threshold setting
|
||||
+ *
|
||||
+ * @return True if lagging
|
||||
+ */
|
||||
+ boolean isLagging();
|
||||
// Purpur end
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 18:21:15 -0500
|
||||
Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java b/src/main/java/org/purpurmc/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..519809eab5d926dc7b0a7bad5d446d0defc099dc
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java
|
||||
@@ -0,0 +1,85 @@
|
||||
+package org.purpurmc.purpur.event;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
+import org.bukkit.block.CreatureSpawner;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+public class PlayerSetSpawnerTypeWithEggEvent extends PlayerEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Block block;
|
||||
+ private final CreatureSpawner spawner;
|
||||
+ private EntityType type;
|
||||
+ private boolean cancel;
|
||||
+
|
||||
+ public PlayerSetSpawnerTypeWithEggEvent(@NotNull Player player, @NotNull Block block, @NotNull CreatureSpawner spawner, @NotNull EntityType type) {
|
||||
+ super(player);
|
||||
+ this.block = block;
|
||||
+ this.spawner = spawner;
|
||||
+ this.type = type;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the spawner Block in the world
|
||||
+ *
|
||||
+ * @return Spawner Block
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Block getBlock() {
|
||||
+ return block;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the spawner state
|
||||
+ *
|
||||
+ * @return Spawner state
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public CreatureSpawner getSpawner() {
|
||||
+ return spawner;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the EntityType being set on the spawner
|
||||
+ *
|
||||
+ * @return EntityType being set
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public EntityType getEntityType() {
|
||||
+ return type;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the EntityType being set on the spawner
|
||||
+ *
|
||||
+ * @param type EntityType to set
|
||||
+ */
|
||||
+ public void setEntityType(@NotNull EntityType type) {
|
||||
+ this.type = type;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancel = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,37 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 2 May 2020 20:55:31 -0500
|
||||
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 2ddacd7f74cba66f67ab6957e03522453de01117..1994acf66919c92f59e2a9f2f873f50b73d76d1a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3298,5 +3298,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* Reset the idle timer back to 0
|
||||
*/
|
||||
void resetIdleTimer();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if player is invulnerable from recently spawning or accepting a resource pack
|
||||
+ *
|
||||
+ * @return True if invulnerable
|
||||
+ */
|
||||
+ boolean isSpawnInvulnerable();
|
||||
+
|
||||
+ /**
|
||||
+ * Get invulnerable ticks remaining
|
||||
+ *
|
||||
+ * @return Invulnerable ticks
|
||||
+ */
|
||||
+ int getSpawnInvulnerableTicks();
|
||||
+
|
||||
+ /**
|
||||
+ * Set invulnerable ticks remaining
|
||||
+ *
|
||||
+ * @param invulnerableTicks Invulnerable ticks remaining
|
||||
+ */
|
||||
+ void setSpawnInvulnerableTicks(int invulnerableTicks);
|
||||
// Purpur end
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 19 Apr 2020 00:25:09 -0500
|
||||
Subject: [PATCH] Anvil API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/AnvilInventory.java b/src/main/java/org/bukkit/inventory/AnvilInventory.java
|
||||
index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c1f2081be 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/AnvilInventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/AnvilInventory.java
|
||||
@@ -123,4 +123,14 @@ public interface AnvilInventory extends Inventory {
|
||||
setItem(2, result);
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ boolean canBypassCost();
|
||||
+
|
||||
+ void setBypassCost(boolean bypassCost);
|
||||
+
|
||||
+ boolean canDoUnsafeEnchants();
|
||||
+
|
||||
+ void setDoUnsafeEnchants(boolean canDoUnsafeEnchants);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/inventory/AnvilTakeResultEvent.java b/src/main/java/org/purpurmc/purpur/event/inventory/AnvilTakeResultEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b363c91a29f826910db22f2643decf996a067ab5
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/inventory/AnvilTakeResultEvent.java
|
||||
@@ -0,0 +1,52 @@
|
||||
+package org.purpurmc.purpur.event.inventory;
|
||||
+
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.inventory.InventoryEvent;
|
||||
+import org.bukkit.inventory.AnvilInventory;
|
||||
+import org.bukkit.inventory.InventoryView;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a player takes the result item out of an anvil
|
||||
+ */
|
||||
+public class AnvilTakeResultEvent extends InventoryEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Player player;
|
||||
+ private final ItemStack result;
|
||||
+
|
||||
+ public AnvilTakeResultEvent(@NotNull HumanEntity player, @NotNull InventoryView view, @NotNull ItemStack result) {
|
||||
+ super(view);
|
||||
+ this.player = (Player) player;
|
||||
+ this.result = result;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public Player getPlayer() {
|
||||
+ return player;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public ItemStack getResult() {
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public AnvilInventory getInventory() {
|
||||
+ return (AnvilInventory) super.getInventory();
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/inventory/AnvilUpdateResultEvent.java b/src/main/java/org/purpurmc/purpur/event/inventory/AnvilUpdateResultEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..fd6a5a3589d436c2aaf988fd305899695799d3bb
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/inventory/AnvilUpdateResultEvent.java
|
||||
@@ -0,0 +1,35 @@
|
||||
+package org.purpurmc.purpur.event.inventory;
|
||||
+
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.inventory.InventoryEvent;
|
||||
+import org.bukkit.inventory.AnvilInventory;
|
||||
+import org.bukkit.inventory.InventoryView;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when anvil slots change, triggering the result slot to be updated
|
||||
+ */
|
||||
+public class AnvilUpdateResultEvent extends InventoryEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ public AnvilUpdateResultEvent(@NotNull InventoryView view) {
|
||||
+ super(view);
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public AnvilInventory getInventory() {
|
||||
+ return (AnvilInventory) super.getInventory();
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,701 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 15 Mar 2020 20:52:12 -0500
|
||||
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
|
||||
--- 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
|
||||
public boolean isEnabledByFeature(@NotNull World world) {
|
||||
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ public boolean isArmor() {
|
||||
+ switch (this) {
|
||||
+ // <editor-fold defaultstate="collapsed" desc="isarmor">
|
||||
+ case LEATHER_BOOTS:
|
||||
+ case LEATHER_CHESTPLATE:
|
||||
+ case LEATHER_HELMET:
|
||||
+ case LEATHER_LEGGINGS:
|
||||
+ case CHAINMAIL_BOOTS:
|
||||
+ case CHAINMAIL_CHESTPLATE:
|
||||
+ case CHAINMAIL_HELMET:
|
||||
+ case CHAINMAIL_LEGGINGS:
|
||||
+ case IRON_BOOTS:
|
||||
+ case IRON_CHESTPLATE:
|
||||
+ case IRON_HELMET:
|
||||
+ case IRON_LEGGINGS:
|
||||
+ case GOLDEN_BOOTS:
|
||||
+ case GOLDEN_CHESTPLATE:
|
||||
+ case GOLDEN_HELMET:
|
||||
+ case GOLDEN_LEGGINGS:
|
||||
+ case DIAMOND_BOOTS:
|
||||
+ case DIAMOND_CHESTPLATE:
|
||||
+ case DIAMOND_HELMET:
|
||||
+ case DIAMOND_LEGGINGS:
|
||||
+ case NETHERITE_BOOTS:
|
||||
+ case NETHERITE_CHESTPLATE:
|
||||
+ case NETHERITE_HELMET:
|
||||
+ case NETHERITE_LEGGINGS:
|
||||
+ case TURTLE_HELMET:
|
||||
+ return true;
|
||||
+ default:
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index d15a74c38576c49df61cfab02c70fc5d8c0dd5f7..64055402076b62d32ba947830d935b79bae12d95 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
+// Purpur start
|
||||
+import com.google.common.collect.Multimap;
|
||||
+import java.util.Collection;
|
||||
+import org.bukkit.attribute.Attribute;
|
||||
+import org.bukkit.attribute.AttributeModifier;
|
||||
+import org.bukkit.block.data.BlockData;
|
||||
+import org.bukkit.inventory.meta.BlockDataMeta;
|
||||
+import org.bukkit.inventory.meta.Repairable;
|
||||
+import org.bukkit.persistence.PersistentDataContainer;
|
||||
+import org.bukkit.persistence.PersistentDataHolder;
|
||||
+import com.destroystokyo.paper.Namespaced;
|
||||
+// Purpur end
|
||||
|
||||
/**
|
||||
* Represents a stack of items.
|
||||
@@ -986,4 +998,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return livingEntity.damageItemStack(this, amount);
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Gets the display name that is set.
|
||||
+ * <p>
|
||||
+ * Plugins should check that hasDisplayName() returns <code>true</code>
|
||||
+ * before calling this method.
|
||||
+ *
|
||||
+ * @return the display name that is set
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getDisplayName() {
|
||||
+ return getItemMeta().getDisplayName();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the display name.
|
||||
+ *
|
||||
+ * @param name the name to set
|
||||
+ */
|
||||
+ public void setDisplayName(@Nullable String name) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ itemMeta.setDisplayName(name);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for existence of a display name.
|
||||
+ *
|
||||
+ * @return true if this has a display name
|
||||
+ */
|
||||
+ public boolean hasDisplayName() {
|
||||
+ return hasItemMeta() && getItemMeta().hasDisplayName();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the localized display name that is set.
|
||||
+ * <p>
|
||||
+ * Plugins should check that hasLocalizedName() returns <code>true</code>
|
||||
+ * before calling this method.
|
||||
+ *
|
||||
+ * @return the localized name that is set
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getLocalizedName() {
|
||||
+ return getItemMeta().getLocalizedName();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the localized name.
|
||||
+ *
|
||||
+ * @param name the name to set
|
||||
+ */
|
||||
+ public void setLocalizedName(@Nullable String name) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ itemMeta.setLocalizedName(name);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for existence of a localized name.
|
||||
+ *
|
||||
+ * @return true if this has a localized name
|
||||
+ */
|
||||
+ public boolean hasLocalizedName() {
|
||||
+ return hasItemMeta() && getItemMeta().hasLocalizedName();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for existence of lore.
|
||||
+ *
|
||||
+ * @return true if this has lore
|
||||
+ */
|
||||
+ public boolean hasLore() {
|
||||
+ return hasItemMeta() && getItemMeta().hasLore();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for existence of the specified enchantment.
|
||||
+ *
|
||||
+ * @param ench enchantment to check
|
||||
+ * @return true if this enchantment exists for this meta
|
||||
+ */
|
||||
+ public boolean hasEnchant(@NotNull Enchantment ench) {
|
||||
+ return hasItemMeta() && getItemMeta().hasEnchant(ench);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for the level of the specified enchantment.
|
||||
+ *
|
||||
+ * @param ench enchantment to check
|
||||
+ * @return The level that the specified enchantment has, or 0 if none
|
||||
+ */
|
||||
+ public int getEnchantLevel(@NotNull Enchantment ench) {
|
||||
+ return getItemMeta().getEnchantLevel(ench);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns a copy the enchantments in this ItemMeta. <br>
|
||||
+ * Returns an empty map if none.
|
||||
+ *
|
||||
+ * @return An immutable copy of the enchantments
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Map<Enchantment, Integer> getEnchants() {
|
||||
+ return getItemMeta().getEnchants();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Adds the specified enchantment to this item meta.
|
||||
+ *
|
||||
+ * @param ench Enchantment to add
|
||||
+ * @param level Level for the enchantment
|
||||
+ * @param ignoreLevelRestriction this indicates the enchantment should be
|
||||
+ * applied, ignoring the level limit
|
||||
+ * @return true if the item meta changed as a result of this call, false
|
||||
+ * otherwise
|
||||
+ */
|
||||
+ public boolean addEnchant(@NotNull Enchantment ench, int level, boolean ignoreLevelRestriction) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ boolean result = itemMeta.addEnchant(ench, level, ignoreLevelRestriction);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Removes the specified enchantment from this item meta.
|
||||
+ *
|
||||
+ * @param ench Enchantment to remove
|
||||
+ * @return true if the item meta changed as a result of this call, false
|
||||
+ * otherwise
|
||||
+ */
|
||||
+ public boolean removeEnchant(@NotNull Enchantment ench) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ boolean result = itemMeta.removeEnchant(ench);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for the existence of any enchantments.
|
||||
+ *
|
||||
+ * @return true if an enchantment exists on this meta
|
||||
+ */
|
||||
+ public boolean hasEnchants() {
|
||||
+ return hasItemMeta() && getItemMeta().hasEnchants();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if the specified enchantment conflicts with any enchantments in
|
||||
+ * this ItemMeta.
|
||||
+ *
|
||||
+ * @param ench enchantment to test
|
||||
+ * @return true if the enchantment conflicts, false otherwise
|
||||
+ */
|
||||
+ public boolean hasConflictingEnchant(@NotNull Enchantment ench) {
|
||||
+ return hasItemMeta() && getItemMeta().hasConflictingEnchant(ench);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the custom model data.
|
||||
+ * <p>
|
||||
+ * CustomModelData is an integer that may be associated client side with a
|
||||
+ * custom item model.
|
||||
+ *
|
||||
+ * @param data the data to set, or null to clear
|
||||
+ */
|
||||
+ public void setCustomModelData(@Nullable Integer data) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ itemMeta.setCustomModelData(data);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the custom model data that is set.
|
||||
+ * <p>
|
||||
+ * CustomModelData is an integer that may be associated client side with a
|
||||
+ * custom item model.
|
||||
+ * <p>
|
||||
+ * Plugins should check that hasCustomModelData() returns <code>true</code>
|
||||
+ * before calling this method.
|
||||
+ *
|
||||
+ * @return the localized name that is set
|
||||
+ */
|
||||
+ public int getCustomModelData() {
|
||||
+ return getItemMeta().getCustomModelData();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for existence of custom model data.
|
||||
+ * <p>
|
||||
+ * CustomModelData is an integer that may be associated client side with a
|
||||
+ * custom item model.
|
||||
+ *
|
||||
+ * @return true if this has custom model data
|
||||
+ */
|
||||
+ public boolean hasCustomModelData() {
|
||||
+ return hasItemMeta() && getItemMeta().hasCustomModelData();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns whether the item has block data currently attached to it.
|
||||
+ *
|
||||
+ * @return whether block data is already attached
|
||||
+ */
|
||||
+ public boolean hasBlockData() {
|
||||
+ return hasItemMeta() && ((BlockDataMeta) getItemMeta()).hasBlockData();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the currently attached block data for this item or creates a new
|
||||
+ * one if one doesn't exist.
|
||||
+ *
|
||||
+ * The state is a copy, it must be set back (or to another item) with
|
||||
+ * {@link #setBlockData(BlockData)}
|
||||
+ *
|
||||
+ * @param material the material we wish to get this data in the context of
|
||||
+ * @return the attached data or new data
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public BlockData getBlockData(@NotNull Material material) {
|
||||
+ return ((BlockDataMeta) getItemMeta()).getBlockData(material);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Attaches a copy of the passed block data to the item.
|
||||
+ *
|
||||
+ * @param blockData the block data to attach to the block.
|
||||
+ * @throws IllegalArgumentException if the blockData is null or invalid for
|
||||
+ * this item.
|
||||
+ */
|
||||
+ public void setBlockData(@NotNull BlockData blockData) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ ((BlockDataMeta) itemMeta).setBlockData(blockData);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the repair penalty
|
||||
+ *
|
||||
+ * @return the repair penalty
|
||||
+ */
|
||||
+ public int getRepairCost() {
|
||||
+ return ((Repairable) getItemMeta()).getRepairCost();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the repair penalty
|
||||
+ *
|
||||
+ * @param cost repair penalty
|
||||
+ */
|
||||
+ public void setRepairCost(int cost) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ ((Repairable) itemMeta).setRepairCost(cost);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks to see if this has a repair penalty
|
||||
+ *
|
||||
+ * @return true if this has a repair penalty
|
||||
+ */
|
||||
+ public boolean hasRepairCost() {
|
||||
+ return hasItemMeta() && ((Repairable) getItemMeta()).hasRepairCost();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return if the unbreakable tag is true. An unbreakable item will not lose
|
||||
+ * durability.
|
||||
+ *
|
||||
+ * @return true if the unbreakable tag is true
|
||||
+ */
|
||||
+ public boolean isUnbreakable() {
|
||||
+ return hasItemMeta() && getItemMeta().isUnbreakable();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the unbreakable tag. An unbreakable item will not lose durability.
|
||||
+ *
|
||||
+ * @param unbreakable true if set unbreakable
|
||||
+ */
|
||||
+ public void setUnbreakable(boolean unbreakable) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ itemMeta.setUnbreakable(unbreakable);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for the existence of any AttributeModifiers.
|
||||
+ *
|
||||
+ * @return true if any AttributeModifiers exist
|
||||
+ */
|
||||
+ public boolean hasAttributeModifiers() {
|
||||
+ return hasItemMeta() && getItemMeta().hasAttributeModifiers();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return an immutable copy of all Attributes and
|
||||
+ * their modifiers in this ItemMeta.<br>
|
||||
+ * Returns null if none exist.
|
||||
+ *
|
||||
+ * @return an immutable {@link Multimap} of Attributes
|
||||
+ * and their AttributeModifiers, or null if none exist
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Multimap<Attribute, AttributeModifier> getAttributeModifiers() {
|
||||
+ return getItemMeta().getAttributeModifiers();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return an immutable copy of all {@link Attribute}s and their
|
||||
+ * {@link AttributeModifier}s for a given {@link EquipmentSlot}.<br>
|
||||
+ * Any {@link AttributeModifier} that does have have a given
|
||||
+ * {@link EquipmentSlot} will be returned. This is because
|
||||
+ * AttributeModifiers without a slot are active in any slot.<br>
|
||||
+ * If there are no attributes set for the given slot, an empty map
|
||||
+ * will be returned.
|
||||
+ *
|
||||
+ * @param slot the {@link EquipmentSlot} to check
|
||||
+ * @return the immutable {@link Multimap} with the
|
||||
+ * respective Attributes and modifiers, or an empty map
|
||||
+ * if no attributes are set.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Multimap<Attribute, AttributeModifier> getAttributeModifiers(@Nullable EquipmentSlot slot) {
|
||||
+ return getItemMeta().getAttributeModifiers(slot);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return an immutable copy of all {@link AttributeModifier}s
|
||||
+ * for a given {@link Attribute}
|
||||
+ *
|
||||
+ * @param attribute the {@link Attribute}
|
||||
+ * @return an immutable collection of {@link AttributeModifier}s
|
||||
+ * or null if no AttributeModifiers exist for the Attribute.
|
||||
+ * @throws NullPointerException if Attribute is null
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Collection<AttributeModifier> getAttributeModifiers(@NotNull Attribute attribute) {
|
||||
+ return getItemMeta().getAttributeModifiers(attribute);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Add an Attribute and it's Modifier.
|
||||
+ * AttributeModifiers can now support {@link EquipmentSlot}s.
|
||||
+ * If not set, the {@link AttributeModifier} will be active in ALL slots.
|
||||
+ * <br>
|
||||
+ * Two {@link AttributeModifier}s that have the same {@link java.util.UUID}
|
||||
+ * cannot exist on the same Attribute.
|
||||
+ *
|
||||
+ * @param attribute the {@link Attribute} to modify
|
||||
+ * @param modifier the {@link AttributeModifier} specifying the modification
|
||||
+ * @return true if the Attribute and AttributeModifier were
|
||||
+ * successfully added
|
||||
+ * @throws NullPointerException if Attribute is null
|
||||
+ * @throws NullPointerException if AttributeModifier is null
|
||||
+ * @throws IllegalArgumentException if AttributeModifier already exists
|
||||
+ */
|
||||
+ public boolean addAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ boolean result = itemMeta.addAttributeModifier(attribute, modifier);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set all {@link Attribute}s and their {@link AttributeModifier}s.
|
||||
+ * To clear all currently set Attributes and AttributeModifiers use
|
||||
+ * null or an empty Multimap.
|
||||
+ * If not null nor empty, this will filter all entries that are not-null
|
||||
+ * and add them to the ItemStack.
|
||||
+ *
|
||||
+ * @param attributeModifiers the new Multimap containing the Attributes
|
||||
+ * and their AttributeModifiers
|
||||
+ */
|
||||
+ public void setAttributeModifiers(@Nullable Multimap<Attribute, AttributeModifier> attributeModifiers) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ itemMeta.setAttributeModifiers(attributeModifiers);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Remove all {@link AttributeModifier}s associated with the given
|
||||
+ * {@link Attribute}.
|
||||
+ * This will return false if nothing was removed.
|
||||
+ *
|
||||
+ * @param attribute attribute to remove
|
||||
+ * @return true if all modifiers were removed from a given
|
||||
+ * Attribute. Returns false if no attributes were
|
||||
+ * removed.
|
||||
+ * @throws NullPointerException if Attribute is null
|
||||
+ */
|
||||
+ public boolean removeAttributeModifier(@NotNull Attribute attribute) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ boolean result = itemMeta.removeAttributeModifier(attribute);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Remove all {@link Attribute}s and {@link AttributeModifier}s for a
|
||||
+ * given {@link EquipmentSlot}.<br>
|
||||
+ * If the given {@link EquipmentSlot} is null, this will remove all
|
||||
+ * {@link AttributeModifier}s that do not have an EquipmentSlot set.
|
||||
+ *
|
||||
+ * @param slot the {@link EquipmentSlot} to clear all Attributes and
|
||||
+ * their modifiers for
|
||||
+ * @return true if all modifiers were removed that match the given
|
||||
+ * EquipmentSlot.
|
||||
+ */
|
||||
+ public boolean removeAttributeModifier(@Nullable EquipmentSlot slot) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ boolean result = itemMeta.removeAttributeModifier(slot);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Remove a specific {@link Attribute} and {@link AttributeModifier}.
|
||||
+ * AttributeModifiers are matched according to their {@link java.util.UUID}.
|
||||
+ *
|
||||
+ * @param attribute the {@link Attribute} to remove
|
||||
+ * @param modifier the {@link AttributeModifier} to remove
|
||||
+ * @return if any attribute modifiers were remove
|
||||
+ *
|
||||
+ * @throws NullPointerException if the Attribute is null
|
||||
+ * @throws NullPointerException if the AttributeModifier is null
|
||||
+ *
|
||||
+ * @see AttributeModifier#getUniqueId()
|
||||
+ */
|
||||
+ public boolean removeAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ boolean result = itemMeta.removeAttributeModifier(attribute, modifier);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns a custom tag container capable of storing tags on the object.
|
||||
+ *
|
||||
+ * Note that the tags stored on this container are all stored under their
|
||||
+ * own custom namespace therefore modifying default tags using this
|
||||
+ * {@link PersistentDataHolder} is impossible.
|
||||
+ *
|
||||
+ * @return the persistent metadata container
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public PersistentDataContainer getPersistentDataContainer() {
|
||||
+ return getItemMeta().getPersistentDataContainer();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks to see if this item has damage
|
||||
+ *
|
||||
+ * @return true if this has damage
|
||||
+ */
|
||||
+ public boolean hasDamage() {
|
||||
+ return hasItemMeta() && ((Damageable) getItemMeta()).hasDamage();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the damage
|
||||
+ *
|
||||
+ * @return the damage
|
||||
+ */
|
||||
+ public int getDamage() {
|
||||
+ return ((Damageable) getItemMeta()).getDamage();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the damage
|
||||
+ *
|
||||
+ * @param damage item damage
|
||||
+ */
|
||||
+ public void setDamage(int damage) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ ((Damageable) itemMeta).setDamage(damage);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the collection of namespaced keys that the item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
|
||||
+ *
|
||||
+ * @return Set of {@link com.destroystokyo.paper.Namespaced}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public java.util.Set<Namespaced> getDestroyableKeys() {
|
||||
+ return getItemMeta().getDestroyableKeys();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the collection of namespaced keys that the item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
|
||||
+ *
|
||||
+ * @param canDestroy Collection of {@link com.destroystokyo.paper.Namespaced}
|
||||
+ */
|
||||
+ public void setDestroyableKeys(@NotNull Collection<Namespaced> canDestroy) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ itemMeta.setDestroyableKeys(canDestroy);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the collection of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
|
||||
+ *
|
||||
+ * @return Set of {@link com.destroystokyo.paper.Namespaced}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public java.util.Set<Namespaced> getPlaceableKeys() {
|
||||
+ return getItemMeta().getPlaceableKeys();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the set of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
|
||||
+ *
|
||||
+ * @param canPlaceOn Collection of {@link com.destroystokyo.paper.Namespaced}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public void setPlaceableKeys(@NotNull Collection<Namespaced> canPlaceOn) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ itemMeta.setPlaceableKeys(canPlaceOn);
|
||||
+ setItemMeta(itemMeta);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for the existence of any keys that the item can be placed on
|
||||
+ *
|
||||
+ * @return true if this item has placeable keys
|
||||
+ */
|
||||
+ public boolean hasPlaceableKeys() {
|
||||
+ return hasItemMeta() && getItemMeta().hasPlaceableKeys();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks for the existence of any keys that the item can destroy
|
||||
+ *
|
||||
+ * @return true if this item has destroyable keys
|
||||
+ */
|
||||
+ public boolean hasDestroyableKeys() {
|
||||
+ return hasItemMeta() && getItemMeta().hasDestroyableKeys();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Repairs this item by 1 durability
|
||||
+ */
|
||||
+ public void repair() {
|
||||
+ repair(1);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Damages this item by 1 durability
|
||||
+ *
|
||||
+ * @return True if damage broke the item
|
||||
+ */
|
||||
+ public boolean damage() {
|
||||
+ return damage(1);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Repairs this item's durability by amount
|
||||
+ *
|
||||
+ * @param amount Amount of durability to repair
|
||||
+ */
|
||||
+ public void repair(int amount) {
|
||||
+ damage(-amount);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Damages this item's durability by amount
|
||||
+ *
|
||||
+ * @param amount Amount of durability to damage
|
||||
+ * @return True if damage broke the item
|
||||
+ */
|
||||
+ public boolean damage(int amount) {
|
||||
+ return damage(amount, false);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Damages this item's durability by amount
|
||||
+ *
|
||||
+ * @param amount Amount of durability to damage
|
||||
+ * @param ignoreUnbreaking Ignores unbreaking enchantment
|
||||
+ * @return True if damage broke the item
|
||||
+ */
|
||||
+ public boolean damage(int amount, boolean ignoreUnbreaking) {
|
||||
+ Damageable damageable = (Damageable) getItemMeta();
|
||||
+ if (amount > 0) {
|
||||
+ int unbreaking = getEnchantLevel(Enchantment.DURABILITY);
|
||||
+ int reduce = 0;
|
||||
+ for (int i = 0; unbreaking > 0 && i < amount; ++i) {
|
||||
+ if (reduceDamage(java.util.concurrent.ThreadLocalRandom.current(), unbreaking)) {
|
||||
+ ++reduce;
|
||||
+ }
|
||||
+ }
|
||||
+ amount -= reduce;
|
||||
+ if (amount <= 0) {
|
||||
+ return isBroke(damageable.getDamage());
|
||||
+ }
|
||||
+ }
|
||||
+ int damage = damageable.getDamage() + amount;
|
||||
+ damageable.setDamage(damage);
|
||||
+ setItemMeta((ItemMeta) damageable);
|
||||
+ return isBroke(damage);
|
||||
+ }
|
||||
+
|
||||
+ public boolean isBroke(int damage) {
|
||||
+ if (damage > getType().getMaxDurability()) {
|
||||
+ if (getAmount() > 0) {
|
||||
+ // ensure it "breaks"
|
||||
+ setAmount(0);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ private boolean reduceDamage(java.util.Random random, int unbreaking) {
|
||||
+ if (getType().isArmor()) {
|
||||
+ return random.nextFloat() < 0.6F;
|
||||
+ }
|
||||
+ return random.nextInt(unbreaking + 1) > 0;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 28 Jun 2020 21:50:55 -0500
|
||||
Subject: [PATCH] Phantoms attracted to crystals and crystals shoot phantoms
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index 6f55ccfff74b361854bf424fd93f0428e66a6bd7..038b990fcd72847e7ea43eda3c24c4ce1a3d5bc4 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -205,6 +205,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<Mob> MOB_HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
|
||||
GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
|
||||
GoalKey<Llama> LLAMA_HAS_RIDER = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_has_rider"));
|
||||
+ GoalKey<Phantom> FIND_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal"));
|
||||
+ GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
|
||||
// Purpur end
|
||||
|
||||
/**
|
||||
@@ -1,96 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 10 Jul 2020 12:43:25 -0500
|
||||
Subject: [PATCH] ChatColor conveniences
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
|
||||
index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc857cb8e9 100644
|
||||
--- a/src/main/java/org/bukkit/ChatColor.java
|
||||
+++ b/src/main/java/org/bukkit/ChatColor.java
|
||||
@@ -3,6 +3,7 @@ package org.bukkit;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Maps;
|
||||
import java.util.Map;
|
||||
+import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -456,4 +457,77 @@ public enum ChatColor {
|
||||
BY_CHAR.put(color.code, color);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Convert legacy string into a string ready to be parsed by MiniMessage
|
||||
+ *
|
||||
+ * @param str Legacy string
|
||||
+ * @return MiniMessage ready string
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public static String toMM(@NotNull String str) {
|
||||
+ StringBuilder sb = new StringBuilder(str);
|
||||
+ Matcher m = STRIP_COLOR_PATTERN.matcher(sb);
|
||||
+ while (m.find()) {
|
||||
+ sb.replace(m.start(), m.end(), sb.substring(m.start(), m.end()).toLowerCase());
|
||||
+ }
|
||||
+ return sb.toString()
|
||||
+ .replace("&0", "<black>")
|
||||
+ .replace("&1", "<dark_blue>")
|
||||
+ .replace("&2", "<dark_green>")
|
||||
+ .replace("&3", "<dark_aqua>")
|
||||
+ .replace("&4", "<dark_red>")
|
||||
+ .replace("&5", "<dark_purple>")
|
||||
+ .replace("&6", "<gold>")
|
||||
+ .replace("&7", "<grey>")
|
||||
+ .replace("&8", "<dark_grey>")
|
||||
+ .replace("&9", "<blue>")
|
||||
+ .replace("&a", "<green>")
|
||||
+ .replace("&b", "<aqua>")
|
||||
+ .replace("&c", "<red>")
|
||||
+ .replace("&d", "<light_purple>")
|
||||
+ .replace("&e", "<yellow>")
|
||||
+ .replace("&f", "<white>")
|
||||
+ .replace("&k", "<obf>")
|
||||
+ .replace("&l", "<b>")
|
||||
+ .replace("&m", "<st>")
|
||||
+ .replace("&n", "<u>")
|
||||
+ .replace("&o", "<i>")
|
||||
+ .replace("&r", "<r>");
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static net.kyori.adventure.text.Component parseMM(@NotNull String string, @Nullable Object... args) {
|
||||
+ return net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(String.format(string, args));
|
||||
+ }
|
||||
+
|
||||
+ @Deprecated
|
||||
+ public static final Pattern HEX_PATTERN = Pattern.compile("(#[A-Fa-f0-9]{6})");
|
||||
+
|
||||
+ @Deprecated
|
||||
+ @Nullable
|
||||
+ public static String replaceHex(@Nullable String str) {
|
||||
+ if (str != null) {
|
||||
+ java.util.regex.Matcher matcher = HEX_PATTERN.matcher(str);
|
||||
+ while (matcher.find()) {
|
||||
+ String group = matcher.group(1);
|
||||
+ str = str.replace(group, net.md_5.bungee.api.ChatColor.of(group).toString());
|
||||
+ }
|
||||
+ }
|
||||
+ return str;
|
||||
+ }
|
||||
+
|
||||
+ @Deprecated
|
||||
+ @Nullable
|
||||
+ public static String color(@Nullable String str) {
|
||||
+ return color(str, true);
|
||||
+ }
|
||||
+
|
||||
+ @Deprecated
|
||||
+ @Nullable
|
||||
+ public static String color(@Nullable String str, boolean parseHex) {
|
||||
+ return str != null ? net.md_5.bungee.api.ChatColor.translateAlternateColorCodes('&', parseHex ? replaceHex(str) : str) : str;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 22 Aug 2020 17:42:08 -0500
|
||||
Subject: [PATCH] Item entity immunities
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
|
||||
index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a710da952 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Item.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Item.java
|
||||
@@ -153,4 +153,62 @@ public interface Item extends Entity, io.papermc.paper.entity.Frictional { // Pa
|
||||
*/
|
||||
public void setHealth(int health);
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Set whether or not this item is immune to cactus
|
||||
+ *
|
||||
+ * @param immuneToCactus True to make immune to cactus
|
||||
+ */
|
||||
+ void setImmuneToCactus(boolean immuneToCactus);
|
||||
+
|
||||
+ /**
|
||||
+ * Check if item is immune to cactus
|
||||
+ *
|
||||
+ * @return True if immune to cactus
|
||||
+ */
|
||||
+ boolean isImmuneToCactus();
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether or not this item is immune to explosions
|
||||
+ *
|
||||
+ * @param immuneToExplosion True to make immune to explosions
|
||||
+ */
|
||||
+ void setImmuneToExplosion(boolean immuneToExplosion);
|
||||
+
|
||||
+ /**
|
||||
+ * Check if item is immune to explosions
|
||||
+ *
|
||||
+ * @return True if immune to explosions
|
||||
+ */
|
||||
+ boolean isImmuneToExplosion();
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether or not this item is immune to fire
|
||||
+ *
|
||||
+ * @param immuneToFire True to make immune to fire
|
||||
+ */
|
||||
+ void setImmuneToFire(boolean immuneToFire);
|
||||
+
|
||||
+ /**
|
||||
+ * Check if item is immune to fire
|
||||
+ *
|
||||
+ * @return True if immune to fire
|
||||
+ */
|
||||
+ boolean isImmuneToFire();
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether or not this item is immune to lightning
|
||||
+ *
|
||||
+ * @param immuneToLightning True to make immune to lightning
|
||||
+ */
|
||||
+ void setImmuneToLightning(boolean immuneToLightning);
|
||||
+
|
||||
+ /**
|
||||
+ * Check if item is immune to lightning
|
||||
+ *
|
||||
+ * @return True if immune to lightning
|
||||
+ */
|
||||
+ boolean isImmuneToLightning();
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: nitricspace <nitricspace@users.noreply.github.com>
|
||||
Date: Wed, 23 Sep 2020 22:14:38 +0100
|
||||
Subject: [PATCH] Add option to disable zombie aggressiveness towards villagers
|
||||
when lagging
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index 038b990fcd72847e7ea43eda3c24c4ce1a3d5bc4..150aa7b0876b50e2e92bab18721c548b8e6d5515 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -207,6 +207,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<Llama> LLAMA_HAS_RIDER = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_has_rider"));
|
||||
GoalKey<Phantom> FIND_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal"));
|
||||
GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
|
||||
+ GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
|
||||
+ GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
|
||||
// Purpur end
|
||||
|
||||
/**
|
||||
@@ -1,52 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 2 Oct 2020 17:43:24 -0500
|
||||
Subject: [PATCH] Add predicate to recipe's ExactChoice ingredient
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
index 523818cbb0d6c90481ec97123e7fe0e2ff4eea14..bfeb8171a723d84b94bfaacd8aaf7d4d48ecd051 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
|
||||
@@ -10,6 +10,7 @@ import java.util.function.Predicate;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable; // Purpur
|
||||
|
||||
/**
|
||||
* Represents a potential item match within a recipe. All choices within a
|
||||
@@ -150,6 +151,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||
public static class ExactChoice implements RecipeChoice {
|
||||
|
||||
private List<ItemStack> choices;
|
||||
+ private Predicate<ItemStack> predicate; // Purpur
|
||||
|
||||
public ExactChoice(@NotNull ItemStack stack) {
|
||||
this(Arrays.asList(stack));
|
||||
@@ -194,6 +196,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||
|
||||
@Override
|
||||
public boolean test(@NotNull ItemStack t) {
|
||||
+ if (predicate != null) return predicate.test(t); // Purpur
|
||||
for (ItemStack match : choices) {
|
||||
if (t.isSimilar(match)) {
|
||||
return true;
|
||||
@@ -203,6 +206,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Nullable
|
||||
+ public Predicate<ItemStack> getPredicate() {
|
||||
+ return predicate;
|
||||
+ }
|
||||
+
|
||||
+ public void setPredicate(@Nullable Predicate<ItemStack> predicate) {
|
||||
+ this.predicate = predicate;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
@@ -1,43 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Tue, 8 Dec 2020 17:15:15 -0500
|
||||
Subject: [PATCH] Rabid Wolf API
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index 150aa7b0876b50e2e92bab18721c548b8e6d5515..54ecf2998eb7ee711fb56e3d8ed3f49129db4147 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -209,6 +209,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
|
||||
GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
|
||||
GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
|
||||
+ GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
|
||||
// Purpur end
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java
|
||||
index 84db38388bf7a58e66d6cd29620b4fe64b0a897e..82ebd99549ce9f9e6427a50cef424e9007735708 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Wolf.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Wolf.java
|
||||
@@ -69,4 +69,20 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
|
||||
* @param interested Whether the wolf is interested
|
||||
*/
|
||||
public void setInterested(boolean interested);
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Checks if this wolf is rabid
|
||||
+ *
|
||||
+ * @return whether the wolf is rabid
|
||||
+ */
|
||||
+ public boolean isRabid();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets this wolf to be rabid or not
|
||||
+ *
|
||||
+ * @param rabid whether the wolf should be rabid
|
||||
+ */
|
||||
+ public void setRabid(boolean rabid);
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Wed, 23 Dec 2020 00:43:27 -0600
|
||||
Subject: [PATCH] PlayerBookTooLargeEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/player/PlayerBookTooLargeEvent.java b/src/main/java/org/purpurmc/purpur/event/player/PlayerBookTooLargeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c88394336bc9ab0f66a2af24d393f4a176a234d5
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/player/PlayerBookTooLargeEvent.java
|
||||
@@ -0,0 +1,65 @@
|
||||
+package org.purpurmc.purpur.event.player;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a player tries to bypass book limitations
|
||||
+ */
|
||||
+public class PlayerBookTooLargeEvent extends PlayerEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final ItemStack book;
|
||||
+ private boolean kickPlayer = true;
|
||||
+
|
||||
+ /**
|
||||
+ * @param player The player
|
||||
+ * @param book The book
|
||||
+ */
|
||||
+ public PlayerBookTooLargeEvent(@NotNull Player player, @NotNull ItemStack book) {
|
||||
+ super(player, !Bukkit.isPrimaryThread());
|
||||
+ this.book = book;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the book containing the wanted edits
|
||||
+ *
|
||||
+ * @return The book
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public ItemStack getBook() {
|
||||
+ return book;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Whether server should kick the player or not
|
||||
+ *
|
||||
+ * @return True to kick player
|
||||
+ */
|
||||
+ public boolean shouldKickPlayer() {
|
||||
+ return kickPlayer;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Whether server should kick the player or not
|
||||
+ *
|
||||
+ * @param kickPlayer True to kick player
|
||||
+ */
|
||||
+ public void setShouldKickPlayer(boolean kickPlayer) {
|
||||
+ this.kickPlayer = kickPlayer;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 24 Dec 2020 11:00:04 -0600
|
||||
Subject: [PATCH] Full netherite armor grants fire resistance
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||
index c9f395064656dd0126410eb3c6e197baa450c063..13156a12e5df50cdc1e465dc0bd9d94108275629 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||
@@ -217,6 +217,12 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable
|
||||
* When all effects are removed due to a bucket of milk.
|
||||
*/
|
||||
MILK,
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * When a player wears full netherite armor
|
||||
+ */
|
||||
+ NETHERITE_ARMOR,
|
||||
+ // Purpur end
|
||||
/**
|
||||
* When a player gets bad omen after killing a patrol captain.
|
||||
*/
|
||||
@@ -1,141 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
Date: Sat, 9 Jan 2021 15:26:04 +0100
|
||||
Subject: [PATCH] Add EntityTeleportHinderedEvent
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/EntityTeleportHinderedEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/EntityTeleportHinderedEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c66eb163877e872f234d86dc244cab7efeb818cd
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/EntityTeleportHinderedEvent.java
|
||||
@@ -0,0 +1,117 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Fired when an entity is hindered from teleporting.
|
||||
+ */
|
||||
+public class EntityTeleportHinderedEvent extends EntityEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ @NotNull
|
||||
+ private final Reason reason;
|
||||
+
|
||||
+ @Nullable
|
||||
+ private final TeleportCause teleportCause;
|
||||
+
|
||||
+ private boolean retry = false;
|
||||
+
|
||||
+ public EntityTeleportHinderedEvent(@NotNull Entity what, @NotNull Reason reason,
|
||||
+ @Nullable TeleportCause teleportCause) {
|
||||
+ super(what);
|
||||
+ this.reason = reason;
|
||||
+ this.teleportCause = teleportCause;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return why the teleport was hindered.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Reason getReason() {
|
||||
+ return reason;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return why the teleport occurred if cause was given, otherwise {@code null}.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public TeleportCause getTeleportCause() {
|
||||
+ return teleportCause;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Whether the teleport should be retried.
|
||||
+ * <p>
|
||||
+ * Note that this can put the server in a never-ending loop of trying to teleport someone resulting in a stack
|
||||
+ * overflow. Do not retry more than necessary.
|
||||
+ * </p>
|
||||
+ *
|
||||
+ * @return whether the teleport should be retried.
|
||||
+ */
|
||||
+ public boolean shouldRetry() {
|
||||
+ return retry;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets whether the teleport should be retried.
|
||||
+ * <p>
|
||||
+ * Note that this can put the server in a never-ending loop of trying to teleport someone resulting in a stack
|
||||
+ * overflow. Do not retry more than necessary.
|
||||
+ * </p>
|
||||
+ *
|
||||
+ * @param retry whether the teleport should be retried.
|
||||
+ */
|
||||
+ public void setShouldRetry(boolean retry) {
|
||||
+ this.retry = retry;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Calls the event and tests if should retry.
|
||||
+ *
|
||||
+ * @return whether the teleport should be retried.
|
||||
+ */
|
||||
+ @Override
|
||||
+ public boolean callEvent() {
|
||||
+ super.callEvent();
|
||||
+ return shouldRetry();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Reason for hindrance in teleports.
|
||||
+ */
|
||||
+ public enum Reason {
|
||||
+ /**
|
||||
+ * The teleported entity is a passenger of another entity.
|
||||
+ */
|
||||
+ IS_PASSENGER,
|
||||
+
|
||||
+ /**
|
||||
+ * The teleported entity has passengers.
|
||||
+ */
|
||||
+ IS_VEHICLE,
|
||||
+
|
||||
+ /**
|
||||
+ * The teleport event was cancelled.
|
||||
+ * <p>
|
||||
+ * This is only caused by players teleporting.
|
||||
+ * </p>
|
||||
+ */
|
||||
+ EVENT_CANCELLED,
|
||||
+ }
|
||||
+}
|
||||
@@ -1,29 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 23 Mar 2021 15:01:03 -0500
|
||||
Subject: [PATCH] Add enchantment target for bows and crossbows
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
index 455ff52d90565838fe7640c3f045b27082a6c2f1..5831ffe24eed01311c71989dcb1830dbc395607b 100644
|
||||
--- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
+++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
@@ -227,6 +227,18 @@ public enum EnchantmentTarget {
|
||||
public boolean includes(@NotNull Material item) {
|
||||
return BREAKABLE.includes(item) || (WEARABLE.includes(item) && !item.equals(Material.ELYTRA)) || item.equals(Material.COMPASS);
|
||||
}
|
||||
+ // Purpur start
|
||||
+ },
|
||||
+
|
||||
+ /**
|
||||
+ * Allow the Enchantment to be placed on bows and crossbows.
|
||||
+ */
|
||||
+ BOW_AND_CROSSBOW {
|
||||
+ @Override
|
||||
+ public boolean includes(@NotNull Material item) {
|
||||
+ return item.equals(Material.BOW) || item.equals(Material.CROSSBOW);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1,18 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 13 May 2021 21:38:01 -0500
|
||||
Subject: [PATCH] Iron golem poppy calms anger
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index 54ecf2998eb7ee711fb56e3d8ed3f49129db4147..b1f35c68373edfe666ca05b50f0ec022a1859ce9 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -210,6 +210,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
|
||||
GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
|
||||
GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
|
||||
+ GoalKey<IronGolem> RECEIVE_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("receive_flower"));
|
||||
// Purpur end
|
||||
|
||||
/**
|
||||
@@ -1,48 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <ben@omega24.dev>
|
||||
Date: Tue, 25 May 2021 16:30:30 -0400
|
||||
Subject: [PATCH] API for any mob to burn daylight
|
||||
|
||||
Co-authored by: Encode42 <me@encode42.dev>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index de60e8773e58ef62c15d8f7e293313a62dff674b..52867495d0f746ff40e802c4f1018511e58fd03e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1079,5 +1079,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
* @return True if ridable in water
|
||||
*/
|
||||
boolean isRidableInWater();
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if the entity is in daylight
|
||||
+ *
|
||||
+ * @return True if in daylight
|
||||
+ */
|
||||
+ boolean isInDaylight();
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index accefccca9993edd00f72b4e5779fce0b3ee628f..994e026d68fcda9a4c34a8b161a06623f4437dff 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1214,5 +1214,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param slot Equipment slot to play break animation for
|
||||
*/
|
||||
void broadcastItemBreak(@NotNull org.bukkit.inventory.EquipmentSlot slot);
|
||||
+
|
||||
+ /**
|
||||
+ * If this mob will burn in the sunlight
|
||||
+ *
|
||||
+ * @return True if mob will burn in sunlight
|
||||
+ */
|
||||
+ boolean shouldBurnInDay();
|
||||
+
|
||||
+ /**
|
||||
+ * Set if this mob should burn in the sunlight
|
||||
+ *
|
||||
+ * @param shouldBurnInDay True to burn in sunlight
|
||||
+ */
|
||||
+ void setShouldBurnInDay(boolean shouldBurnInDay);
|
||||
// Purpur end
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 26 Jun 2021 22:08:57 -0500
|
||||
Subject: [PATCH] Add back player spawned endermite API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Endermite.java b/src/main/java/org/bukkit/entity/Endermite.java
|
||||
index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c6f2883d1 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Endermite.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Endermite.java
|
||||
@@ -3,25 +3,21 @@ package org.bukkit.entity;
|
||||
public interface Endermite extends Monster {
|
||||
|
||||
/**
|
||||
- * Gets whether this Endermite was spawned by a player.
|
||||
+ * Gets whether this Endermite was spawned by a player from throwing an ender pearl
|
||||
*
|
||||
- * An Endermite spawned by a player will be attacked by nearby Enderman.
|
||||
+ * An Endermite spawned by a player might be attacked by nearby Enderman depending on purpur.yml settings
|
||||
*
|
||||
* @return player spawned status
|
||||
- * @deprecated this functionality no longer exists
|
||||
*/
|
||||
- @Deprecated
|
||||
boolean isPlayerSpawned();
|
||||
|
||||
/**
|
||||
- * Sets whether this Endermite was spawned by a player.
|
||||
+ * Sets whether this Endermite was spawned by a player from throwing an ender pearl
|
||||
*
|
||||
- * An Endermite spawned by a player will be attacked by nearby Enderman.
|
||||
+ * An Endermite spawned by a player might be attacked by nearby Enderman depending on purpur.yml settings
|
||||
*
|
||||
* @param playerSpawned player spawned status
|
||||
- * @deprecated this functionality no longer exists
|
||||
*/
|
||||
- @Deprecated
|
||||
void setPlayerSpawned(boolean playerSpawned);
|
||||
// Paper start
|
||||
/**
|
||||
@@ -1,77 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 30 Jun 2021 17:44:27 -0500
|
||||
Subject: [PATCH] Fix default permission system
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java
|
||||
index cd3296fea01648592d2af89b3d80135acb6d0958..45797a6fbae1d8edc4211cb30def24ad4f59bd49 100644
|
||||
--- a/src/main/java/org/bukkit/permissions/PermissibleBase.java
|
||||
+++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java
|
||||
@@ -168,7 +168,7 @@ public class PermissibleBase implements Permissible {
|
||||
|
||||
for (Permission perm : defaults) {
|
||||
String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH);
|
||||
- permissions.put(name, new PermissionAttachmentInfo(parent, name, null, true));
|
||||
+ permissions.put(name, new PermissionAttachmentInfo(parent, name, null, perm.getDefault().getValue(isOp()))); // Purpur
|
||||
Bukkit.getServer().getPluginManager().subscribeToPermission(name, parent);
|
||||
calculateChildPermissions(perm.getChildren(), false, null);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ public class PermissibleBase implements Permissible {
|
||||
String name = entry.getKey();
|
||||
|
||||
Permission perm = Bukkit.getServer().getPluginManager().getPermission(name);
|
||||
- boolean value = entry.getValue() ^ invert;
|
||||
+ boolean value = (entry.getValue() == null && perm != null ? perm.getDefault().getValue(isOp()) : entry.getValue()) ^ invert; // Purpur
|
||||
String lname = name.toLowerCase(java.util.Locale.ENGLISH);
|
||||
|
||||
permissions.put(lname, new PermissionAttachmentInfo(parent, lname, attachment, value));
|
||||
diff --git a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
|
||||
index 8e481e3815f5645ee92f0d229e5ff25c8fc9a6c2..10627d2a11251a8cb01bbc3f6242d66f3505a16e 100644
|
||||
--- a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
|
||||
+++ b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
|
||||
@@ -31,7 +31,7 @@ public final class DefaultPermissions {
|
||||
|
||||
if (withLegacy) {
|
||||
Permission legacy = new Permission(LEGACY_PREFIX + result.getName(), result.getDescription(), PermissionDefault.FALSE);
|
||||
- legacy.getChildren().put(result.getName(), true);
|
||||
+ legacy.getChildren().put(result.getName(), null); // Purpur
|
||||
registerPermission(perm, false);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public final class DefaultPermissions {
|
||||
|
||||
@NotNull
|
||||
public static Permission registerPermission(@NotNull Permission perm, @NotNull Permission parent) {
|
||||
- parent.getChildren().put(perm.getName(), true);
|
||||
+ parent.getChildren().put(perm.getName(), null); // Purpur
|
||||
return registerPermission(perm);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public final class DefaultPermissions {
|
||||
@NotNull
|
||||
public static Permission registerPermission(@NotNull String name, @Nullable String desc, @NotNull Permission parent) {
|
||||
Permission perm = registerPermission(name, desc);
|
||||
- parent.getChildren().put(perm.getName(), true);
|
||||
+ parent.getChildren().put(perm.getName(), null); // Purpur
|
||||
return perm;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public final class DefaultPermissions {
|
||||
@NotNull
|
||||
public static Permission registerPermission(@NotNull String name, @Nullable String desc, @Nullable PermissionDefault def, @NotNull Permission parent) {
|
||||
Permission perm = registerPermission(name, desc, def);
|
||||
- parent.getChildren().put(perm.getName(), true);
|
||||
+ parent.getChildren().put(perm.getName(), null); // Purpur
|
||||
return perm;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public final class DefaultPermissions {
|
||||
@NotNull
|
||||
public static Permission registerPermission(@NotNull String name, @Nullable String desc, @Nullable PermissionDefault def, @Nullable Map<String, Boolean> children, @NotNull Permission parent) {
|
||||
Permission perm = registerPermission(name, desc, def, children);
|
||||
- parent.getChildren().put(perm.getName(), true);
|
||||
+ parent.getChildren().put(perm.getName(), null); // Purpur
|
||||
return perm;
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 3 Jul 2021 18:45:01 -0500
|
||||
Subject: [PATCH] Summoner API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/IronGolem.java b/src/main/java/org/bukkit/entity/IronGolem.java
|
||||
index 655e37cb3a09610a3f3df805d6dcad17d722da62..09fd716c8fc9ea34a1cbf87bcbe22df035422a51 100644
|
||||
--- a/src/main/java/org/bukkit/entity/IronGolem.java
|
||||
+++ b/src/main/java/org/bukkit/entity/IronGolem.java
|
||||
@@ -19,4 +19,20 @@ public interface IronGolem extends Golem {
|
||||
* player created, false if you want it to be a natural village golem.
|
||||
*/
|
||||
public void setPlayerCreated(boolean playerCreated);
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the player that summoned this iron golem
|
||||
+ *
|
||||
+ * @return UUID of summoner
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.Nullable java.util.UUID getSummoner();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the player that summoned this iron golem
|
||||
+ *
|
||||
+ * @param summoner UUID of summoner
|
||||
+ */
|
||||
+ void setSummoner(@org.jetbrains.annotations.Nullable java.util.UUID summoner);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java
|
||||
index 7fbfdb07585c7b28acea1f0c1f58ada0cc744441..21fcca092e2e31baa5ece0de9e44e3fade8c7123 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Snowman.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Snowman.java
|
||||
@@ -23,4 +23,20 @@ public interface Snowman extends Golem, RangedEntity, io.papermc.paper.entity.Sh
|
||||
* @param derpMode True to remove the pumpkin, false to add a pumpkin
|
||||
*/
|
||||
void setDerp(boolean derpMode);
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the player that summoned this snowman
|
||||
+ *
|
||||
+ * @return UUID of summoner
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.Nullable java.util.UUID getSummoner();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the player that summoned this snowman
|
||||
+ *
|
||||
+ * @param summoner UUID of summoner
|
||||
+ */
|
||||
+ void setSummoner(@org.jetbrains.annotations.Nullable java.util.UUID summoner);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java
|
||||
index 14543c2238b45c526dd9aebea2aa5c22f5df54dc..5312daf33405704c74e2c9e109754285ea6cf734 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Wither.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Wither.java
|
||||
@@ -107,4 +107,20 @@ public interface Wither extends Monster, Boss, com.destroystokyo.paper.entity.Ra
|
||||
*/
|
||||
void enterInvulnerabilityPhase();
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the player that summoned this wither
|
||||
+ *
|
||||
+ * @return UUID of summoner
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.Nullable java.util.UUID getSummoner();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the player that summoned this wither
|
||||
+ *
|
||||
+ * @param summoner UUID of summoner
|
||||
+ */
|
||||
+ void setSummoner(@org.jetbrains.annotations.Nullable java.util.UUID summoner);
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 15 Jul 2021 23:43:04 -0500
|
||||
Subject: [PATCH] Clean up version command output
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
||||
index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48cc50fad5b 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
|
||||
@@ -26,6 +26,12 @@ public interface VersionFetcher {
|
||||
@NotNull
|
||||
Component getVersionMessage(@NotNull String serverVersion);
|
||||
|
||||
+ // Purpur start
|
||||
+ default int distance() {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
class DummyVersionFetcher implements VersionFetcher {
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
index fd5d9881abfd930bb883120f018f76dc78b62b14..d3dadad49df09e85c724c93e8cc88da2c985e9b4 100644
|
||||
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
@@ -214,7 +214,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
String version = Bukkit.getVersion();
|
||||
// Paper start
|
||||
if (version.startsWith("null")) { // running from ide?
|
||||
- setVersionMessage(Component.text("Unknown version, custom build?", NamedTextColor.YELLOW));
|
||||
+ setVersionMessage(Component.text("* Unknown version, custom build?", NamedTextColor.RED)); // Purpur
|
||||
return;
|
||||
}
|
||||
setVersionMessage(getVersionFetcher().getVersionMessage(version));
|
||||
@@ -255,9 +255,11 @@ public class VersionCommand extends BukkitCommand {
|
||||
// Paper start
|
||||
private void setVersionMessage(final @NotNull Component msg) {
|
||||
lastCheck = System.currentTimeMillis();
|
||||
- final Component message = Component.textOfChildren(
|
||||
- Component.text(Bukkit.getVersionMessage(), NamedTextColor.WHITE),
|
||||
- Component.newline(),
|
||||
+ // Purpur start
|
||||
+ int distance = getVersionFetcher().distance();
|
||||
+ final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
|
||||
+ ChatColor.parseMM("<grey>Current: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
|
||||
+ // Purpur end
|
||||
msg
|
||||
);
|
||||
this.versionMessage = Component.text()
|
||||
@@ -1,125 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: YouHaveTrouble <youhavetrouble@youhavetrouble.me>
|
||||
Date: Sun, 22 Aug 2021 05:11:09 +0200
|
||||
Subject: [PATCH] Extended OfflinePlayer API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a322acadecc 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -522,4 +522,114 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
*/
|
||||
@Nullable
|
||||
public Location getLastDeathLocation();
|
||||
+
|
||||
+ // Purpur start - OfflinePlayer API
|
||||
+ /**
|
||||
+ * Determines if the OfflinePlayer is allowed to fly via jump key double-tap like
|
||||
+ * in creative mode.
|
||||
+ *
|
||||
+ * @return True if the player is allowed to fly.
|
||||
+ */
|
||||
+ public boolean getAllowFlight();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets if the OfflinePlayer is allowed to fly via jump key double-tap like in
|
||||
+ * creative mode.
|
||||
+ *
|
||||
+ * @param flight If flight should be allowed.
|
||||
+ */
|
||||
+ public void setAllowFlight(boolean flight);
|
||||
+
|
||||
+ /**
|
||||
+ * Checks to see if this player is currently flying or not.
|
||||
+ *
|
||||
+ * @return True if the player is flying, else false.
|
||||
+ */
|
||||
+ public boolean isFlying();
|
||||
+
|
||||
+ /**
|
||||
+ * Makes this player start or stop flying.
|
||||
+ *
|
||||
+ * @param value True to fly.
|
||||
+ */
|
||||
+ public void setFlying(boolean value);
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the speed at which a client will fly. Negative values indicate
|
||||
+ * reverse directions.
|
||||
+ *
|
||||
+ * @param value The new speed, from -1 to 1.
|
||||
+ * @throws IllegalArgumentException If new speed is less than -1 or
|
||||
+ * greater than 1
|
||||
+ */
|
||||
+ public void setFlySpeed(float value) throws IllegalArgumentException;
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the speed at which a client will walk. Negative values indicate
|
||||
+ * reverse directions.
|
||||
+ *
|
||||
+ * @param value The new speed, from -1 to 1.
|
||||
+ * @throws IllegalArgumentException If new speed is less than -1 or
|
||||
+ * greater than 1
|
||||
+ */
|
||||
+ public void setWalkSpeed(float value) throws IllegalArgumentException;
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the current allowed speed that a client can fly.
|
||||
+ *
|
||||
+ * @return The current allowed speed, from -1 to 1
|
||||
+ */
|
||||
+ public float getFlySpeed();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the current allowed speed that a client can walk.
|
||||
+ *
|
||||
+ * @return The current allowed speed, from -1 to 1
|
||||
+ */
|
||||
+ public float getWalkSpeed();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the entity's current position
|
||||
+ *
|
||||
+ * @return a new copy of Location containing the position of this offline player
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getLocation();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleport implementation.
|
||||
+ *
|
||||
+ * @param destination
|
||||
+ * @return true if teleportation was successful
|
||||
+ */
|
||||
+ public boolean teleportOffline(@NotNull org.bukkit.Location destination);
|
||||
+
|
||||
+ /**
|
||||
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleport implementation.
|
||||
+ *
|
||||
+ * @param destination
|
||||
+ * @param cause Teleport cause used if player is online
|
||||
+ * @return true if teleportation was successful
|
||||
+ */
|
||||
+ public boolean teleportOffline(@NotNull org.bukkit.Location destination, @NotNull org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause);
|
||||
+
|
||||
+ /**
|
||||
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleportAsync implementation.
|
||||
+ *
|
||||
+ * @param destination
|
||||
+ * @return <code>true</code> if teleportation successful
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(@NotNull Location destination);
|
||||
+
|
||||
+ /**
|
||||
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleportAsync implementation.
|
||||
+ *
|
||||
+ * @param destination
|
||||
+ * @param cause Teleport cause used if player is online
|
||||
+ * @return <code>true</code> if teleportation successful
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(@NotNull Location destination, @NotNull org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause);
|
||||
+ // Purpur end - OfflinePlayer API
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoctaEnkoda <bierquejason@gmail.com>
|
||||
Date: Mon, 9 Aug 2021 13:22:03 +0200
|
||||
Subject: [PATCH] Added the ability to add combustible items
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index a32155e0cc63d4e4714a953edbae0b19544ff3ef..222dcb75a850d224ac22b2e06895233527cffc76 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2775,5 +2775,24 @@ public final class Bukkit {
|
||||
public static boolean isLagging() {
|
||||
return server.isLagging();
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Add an Item as fuel for furnaces
|
||||
+ *
|
||||
+ * @param material The material that will be the fuel
|
||||
+ * @param burnTime The time (in ticks) this item will burn for
|
||||
+ */
|
||||
+ public static void addFuel(@NotNull Material material, int burnTime) {
|
||||
+ server.addFuel(material, burnTime);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Remove an item as fuel for furnaces
|
||||
+ *
|
||||
+ * @param material The material that will no longer be a fuel
|
||||
+ */
|
||||
+ public static void removeFuel(@NotNull Material material) {
|
||||
+ server.removeFuel(material);
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 5b8ce8a5658021c6fdfeabca6c7bb31ebc58e71d..3bc9fa8b68b284516ddbf0ace0c1dc52768307cb 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2431,5 +2431,20 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
* @return True if lagging
|
||||
*/
|
||||
boolean isLagging();
|
||||
+
|
||||
+ /**
|
||||
+ * Add an Item as fuel for furnaces
|
||||
+ *
|
||||
+ * @param material The material that will be the fuel
|
||||
+ * @param burnTime The time (in ticks) this item will burn for
|
||||
+ */
|
||||
+ public void addFuel(@NotNull Material material, int burnTime);
|
||||
+
|
||||
+ /**
|
||||
+ * Remove an item as fuel for furnaces
|
||||
+ *
|
||||
+ * @param material The material that will no longer be a fuel
|
||||
+ */
|
||||
+ public void removeFuel(@NotNull Material material);
|
||||
// Purpur end
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 27 Dec 2021 08:10:50 -0600
|
||||
Subject: [PATCH] Grindstone API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java b/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..eebb5d124456b8209d1b8e8cc4cb772dd3714f04
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java
|
||||
@@ -0,0 +1,72 @@
|
||||
+package org.purpurmc.purpur.event.inventory;
|
||||
+
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.inventory.InventoryEvent;
|
||||
+import org.bukkit.inventory.GrindstoneInventory;
|
||||
+import org.bukkit.inventory.InventoryView;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a player takes the result item out of a Grindstone
|
||||
+ */
|
||||
+public class GrindstoneTakeResultEvent extends InventoryEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Player player;
|
||||
+ private final ItemStack result;
|
||||
+ private int experienceAmount;
|
||||
+
|
||||
+ public GrindstoneTakeResultEvent(@NotNull HumanEntity player, @NotNull InventoryView view, @NotNull ItemStack result, int experienceAmount) {
|
||||
+ super(view);
|
||||
+ this.player = (Player) player;
|
||||
+ this.result = result;
|
||||
+ this.experienceAmount = experienceAmount;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public Player getPlayer() {
|
||||
+ return player;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public ItemStack getResult() {
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public GrindstoneInventory getInventory() {
|
||||
+ return (GrindstoneInventory) super.getInventory();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the amount of experience this transaction will give
|
||||
+ *
|
||||
+ * @return Amount of experience to give
|
||||
+ */
|
||||
+ public int getExperienceAmount() {
|
||||
+ return this.experienceAmount;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set the amount of experience this transaction will give
|
||||
+ *
|
||||
+ * @param experienceAmount Amount of experience to give
|
||||
+ */
|
||||
+ public void setExperienceAmount(int experienceAmount) {
|
||||
+ this.experienceAmount = experienceAmount;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,27 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
||||
Date: Mon, 3 Jan 2022 02:00:50 -0600
|
||||
Subject: [PATCH] Shears can have looting enchantment
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
index 5831ffe24eed01311c71989dcb1830dbc395607b..45f5493eebfecf56b7c0ef4659c078dfc62c0612 100644
|
||||
--- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
+++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
|
||||
@@ -238,6 +238,16 @@ public enum EnchantmentTarget {
|
||||
public boolean includes(@NotNull Material item) {
|
||||
return item.equals(Material.BOW) || item.equals(Material.CROSSBOW);
|
||||
}
|
||||
+ },
|
||||
+
|
||||
+ /**
|
||||
+ * Allow the Enchantment to be placed on shears.
|
||||
+ */
|
||||
+ WEAPON_AND_SHEARS {
|
||||
+ @Override
|
||||
+ public boolean includes(@NotNull Material item) {
|
||||
+ return WEAPON.includes(item) || item.equals(Material.SHEARS);
|
||||
+ }
|
||||
// Purpur end
|
||||
};
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
||||
Date: Mon, 24 Jan 2022 20:42:22 -0600
|
||||
Subject: [PATCH] Lobotomize stuck villagers
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
||||
index 3bc24457d143449e6a338d79becf7c39b9f81054..4a5edf4e72e81b22c1abb2ade244f7f4292e993c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -328,4 +328,14 @@ public interface Villager extends AbstractVillager {
|
||||
*/
|
||||
public void clearReputations();
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+
|
||||
+ /**
|
||||
+ * Check if villager is currently lobotomized
|
||||
+ *
|
||||
+ * @return True if lobotomized
|
||||
+ */
|
||||
+ boolean isLobotomized();
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 9 Jul 2022 00:57:26 -0500
|
||||
Subject: [PATCH] Add local difficulty api
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 6917931966377c51db88a3364997a110dd987970..1fba792419ea6b5e8c640a2599e4b2dd16ee87d0 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3992,6 +3992,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public DragonBattle getEnderDragonBattle();
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Gets the local difficulty (based on inhabited time) at a location
|
||||
+ *
|
||||
+ * @param location Location to check
|
||||
+ * @return The local difficulty
|
||||
+ */
|
||||
+ public float getLocalDifficultyAt(@NotNull Location location);
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* Get all {@link FeatureFlag} enabled in this world.
|
||||
*
|
||||
@@ -1,168 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 1 Jul 2022 04:03:26 -0500
|
||||
Subject: [PATCH] Remove Timings
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||
index 8f29c1561ba5916cb5634392edd8bd2a5a294a51..6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||
@@ -77,9 +77,9 @@ public class TimedEventExecutor implements EventExecutor {
|
||||
executor.execute(listener, event);
|
||||
return;
|
||||
}
|
||||
- try (Timing ignored = timings.startTiming()){
|
||||
+ //try (Timing ignored = timings.startTiming()){ // Purpur
|
||||
executor.execute(listener, event);
|
||||
- }
|
||||
+ //} // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java
|
||||
index 7514fad26f955329f8bf17ff17db75f0c8301ee5..1d866e980abc542bdfee1ce082cd9cdd7761e9f7 100644
|
||||
--- a/src/main/java/co/aikar/timings/Timing.java
|
||||
+++ b/src/main/java/co/aikar/timings/Timing.java
|
||||
@@ -39,6 +39,7 @@ public interface Timing extends AutoCloseable {
|
||||
* @return Timing
|
||||
*/
|
||||
@NotNull
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
Timing startTiming();
|
||||
|
||||
/**
|
||||
@@ -46,6 +47,7 @@ public interface Timing extends AutoCloseable {
|
||||
*
|
||||
* Will automatically be called when this Timing is used with try-with-resources
|
||||
*/
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
void stopTiming();
|
||||
|
||||
/**
|
||||
@@ -56,6 +58,7 @@ public interface Timing extends AutoCloseable {
|
||||
* @return Timing
|
||||
*/
|
||||
@NotNull
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
Timing startTimingIfSync();
|
||||
|
||||
/**
|
||||
@@ -65,12 +68,14 @@ public interface Timing extends AutoCloseable {
|
||||
*
|
||||
* But only if we are on the primary thread.
|
||||
*/
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
void stopTimingIfSync();
|
||||
|
||||
/**
|
||||
* @deprecated Doesn't do anything - Removed
|
||||
*/
|
||||
@Deprecated
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
void abort();
|
||||
|
||||
/**
|
||||
@@ -82,5 +87,6 @@ public interface Timing extends AutoCloseable {
|
||||
TimingHandler getTimingHandler();
|
||||
|
||||
@Override
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur
|
||||
void close();
|
||||
}
|
||||
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
|
||||
index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..752d54830aa8baa1450bf72da03ae55ed30293c2 100644
|
||||
--- a/src/main/java/co/aikar/timings/Timings.java
|
||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
||||
@@ -124,7 +124,7 @@ public final class Timings {
|
||||
@NotNull
|
||||
public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) {
|
||||
Timing timing = of(plugin, name, groupHandler);
|
||||
- timing.startTiming();
|
||||
+ //timing.startTiming(); // Purpur
|
||||
return timing;
|
||||
}
|
||||
|
||||
@@ -145,9 +145,11 @@ public final class Timings {
|
||||
* @param enabled Should timings be reported
|
||||
*/
|
||||
public static void setTimingsEnabled(boolean enabled) {
|
||||
- timingsEnabled = enabled;
|
||||
- warnAboutDeprecationOnEnable();
|
||||
- reset();
|
||||
+ // Purpur start - we don't do that here...
|
||||
+ timingsEnabled = false;
|
||||
+ //warnAboutDeprecationOnEnable();
|
||||
+ //reset();
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
private static void warnAboutDeprecationOnEnable() {
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
index e801e79fa57c44b2e5d359647c920f88064826f1..1abfcee0f6d632f4cd8d74b4994a90c9ea9d254c 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
@@ -45,7 +45,7 @@ public class TimingsCommand extends BukkitCommand {
|
||||
public TimingsCommand(@NotNull String name) {
|
||||
super(name);
|
||||
this.description = "Manages Spigot Timings data to see performance of the server.";
|
||||
- this.usageMessage = "/timings <reset|report|on|off|verbon|verboff>";
|
||||
+ this.usageMessage = "/timings";// <reset|report|on|off|verbon|verboff>"; // Purpur
|
||||
this.setPermission("bukkit.command.timings");
|
||||
}
|
||||
|
||||
@@ -54,8 +54,12 @@ public class TimingsCommand extends BukkitCommand {
|
||||
if (!testPermission(sender)) {
|
||||
return true;
|
||||
}
|
||||
- if (false) {
|
||||
- sender.sendMessage(Timings.deprecationMessage());
|
||||
+ if (true) {
|
||||
+ net.kyori.adventure.text.minimessage.MiniMessage mm = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage();
|
||||
+ sender.sendMessage(mm.deserialize("<gold>Purpur has removed timings to save your performance. Please use <click:suggest_command:'/spark'><grey>/spark</grey></click> instead"));
|
||||
+ sender.sendMessage(mm.deserialize("<gold>For more information, view its documentation at"));
|
||||
+ sender.sendMessage(mm.deserialize("<gold><click:open_url:'https://spark.lucko.me/docs/Command-Usage'>https://spark.lucko.me/docs/Command-Usage</click>"));
|
||||
+ return true;
|
||||
}
|
||||
if (args.length < 1) {
|
||||
sender.sendMessage(text("Usage: " + this.usageMessage, NamedTextColor.RED));
|
||||
@@ -115,7 +119,7 @@ public class TimingsCommand extends BukkitCommand {
|
||||
Preconditions.checkNotNull(args, "Arguments cannot be null");
|
||||
Preconditions.checkNotNull(alias, "Alias cannot be null");
|
||||
|
||||
- if (args.length == 1) {
|
||||
+ if (false && args.length == 1) { // Purpur
|
||||
return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS,
|
||||
new ArrayList<String>(TIMINGS_SUBCOMMANDS.size()));
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
index e842d13febca67ffa1c89fb2c1324d2609fb81fd..5349f16136d9348c374a7dfe5b89a71dfcb0e66d 100644
|
||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
@@ -163,10 +163,10 @@ public class SimpleCommandMap implements CommandMap {
|
||||
// Paper end
|
||||
|
||||
try {
|
||||
- try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources
|
||||
+ //try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources // Purpur
|
||||
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
||||
target.execute(sender, sentCommandLabel, parsedArgs); // Purpur
|
||||
- } // target.timings.stopTiming(); // Spigot // Paper
|
||||
+ //} // target.timings.stopTiming(); // Spigot // Paper // Purpur
|
||||
} catch (CommandException ex) {
|
||||
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
|
||||
//target.timings.stopTiming(); // Spigot // Paper
|
||||
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
||||
index 12946bd55fcf7c40d39081779a7fa30049ee6165..9c2d605c50cbf9aefa56ec209df9f6cea1392e89 100644
|
||||
--- a/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
||||
+++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
||||
@@ -61,7 +61,7 @@ public final class CustomTimingsHandler {
|
||||
handler = timing;
|
||||
}
|
||||
|
||||
- public void startTiming() { handler.startTiming(); }
|
||||
- public void stopTiming() { handler.stopTiming(); }
|
||||
+ public void startTiming() { /*handler.startTiming();*/ } // Purpur
|
||||
+ public void stopTiming() { /*handler.stopTiming();*/ } // Purpur
|
||||
|
||||
}
|
||||
@@ -1,179 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: SageSphinx63920 <sage@sagesphinx63920.dev>
|
||||
Date: Mon, 25 Jul 2022 19:33:49 +0200
|
||||
Subject: [PATCH] Add Bee API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/BeeFoundFlowerEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/BeeFoundFlowerEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..833f46d1941f377765132fc528c45567ee0290d2
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/BeeFoundFlowerEvent.java
|
||||
@@ -0,0 +1,48 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.entity.Bee;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a bee targets a flower
|
||||
+ */
|
||||
+public class BeeFoundFlowerEvent extends EntityEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Location location;
|
||||
+
|
||||
+ public BeeFoundFlowerEvent(@NotNull Bee bee, @Nullable Location location) {
|
||||
+ super(bee);
|
||||
+ this.location = location;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Bee getEntity() {
|
||||
+ return (Bee) super.getEntity();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the location of the flower that the bee targets
|
||||
+ *
|
||||
+ * @return The location of the flower
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getLocation() {
|
||||
+ return location;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/BeeStartedPollinatingEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/BeeStartedPollinatingEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ae0bb654745724889c67fae9072ae90ea3778ba4
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/BeeStartedPollinatingEvent.java
|
||||
@@ -0,0 +1,47 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.entity.Bee;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a bee starts pollinating
|
||||
+ */
|
||||
+public class BeeStartedPollinatingEvent extends EntityEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Location location;
|
||||
+
|
||||
+ public BeeStartedPollinatingEvent(@NotNull Bee bee, @NotNull Location location) {
|
||||
+ super(bee);
|
||||
+ this.location = location;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Bee getEntity() {
|
||||
+ return (Bee) super.getEntity();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the location of the flower that the bee pollinates
|
||||
+ *
|
||||
+ * @return The location of the flower
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getLocation() {
|
||||
+ return this.location;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/BeeStopPollinatingEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/BeeStopPollinatingEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ff3c9f075be2f624af8b0ce5fffc5ea69a41f32e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/BeeStopPollinatingEvent.java
|
||||
@@ -0,0 +1,60 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.entity.Bee;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a bee stops pollinating
|
||||
+ */
|
||||
+public class BeeStopPollinatingEvent extends EntityEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Location location;
|
||||
+ private final boolean success;
|
||||
+
|
||||
+ public BeeStopPollinatingEvent(@NotNull Bee bee, @Nullable Location location, boolean success) {
|
||||
+ super(bee);
|
||||
+ this.location = location;
|
||||
+ this.success = success;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Bee getEntity() {
|
||||
+ return (Bee) super.getEntity();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the location of the flower that the bee stopped pollinating
|
||||
+ *
|
||||
+ * @return The location of the flower
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getLocation() {
|
||||
+ return location;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns whether the bee successfully pollinated the flower
|
||||
+ *
|
||||
+ * @return True if the pollination was successful
|
||||
+ */
|
||||
+ public boolean wasSuccessful() {
|
||||
+ return success;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,341 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: YouHaveTrouble <youhavetrouble@youhavetrouble.me>
|
||||
Date: Sat, 23 Jul 2022 14:40:17 +0200
|
||||
Subject: [PATCH] Debug Marker API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 222dcb75a850d224ac22b2e06895233527cffc76..584e3b08935f43beb27f478cc72229b6a5f40689 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2794,5 +2794,89 @@ public final class Bukkit {
|
||||
public static void removeFuel(@NotNull Material material) {
|
||||
server.removeFuel(material);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ */
|
||||
+ public static void sendBlockHighlight(@NotNull Location location, int duration) {
|
||||
+ server.sendBlockHighlight(location, duration);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
||||
+ */
|
||||
+ public static void sendBlockHighlight(@NotNull Location location, int duration, int argb) {
|
||||
+ server.sendBlockHighlight(location, duration, argb);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ */
|
||||
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text) {
|
||||
+ server.sendBlockHighlight(location, duration, text);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
||||
+ */
|
||||
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb) {
|
||||
+ server.sendBlockHighlight(location, duration, text, argb);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
|
||||
+ * @param transparency Transparency of the highlight
|
||||
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
|
||||
+ */
|
||||
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency) {
|
||||
+ server.sendBlockHighlight(location, duration, color, transparency);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
|
||||
+ * @param transparency Transparency of the highlight
|
||||
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
|
||||
+ */
|
||||
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, @NotNull org.bukkit.Color color, int transparency) {
|
||||
+ server.sendBlockHighlight(location, duration, text, color, transparency);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Clears all debug block highlights for all players on the server.
|
||||
+ */
|
||||
+ public static void clearBlockHighlights() {
|
||||
+ server.clearBlockHighlights();
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 3bc9fa8b68b284516ddbf0ace0c1dc52768307cb..aaef58468a3c31f35e5067ed4263e9dd3fbddddd 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2446,5 +2446,75 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
* @param material The material that will no longer be a fuel
|
||||
*/
|
||||
public void removeFuel(@NotNull Material material);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
|
||||
+ * @param transparency Transparency of the highlight
|
||||
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on the server.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
|
||||
+ * @param transparency Transparency of the highlight
|
||||
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, @NotNull org.bukkit.Color color, int transparency);
|
||||
+
|
||||
+ /**
|
||||
+ * Clears all debug block highlights for all players on the server.
|
||||
+ */
|
||||
+ void clearBlockHighlights();
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 1fba792419ea6b5e8c640a2599e4b2dd16ee87d0..bf39c6602cfca70a6352519fa26059cd79143cdd 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -4000,6 +4000,76 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @return The local difficulty
|
||||
*/
|
||||
public float getLocalDifficultyAt(@NotNull Location location);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
|
||||
+ * @param transparency Transparency of the highlight
|
||||
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
|
||||
+ * @param transparency Transparency of the highlight
|
||||
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, @NotNull org.bukkit.Color color, int transparency);
|
||||
+
|
||||
+ /**
|
||||
+ * Clears all debug block highlights for all players on this world.
|
||||
+ */
|
||||
+ void clearBlockHighlights();
|
||||
// Purpur end
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 1994acf66919c92f59e2a9f2f873f50b73d76d1a..b1a5baf12343f5db11ef58666bf6393b008c7dcf 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3319,5 +3319,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param invulnerableTicks Invulnerable ticks remaining
|
||||
*/
|
||||
void setSpawnInvulnerableTicks(int invulnerableTicks);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to this player.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to this player.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to this player.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to this player.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to this player.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
|
||||
+ * @param transparency Transparency of the highlight
|
||||
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates debug block highlight on specified block location and show it to this player.
|
||||
+ * <p>
|
||||
+ * Clients may be inconsistent in displaying it.
|
||||
+ * @param location Location to highlight
|
||||
+ * @param duration Duration for highlight to show in milliseconds
|
||||
+ * @param text Text to show above the highlight
|
||||
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
|
||||
+ * @param transparency Transparency of the highlight
|
||||
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
|
||||
+ */
|
||||
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, @NotNull org.bukkit.Color color, int transparency);
|
||||
+
|
||||
+ /**
|
||||
+ * Clears all debug block highlights
|
||||
+ */
|
||||
+ void clearBlockHighlights();
|
||||
// Purpur end
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MelnCat <melncatuwu@gmail.com>
|
||||
Date: Fri, 23 Sep 2022 18:35:28 -0700
|
||||
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 b1a5baf12343f5db11ef58666bf6393b008c7dcf..9193288438671409cc3cf92033ef7cb60d798b69 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3389,5 +3389,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* Clears all debug block highlights
|
||||
*/
|
||||
void clearBlockHighlights();
|
||||
+
|
||||
+ /**
|
||||
+ * Sends a player the death screen with a specified death message.
|
||||
+ *
|
||||
+ * @param message The death message to show the player
|
||||
+ */
|
||||
+ void sendDeathScreen(@NotNull net.kyori.adventure.text.Component message);
|
||||
+
|
||||
+ /**
|
||||
+ * Sends a player the death screen with a specified death message,
|
||||
+ * along with the entity that caused the death.
|
||||
+ *
|
||||
+ * @param message The death message to show the player
|
||||
+ * @param killer The entity that killed the player
|
||||
+ * @deprecated Use {@link #sendDeathScreen(net.kyori.adventure.text.Component)} instead, as 1.20 removed the killer ID from the packet.
|
||||
+ */
|
||||
+ @Deprecated(since = "1.20")
|
||||
+ default void sendDeathScreen(@NotNull net.kyori.adventure.text.Component message, @Nullable Entity killer) {
|
||||
+ sendDeathScreen(message);
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MelnCat <melncatuwu@gmail.com>
|
||||
Date: Sat, 1 Oct 2022 17:08:23 -0700
|
||||
Subject: [PATCH] Language API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/language/Language.java b/src/main/java/org/purpurmc/purpur/language/Language.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..38483d908ed830e97883733bee2370f87060f4c7
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/language/Language.java
|
||||
@@ -0,0 +1,60 @@
|
||||
+package org.purpurmc.purpur.language;
|
||||
+
|
||||
+import net.kyori.adventure.translation.Translatable;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Represents a language that can translate translation keys
|
||||
+ */
|
||||
+public abstract class Language {
|
||||
+ private static Language language;
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the default language of the server
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public static Language getLanguage() {
|
||||
+ return language;
|
||||
+ }
|
||||
+
|
||||
+ public static void setLanguage(@NotNull Language language) {
|
||||
+ if (Language.language != null) {
|
||||
+ throw new UnsupportedOperationException("Cannot redefine singleton Language");
|
||||
+ }
|
||||
+ Language.language = language;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if a certain translation key is translatable with this language
|
||||
+ * @param key The translation key
|
||||
+ * @return Whether this language can translate the key
|
||||
+ */
|
||||
+ abstract public boolean has(@NotNull String key);
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if a certain translation key is translatable with this language
|
||||
+ * @param key The translation key
|
||||
+ * @return Whether this language can translate the key
|
||||
+ */
|
||||
+ public boolean has(@NotNull Translatable key) {
|
||||
+ return has(key.translationKey());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Translates a translation key to this language
|
||||
+ * @param key The translation key
|
||||
+ * @return The translated key, or the translation key if it couldn't be translated
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ abstract public String getOrDefault(@NotNull String key);
|
||||
+
|
||||
+ /**
|
||||
+ * Translates a translation key to this language
|
||||
+ * @param key The translation key
|
||||
+ * @return The translated key, or the translation key if it couldn't be translated
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getOrDefault(@NotNull Translatable key) {
|
||||
+ return getOrDefault(key.translationKey());
|
||||
+ }
|
||||
+}
|
||||
@@ -1,46 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Krakenied <Krakenied1@gmail.com>
|
||||
Date: Fri, 14 Oct 2022 23:11:27 +0200
|
||||
Subject: [PATCH] Add log suppression for LibraryLoader
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
index 301e82369603f3dd6e6c1bd380da4bacacd7ef6c..0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
@@ -55,6 +55,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||
private final Pattern[] fileFilters = new Pattern[]{Pattern.compile("\\.jar$")};
|
||||
private final List<PluginClassLoader> loaders = new CopyOnWriteArrayList<PluginClassLoader>();
|
||||
private final LibraryLoader libraryLoader;
|
||||
+ public static boolean SuppressLibraryLoaderLogger = false; // Purpur
|
||||
|
||||
/**
|
||||
* This class was not meant to be constructed explicitly
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
||||
index e4b6f278a811acbb0070e311c5c3bdaff7b00474..ee83ecb054099cb85168a9499dfe967a0a9ec796 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
|
||||
@@ -65,6 +65,7 @@ public class LibraryLoader
|
||||
@Override
|
||||
public void transferStarted(@NotNull TransferEvent event) throws TransferCancelledException
|
||||
{
|
||||
+ if (!JavaPluginLoader.SuppressLibraryLoaderLogger) // Purpur
|
||||
logger.log( Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
|
||||
}
|
||||
} );
|
||||
@@ -80,6 +81,7 @@ public class LibraryLoader
|
||||
{
|
||||
return null;
|
||||
}
|
||||
+ if (!JavaPluginLoader.SuppressLibraryLoaderLogger) // Purpur
|
||||
logger.log( Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[]
|
||||
{
|
||||
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), desc.getLibraries().size() // Paper - use configured log prefix
|
||||
@@ -118,6 +120,7 @@ public class LibraryLoader
|
||||
}
|
||||
|
||||
jarFiles.add( url );
|
||||
+ if (!JavaPluginLoader.SuppressLibraryLoaderLogger) // Purpur
|
||||
logger.log( Level.INFO, "[{0}] Loaded library {1}", new Object[]
|
||||
{
|
||||
java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), file // Paper - use configured log prefix
|
||||
@@ -1,29 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Racci <90304606+DaRacci@users.noreply.github.com>
|
||||
Date: Fri, 4 Feb 2022 16:09:47 +1100
|
||||
Subject: [PATCH] Fire Immunity API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 52867495d0f746ff40e802c4f1018511e58fd03e..98de85d1382fe84cdc2e2c9db04bf1b4f157291c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1086,5 +1086,18 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
* @return True if in daylight
|
||||
*/
|
||||
boolean isInDaylight();
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if the entity is fire immune
|
||||
+ *
|
||||
+ * @return True if fire immune
|
||||
+ */
|
||||
+ boolean isImmuneToFire();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets if the entity is fire immune
|
||||
+ * Set this to null to restore the entity type default
|
||||
+ */
|
||||
+ void setImmuneToFire(@Nullable Boolean fireImmune);
|
||||
// Purpur end
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: SageSphinx63920 <sage@sagesphinx63920.dev>
|
||||
Date: Sat, 29 Oct 2022 00:06:05 +0200
|
||||
Subject: [PATCH] Added goat ram event
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/GoatRamEntityEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/GoatRamEntityEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f62c14f3d4999e9112c1c73642aa337d97b94b5a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/GoatRamEntityEvent.java
|
||||
@@ -0,0 +1,59 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Goat;
|
||||
+import org.bukkit.entity.LivingEntity;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a goat rams an entity
|
||||
+ */
|
||||
+public class GoatRamEntityEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final LivingEntity rammedEntity;
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ public GoatRamEntityEvent(@NotNull Goat goat, @NotNull LivingEntity rammedEntity) {
|
||||
+ super(goat);
|
||||
+ this.rammedEntity = rammedEntity;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the entity that was rammed by the goat
|
||||
+ *
|
||||
+ * @return The rammed entity
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public LivingEntity getRammedEntity() {
|
||||
+ return this.rammedEntity;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public Goat getEntity() {
|
||||
+ return (Goat) super.getEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return this.cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,136 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: SageSphinx63920 <sage@sagesphinx63920.dev>
|
||||
Date: Mon, 26 Dec 2022 23:40:13 +0100
|
||||
Subject: [PATCH] Add PreExplodeEvents
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java b/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..32602b398ede24a35ed8a996faa2b23455615a7b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java
|
||||
@@ -0,0 +1,54 @@
|
||||
+package org.purpurmc.purpur.event;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
+import org.bukkit.block.BlockState;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockExplodeEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import java.util.Collections;
|
||||
+
|
||||
+/**
|
||||
+ * Called before a block's explosion is processed
|
||||
+ */
|
||||
+public class PreBlockExplodeEvent extends BlockExplodeEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean cancelled;
|
||||
+ private final float yield;
|
||||
+
|
||||
+ public PreBlockExplodeEvent(@NotNull final Block what, final float yield, @Nullable BlockState explodedBlockState) {
|
||||
+ super(what, Collections.emptyList(), yield, explodedBlockState);
|
||||
+ this.yield = yield;
|
||||
+ this.cancelled = false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the percentage of blocks to drop from this explosion
|
||||
+ *
|
||||
+ * @return The yield.
|
||||
+ */
|
||||
+ public float getYield() {
|
||||
+ return yield;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return this.cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/entity/PreEntityExplodeEvent.java b/src/main/java/org/purpurmc/purpur/event/entity/PreEntityExplodeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2d4f68228861492baaea0bcc604dfef623b337ba
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/entity/PreEntityExplodeEvent.java
|
||||
@@ -0,0 +1,64 @@
|
||||
+package org.purpurmc.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import java.util.Collections;
|
||||
+
|
||||
+/**
|
||||
+ * Called before an entity's explosion is processed
|
||||
+ */
|
||||
+public class PreEntityExplodeEvent extends EntityExplodeEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean cancelled;
|
||||
+ private final float yield;
|
||||
+ private final Location location;
|
||||
+
|
||||
+ public PreEntityExplodeEvent(@NotNull org.bukkit.entity.Entity what, @NotNull final Location location, final float yield) {
|
||||
+ super(what, location, Collections.emptyList(), yield);
|
||||
+ this.cancelled = false;
|
||||
+ this.yield = yield;
|
||||
+ this.location = location;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the percentage of blocks to drop from this explosion
|
||||
+ *
|
||||
+ * @return The yield.
|
||||
+ */
|
||||
+ public float getYield() {
|
||||
+ return yield;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the location where the explosion happened.
|
||||
+ *
|
||||
+ * @return The location of the explosion
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getLocation() {
|
||||
+ return location;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return this.cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,93 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: EOT3000 <egor.tolstenkov@outlook.com>
|
||||
Date: Sat, 10 Jun 2023 20:27:14 -0400
|
||||
Subject: [PATCH] Stored Bee API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/block/EntityBlockStorage.java b/src/main/java/org/bukkit/block/EntityBlockStorage.java
|
||||
index 739911cda33b373f99df627a3a378b37d7d461aa..51e78c22cd021722b963fe31d1d9175d141add1a 100644
|
||||
--- a/src/main/java/org/bukkit/block/EntityBlockStorage.java
|
||||
+++ b/src/main/java/org/bukkit/block/EntityBlockStorage.java
|
||||
@@ -47,6 +47,24 @@ public interface EntityBlockStorage<T extends Entity> extends TileState {
|
||||
@NotNull
|
||||
List<T> releaseEntities();
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Releases a stored entity, and returns the entity in the world.
|
||||
+ *
|
||||
+ * @param entity Entity to release
|
||||
+ * @return The entity which was released, or null if the stored entity is not in the hive
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.Nullable
|
||||
+ T releaseEntity(@NotNull org.purpurmc.purpur.entity.StoredEntity<T> entity);
|
||||
+
|
||||
+ /**
|
||||
+ * Gets all the entities currently stored in the block.
|
||||
+ *
|
||||
+ * @return List of all entities which are stored in the block
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ List<org.purpurmc.purpur.entity.StoredEntity<T>> getEntities();
|
||||
+ //Purpur end
|
||||
/**
|
||||
* Add an entity to the block.
|
||||
*
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/entity/StoredEntity.java b/src/main/java/org/purpurmc/purpur/entity/StoredEntity.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..29540d55532197d2381a52ea9222b5785d224ef8
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/entity/StoredEntity.java
|
||||
@@ -0,0 +1,52 @@
|
||||
+package org.purpurmc.purpur.entity;
|
||||
+
|
||||
+import org.bukkit.Nameable;
|
||||
+import org.bukkit.block.EntityBlockStorage;
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.persistence.PersistentDataHolder;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Represents an entity stored in a block
|
||||
+ *
|
||||
+ * @see org.bukkit.block.EntityBlockStorage
|
||||
+ */
|
||||
+public interface StoredEntity<T extends Entity> extends PersistentDataHolder, Nameable {
|
||||
+ /**
|
||||
+ * Checks if this entity has been released yet
|
||||
+ *
|
||||
+ * @return if this entity has been released
|
||||
+ */
|
||||
+ boolean hasBeenReleased();
|
||||
+
|
||||
+ /**
|
||||
+ * Releases the entity from its stored block
|
||||
+ *
|
||||
+ * @return the released entity, or null if unsuccessful (including if this entity has already been released)
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ T release();
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the block in which this entity is stored
|
||||
+ *
|
||||
+ * @return the EntityBlockStorage in which this entity is stored, or null if it has been released
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ EntityBlockStorage<T> getBlockStorage();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the entity type of this stored entity
|
||||
+ *
|
||||
+ * @return the type of entity this stored entity represents
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ EntityType getType();
|
||||
+
|
||||
+ /**
|
||||
+ * Writes data to the block entity snapshot. {@link EntityBlockStorage#update()} must be run in order to update the block in game.
|
||||
+ */
|
||||
+ void update();
|
||||
+}
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 5 Jul 2023 12:48:08 -0500
|
||||
Subject: [PATCH] Explorer Map API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/map/MapRenderer.java b/src/main/java/org/bukkit/map/MapRenderer.java
|
||||
index cb7040876a99a5a7e49b81684ef0f3b79584c376..22d8f31b1b8a5dbb5ab3275068642937c097abfe 100644
|
||||
--- a/src/main/java/org/bukkit/map/MapRenderer.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapRenderer.java
|
||||
@@ -54,4 +54,12 @@ public abstract class MapRenderer {
|
||||
*/
|
||||
public abstract void render(@NotNull MapView map, @NotNull MapCanvas canvas, @NotNull Player player);
|
||||
|
||||
+ // Purpur - start
|
||||
+ /**
|
||||
+ * Check if this is an explorer (aka treasure) map.
|
||||
+ *
|
||||
+ * @return True if explorer map
|
||||
+ */
|
||||
+ public abstract boolean isExplorerMap();
|
||||
+ // Purpur - end
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: granny <granny@purpurmc.org>
|
||||
Date: Sun, 27 Aug 2023 02:09:51 -0700
|
||||
Subject: [PATCH] lightning transforms blocks
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java b/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java
|
||||
index c98f07f82d179dffe162bb5cd85efe97de1b6175..2bed9997f14a42729c90db92fbf202482a94f8be 100644
|
||||
--- a/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java
|
||||
@@ -14,6 +14,7 @@ public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
|
||||
private boolean canceled;
|
||||
private final LightningStrike bolt;
|
||||
private final Cause cause;
|
||||
+ private final java.util.List<org.bukkit.block.BlockState> blocks; // Purpur
|
||||
|
||||
@Deprecated
|
||||
public LightningStrikeEvent(@NotNull final World world, @NotNull final LightningStrike bolt) {
|
||||
@@ -21,9 +22,15 @@ public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
|
||||
}
|
||||
|
||||
public LightningStrikeEvent(@NotNull final World world, @NotNull final LightningStrike bolt, @NotNull final Cause cause) {
|
||||
+ // Purpur start
|
||||
+ this(world, bolt, cause, new java.util.ArrayList<>());
|
||||
+ }
|
||||
+ public LightningStrikeEvent(@NotNull final World world, @NotNull final LightningStrike bolt, @NotNull final Cause cause, @NotNull final java.util.List<org.bukkit.block.BlockState> blocks) {
|
||||
+ // Purpur end
|
||||
super(world);
|
||||
this.bolt = bolt;
|
||||
this.cause = cause;
|
||||
+ this.blocks = blocks; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,6 +63,21 @@ public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
|
||||
return cause;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get a list of all blocks that will be modified by the lightning strike.
|
||||
+ * <br>
|
||||
+ * This list is mutable and contains the blocks in their changed state, i.e.
|
||||
+ * having a type of {@link org.bukkit.Material#GLASS}.
|
||||
+ *
|
||||
+ * @return list of the modified blocks.
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public java.util.List<org.bukkit.block.BlockState> getBlocks() {
|
||||
+ return blocks;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,67 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 Jun 2022 09:18:57 -0500
|
||||
Subject: [PATCH] Fix pufferfish issues
|
||||
|
||||
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
index 0dd3374468e05f7a312ba5856b9cf8a4787dfa59..960c0555a001fe63de78d77d5ea47d08a520d029 100644
|
||||
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
||||
@@ -224,7 +224,7 @@ public class PufferfishConfig {
|
||||
public static int activationDistanceMod;
|
||||
|
||||
private static void dynamicActivationOfBrains() throws IOException {
|
||||
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", true);
|
||||
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
|
||||
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
||||
"This value determines how far away an entity has to be",
|
||||
"from the player to start being effected by DEAR.");
|
||||
@@ -268,7 +268,7 @@ public class PufferfishConfig {
|
||||
|
||||
public static boolean throttleInactiveGoalSelectorTick;
|
||||
private static void inactiveGoalSelectorThrottle() {
|
||||
- throttleInactiveGoalSelectorTick = getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", true,
|
||||
+ throttleInactiveGoalSelectorTick = getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", false, // Purpur
|
||||
"Throttles the AI goal selector in entity inactive ticks.",
|
||||
"This can improve performance by a few percent, but has minor gameplay implications.");
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index eac31c3fcc9161711328588ac852fcae1116d8ef..dbb59969cf55eda997588f4c3ef7dc899ea619bb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -948,7 +948,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
// Paper start - optimise random block ticking
|
||||
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
|
||||
- // private final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(); // Pufferfish - moved to super
|
||||
+ private final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(this.random.nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - moved to super // Purpur - dont break ABI
|
||||
// Paper end
|
||||
|
||||
private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.randomTickRandom.nextInt(16); } // Pufferfish
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 30d8ec75203adc677e5fb91d9538baf52a0684ad..5eca99fbd23ff0d35607bd185b011d6f9a30d0f0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -273,7 +273,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||
|
||||
- protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter
|
||||
+ //protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter // Purpur - dont break ABI
|
||||
|
||||
// Pufferfish start - ensure these get inlined
|
||||
private final int minBuildHeight, minSection, height, maxBuildHeight, maxSection;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 3eeb1f0eac76efe9b7c24f6d5787018c7842d07a..dbb0593a6feb60216379bde6720ca16f3ca827ae 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -125,7 +125,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
this.blockTicks = blockTickScheduler;
|
||||
this.fluidTicks = fluidTickScheduler;
|
||||
|
||||
- this.lightningTick = this.level.getThreadUnsafeRandom().nextInt(100000) << 1; // Pufferfish - initialize lightning tick
|
||||
+ this.lightningTick = java.util.concurrent.ThreadLocalRandom.current().nextInt(100000) << 1; // Pufferfish - initialize lightning tick // Purpur - any random will do
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1,855 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 01:02:11 -0500
|
||||
Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index f6cd7b910ce41a254e71bf0fcfe93c38abbb1445..139e2b17b899da6f0147bb8b4412e2e54e817be4 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,12 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
val alsoShade: Configuration by configurations.creating
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":pufferfish-api")) // Pufferfish // Paper
|
||||
- // Pufferfish start
|
||||
- implementation("io.papermc.paper:paper-mojangapi:1.19.2-R0.1-SNAPSHOT") {
|
||||
+ // Purpur start
|
||||
+ implementation(project(":purpur-api"))
|
||||
+ implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
|
||||
exclude("io.papermc.paper", "paper-api")
|
||||
}
|
||||
- // Pufferfish end
|
||||
+ // Purpur end
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -56,6 +56,10 @@ dependencies {
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
|
||||
+ implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
|
||||
+ implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
|
||||
+ implementation("dev.omega24:upnp4j:1.0") // Purpur
|
||||
+
|
||||
// Pufferfish start
|
||||
implementation("org.yaml:snakeyaml:1.32")
|
||||
implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
|
||||
@@ -91,7 +95,7 @@ tasks.jar {
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
"Implementation-Title" to "CraftBukkit",
|
||||
- "Implementation-Version" to "git-Pufferfish-$implementationVersion", // Pufferfish
|
||||
+ "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur
|
||||
"Implementation-Vendor" to date, // Paper
|
||||
"Specification-Title" to "Bukkit",
|
||||
"Specification-Version" to project.version,
|
||||
@@ -168,7 +172,7 @@ fun TaskContainer.registerRunTask(
|
||||
name: String,
|
||||
block: JavaExec.() -> Unit
|
||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||
- group = "paper"
|
||||
+ group = "paperweight" // Purpur
|
||||
mainClass.set("org.bukkit.craftbukkit.Main")
|
||||
standardInput = System.`in`
|
||||
workingDir = rootProject.layout.projectDirectory
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..462a6eed350fd660ddaf25d567bb6e97b77d0b2b 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
@@ -19,8 +19,10 @@ import java.util.stream.StreamSupport;
|
||||
|
||||
public class PaperVersionFetcher implements VersionFetcher {
|
||||
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
|
||||
- private static final String GITHUB_BRANCH_NAME = "master";
|
||||
- private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/paper";
|
||||
+ // Purpur start
|
||||
+ private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
|
||||
+ private static int distance = -2; public int distance() { return distance; }
|
||||
+ // Purpur end
|
||||
private static @Nullable String mcVer;
|
||||
|
||||
@Override
|
||||
@@ -31,11 +33,11 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Component getVersionMessage(@Nonnull String serverVersion) {
|
||||
- String[] parts = serverVersion.substring("git-Paper-".length()).split("[-\\s]");
|
||||
- final Component updateMessage = getUpdateStatusMessage("PaperMC/Paper", GITHUB_BRANCH_NAME, parts[0]);
|
||||
+ String[] parts = serverVersion.substring("git-Purpur-".length()).split("[-\\s]"); // Purpur
|
||||
+ final Component updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", "ver/" + getMinecraftVersion(), parts[0]); // Purpur
|
||||
final Component history = getHistory();
|
||||
|
||||
- return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
|
||||
+ return history != null ? Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()), history, updateMessage) : updateMessage; // Purpur
|
||||
}
|
||||
|
||||
private static @Nullable String getMinecraftVersion() {
|
||||
@@ -45,7 +47,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
String result = matcher.group();
|
||||
mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-'
|
||||
} else {
|
||||
- org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to PaperMC!");
|
||||
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Purpur!"); // Purpur
|
||||
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
|
||||
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
|
||||
}
|
||||
@@ -55,7 +57,7 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
}
|
||||
|
||||
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
|
||||
- int distance;
|
||||
+ //int distance; // Purpur - use field
|
||||
try {
|
||||
int jenkinsBuild = Integer.parseInt(versionInfo);
|
||||
distance = fetchDistanceFromSiteApi(jenkinsBuild, getMinecraftVersion());
|
||||
@@ -66,13 +68,13 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
|
||||
switch (distance) {
|
||||
case -1:
|
||||
- return Component.text("Error obtaining version information", NamedTextColor.YELLOW);
|
||||
+ return Component.text("* Error obtaining version information", NamedTextColor.RED); // Purpur
|
||||
case 0:
|
||||
- return Component.text("You are running the latest version", NamedTextColor.GREEN);
|
||||
+ return Component.text("* You are running the latest version", NamedTextColor.GREEN); // Purpur
|
||||
case -2:
|
||||
- return Component.text("Unknown version", NamedTextColor.YELLOW);
|
||||
+ return Component.text("* Unknown version", NamedTextColor.YELLOW); // Purpur
|
||||
default:
|
||||
- return Component.text("You are " + distance + " version(s) behind", NamedTextColor.YELLOW)
|
||||
+ return Component.text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur
|
||||
.append(Component.newline())
|
||||
.append(Component.text("Download the new version at: ")
|
||||
.append(Component.text(DOWNLOAD_PAGE, NamedTextColor.GOLD)
|
||||
@@ -85,15 +87,11 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
if (siteApiVersion == null) { return -1; }
|
||||
try {
|
||||
try (BufferedReader reader = Resources.asCharSource(
|
||||
- new URL("https://api.papermc.io/v2/projects/paper/versions/" + siteApiVersion),
|
||||
+ new URL("https://api.purpurmc.org/v2/purpur/" + siteApiVersion), // Purpur
|
||||
Charsets.UTF_8
|
||||
).openBufferedStream()) {
|
||||
JsonObject json = new Gson().fromJson(reader, JsonObject.class);
|
||||
- JsonArray builds = json.getAsJsonArray("builds");
|
||||
- int latest = StreamSupport.stream(builds.spliterator(), false)
|
||||
- .mapToInt(e -> e.getAsInt())
|
||||
- .max()
|
||||
- .getAsInt();
|
||||
+ int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur
|
||||
return latest - jenkinsBuild;
|
||||
} catch (JsonSyntaxException ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -144,6 +142,6 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
return null;
|
||||
}
|
||||
|
||||
- return Component.text("Previous version: " + oldVersion, NamedTextColor.GRAY, TextDecoration.ITALIC);
|
||||
+ return org.bukkit.ChatColor.parseMM("<grey>Previous: %s", oldVersion); // Purpur
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..3cb56595822799926a8141e60a42f5d1edfc6de5 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
@Override
|
||||
protected LineReader buildReader(LineReaderBuilder builder) {
|
||||
builder
|
||||
- .appName("Paper")
|
||||
+ .appName("Purpur") // Purpur
|
||||
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
|
||||
.completer(new ConsoleCommandCompleter(this.server))
|
||||
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
||||
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
|
||||
index abe37c7c3c6f5ab73afd738ec78f06d7e4d2ed96..b5b6657e52e4f7a630229bd3ba433438af293e22 100644
|
||||
--- a/src/main/java/net/minecraft/CrashReport.java
|
||||
+++ b/src/main/java/net/minecraft/CrashReport.java
|
||||
@@ -123,6 +123,10 @@ public class CrashReport {
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
|
||||
stringbuilder.append("---- Minecraft Crash Report ----\n");
|
||||
+ // Purpur start
|
||||
+ stringbuilder.append("// ");
|
||||
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!");
|
||||
+ // Purpur end
|
||||
stringbuilder.append("// ");
|
||||
stringbuilder.append(CrashReport.getErrorComment());
|
||||
stringbuilder.append("\n\n");
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 7ca6c81afc99d42d2f39b4b6d7f5e8a18b58fba3..34737c730d724d4be67d480587a17792fd3a11f0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -923,7 +923,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
shutdownThread = Thread.currentThread();
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||
if (!isSameThread()) {
|
||||
- MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)");
|
||||
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PURPUR)"); // Purpur
|
||||
while (this.getRunningThread().isAlive()) {
|
||||
this.getRunningThread().stop();
|
||||
try {
|
||||
@@ -1695,7 +1695,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
- return "Pufferfish"; // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return "Purpur"; // Purpur - Purpur > // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
}
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport details) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 20dff22409325fb39e1d78282310e828977e571b..a2e1a7f5afbdc9c9c7fea251bf7b50ccf9c32dfc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -265,7 +265,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
- private final String serverName = "Pufferfish"; // Paper // Pufferfish
|
||||
+ private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur
|
||||
private final String serverVersion;
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
||||
index 4e56018b64d11f76c8da43fd8f85c6de72204e36..9607675e6c5bff2183c4420d11fc63eeb5747fb6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
||||
@@ -21,7 +21,12 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co
|
||||
|
||||
@Override
|
||||
public void sendMessage(String message) {
|
||||
- this.sendRawMessage(message);
|
||||
+ // Purpur start
|
||||
+ String[] parts = message.split("\n");
|
||||
+ for (String part : parts) {
|
||||
+ this.sendRawMessage(part);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,7 +96,7 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co
|
||||
// Paper start
|
||||
@Override
|
||||
public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) {
|
||||
- this.sendRawMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message));
|
||||
+ this.sendMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message)); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index f0ce29d21fe9af803ce4e41b8c037b2ec5d1b124..7bc8b62ff6aa355f3f025fc6c3a3d4c6b355853b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -907,7 +907,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return EntityCategory.WATER;
|
||||
}
|
||||
|
||||
- throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Spigot.");
|
||||
+ throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Purpur."); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index d7ce4971d9271dbeff4adb9d852e4e7bdf60bf03..5a47a8785bc2e251d041f80a79295c43459de3bc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -501,7 +501,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
this.parsePending();
|
||||
} else {
|
||||
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
|
||||
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Paper"); // Paper
|
||||
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur
|
||||
// We don't need to parse pending
|
||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 2b4581f92543c11f31bcc1417e90d7f90b2aea20..ffca5970a6259b024c9aa935e22cf72ed8cd8e9f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -470,7 +470,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
||||
@Override
|
||||
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
||||
- return new gg.pufferfish.pufferfish.PufferfishVersionFetcher(); // Pufferfish
|
||||
+ return new com.destroystokyo.paper.PaperVersionFetcher(); // Pufferfish // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 80553face9c70c2a3d897681e7761df85b22d464..99597258e8e88cd9e2c901c4ac3ff7faeeabee2b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
@@ -11,7 +11,7 @@ public final class Versioning {
|
||||
public static String getBukkitVersion() {
|
||||
String result = "Unknown-Version";
|
||||
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.pufferfish.pufferfish/pufferfish-api/pom.properties"); // Pufferfish
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
|
||||
Properties properties = new Properties();
|
||||
|
||||
if (stream != null) {
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 98fba0288be9ed2cb18ffba5cf81148157dd4fcf..0801dea155048ac5383295f4fef9bd597b678535 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -96,7 +96,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
|
||||
private WatchdogThread(long timeoutTime, boolean restart)
|
||||
{
|
||||
- super( "Paper Watchdog Thread" );
|
||||
+ super( "Watchdog Thread" ); // Purpur - use a generic name
|
||||
this.timeoutTime = timeoutTime;
|
||||
this.restart = restart;
|
||||
earlyWarningEvery = Math.min(io.papermc.paper.configuration.GlobalConfiguration.get().watchdog.earlyWarningEvery, timeoutTime); // Paper
|
||||
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
if (isLongTimeout) {
|
||||
// Paper end
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Paper bug." ); // Paper
|
||||
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur
|
||||
log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
|
||||
log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" );
|
||||
log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" );
|
||||
log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
|
||||
- log.log( Level.SEVERE, "If you are unsure or still think this is a Paper bug, please report this to https://github.com/PaperMC/Paper/issues" );
|
||||
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur
|
||||
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
|
||||
- log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() );
|
||||
+ log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -185,12 +185,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
// Paper end
|
||||
} else
|
||||
{
|
||||
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---");
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur
|
||||
log.log(Level.SEVERE, "The server has not responded for " + (currentTime - lastTick) / 1000 + " seconds! Creating thread dump");
|
||||
}
|
||||
// Paper end - Different message for short timeout
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
|
||||
this.dumpTickingInfo(); // Paper - log detailed tick information
|
||||
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
||||
@@ -206,7 +206,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
WatchdogThread.dumpThread( thread, log );
|
||||
}
|
||||
} else {
|
||||
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---");
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur
|
||||
}
|
||||
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png
|
||||
index 8b924977b7886df9ab8790b1e4ff9b1c04a2af45..518591dd83289e041a16e2c2e7d7e7640d4b2e1b 100644
|
||||
GIT binary patch
|
||||
literal 9260
|
||||
zcmWk!Wmptl7+qlLS~|W3b}1=IK|*5b5@|#_l<sa=8WvatrA11R22nr|NnMaG>0AUP
|
||||
zC6t~Ie$33hbMG7HJ?G9mbDv4n)lnlSVI~2AK;#<g%KEog%-unRcYDr_v#bVzaIbZ>
|
||||
z4OMQt9~6L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||||
zwo0ZyTNCB`dfUZA+chm*()HWtA2!JQ3>g${<ZEUqmU&IH*$?ZzOs2IhHpYEix|NPQ
|
||||
zJ-Pi715VXGJVDjN><!w*tid~hXaqgXjMCinP(wu6AN~G*C5MrlRjoO?J1hQ>8%Vr%
|
||||
zasf==&095e)fG}M%iIsk{PaQ>2|D59ppz^2pExvb9Ou9EI^`kN!0aXr*u3p0ex0b4
|
||||
z=AnHH#@v>`#o*LjN-yB0^^l)H2Nm=yD3|>1aNigv$f`s680kxF8B%d>SUG)YF0R~W
|
||||
z$TI5rvll2~&q4RSwu3})*@1!~z4l}@NsY#MwV(2<h@*@k1>Y=hbLZh-ce*Eq3<#rZ
|
||||
zxra}au9h@`-JaCDeW|)St?N40z`g~4rjZ?xu=?#W;cJyHNPXCV2DuxD%N1A2hAlFH
|
||||
zwTJm(6XPn#dA&{dq>&yd{5Lp=pa<%$*em=~TdQ%rn_v#5`><qe0k3yPzhk;_7^Ch6
|
||||
z``4jh8^vb#=_?9Hh_)q6T)5{?KdaF@G)h>I!IS>M^uNpl#N|wC@HMBcRTMT#SL;d7
|
||||
z<(&BuA6dLkkx|8fWw@PXzCeCBgDx@HJs@)L+j8y~gZ<df6K`wk{>)7)${p-|O7{G?
|
||||
z&|M6FI|A*^d_U+Of-3`+w(c~-YsQby|NH)g|G7xv|Nek^|Jex)g~z+)I0xPC0460S
|
||||
LFIp>X81%mY^Bg|U
|
||||
|
||||
@@ -1,529 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 9 May 2019 18:09:43 -0500
|
||||
Subject: [PATCH] Purpur config files
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 692c962193cf9fcc6801fc93f3220bdc673d527b..8cde30544e14f8fc2dac32966ae3c21f8cf3a551 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -593,7 +593,7 @@ public class Metrics {
|
||||
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||
// Only start Metrics, if it's enabled in the config
|
||||
if (config.getBoolean("enabled", true)) {
|
||||
- Metrics metrics = new Metrics("Pufferfish", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish
|
||||
+ Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||
String minecraftVersion = Bukkit.getVersion();
|
||||
@@ -602,16 +602,8 @@ public class Metrics {
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : "offline"));
|
||||
- final String paperVersion;
|
||||
- final String implVersion = org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion();
|
||||
- if (implVersion != null) {
|
||||
- final String buildOrHash = implVersion.substring(implVersion.lastIndexOf('-') + 1);
|
||||
- paperVersion = "git-Pufferfish-%s-%s".formatted(Bukkit.getServer().getMinecraftVersion(), buildOrHash); // Pufferfish
|
||||
- } else {
|
||||
- paperVersion = "unknown";
|
||||
- }
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("pufferfish_version", () -> paperVersion)); // Pufferfish
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
index 0de2eae2d448ac9e269a4edf48406d5ea8af8059..f03fd95412883a3a5bbe2b91c603874bf147e6cb 100644
|
||||
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -336,6 +336,30 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public void sendSuccess(@Nullable String message) {
|
||||
+ sendSuccess(message, false);
|
||||
+ }
|
||||
+
|
||||
+ public void sendSuccess(@Nullable String message, boolean broadcastToOps) {
|
||||
+ if (message == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ sendSuccess(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message), broadcastToOps);
|
||||
+ }
|
||||
+
|
||||
+ public void sendSuccess(@Nullable net.kyori.adventure.text.Component message) {
|
||||
+ sendSuccess(message, false);
|
||||
+ }
|
||||
+
|
||||
+ public void sendSuccess(@Nullable net.kyori.adventure.text.Component message, boolean broadcastToOps) {
|
||||
+ if (message == null) {
|
||||
+ return;
|
||||
+ }
|
||||
+ sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(message), broadcastToOps);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public void sendSuccess(Supplier<Component> feedbackSupplier, boolean broadcastToOps) {
|
||||
boolean flag1 = this.source.acceptsSuccess() && !this.silent;
|
||||
boolean flag2 = broadcastToOps && this.source.shouldInformAdmins() && !this.silent;
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 28af96ce4f9f1a83316b6fd9e1625c71b5874c3f..cf7c7b3cd4081e1be059647dca237ffd72c374df 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -218,6 +218,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this);
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics();
|
||||
+ // Purpur start
|
||||
+ try {
|
||||
+ org.purpurmc.purpur.PurpurConfig.init((java.io.File) options.valueOf("purpur-settings"));
|
||||
+ } catch (Exception e) {
|
||||
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
||||
+ return false;
|
||||
+ }
|
||||
+ org.purpurmc.purpur.PurpurConfig.registerCommands();
|
||||
+ // Purpur end
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index f5a3203c60e555c496626c842d72e4cdc6cd9f6e..dc71cf3c66a0a4390177428688e6f4ee39a981b6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -176,6 +176,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Paper end
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
+ public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
@@ -287,6 +288,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
||||
+ this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 4a5804e14b82229fc4b4bf44725d79f55d0d4c80..a78cf70e754ec35366fc269cca8e2deda14635b0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1057,6 +1057,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
+ org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -1072,6 +1073,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
+ world.purpurConfig.init(); // Purpur
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -1087,6 +1089,7 @@ public final class CraftServer implements Server {
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
+ org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2937,6 +2940,18 @@ public final class CraftServer implements Server {
|
||||
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public YamlConfiguration getPurpurConfig() {
|
||||
+ return org.purpurmc.purpur.PurpurConfig.config;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.Properties getServerProperties() {
|
||||
+ return getProperties().properties;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 776b7fc26fe96b69be260bbd36efae147d988640..b1ac20e88ba0db9b6591df745ca8bc4bc3f9e4ae 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -173,6 +173,14 @@ public class Main {
|
||||
.describedAs("Jar file");
|
||||
// Paper end
|
||||
|
||||
+ // Purpur Start
|
||||
+ acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings")
|
||||
+ .withRequiredArg()
|
||||
+ .ofType(File.class)
|
||||
+ .defaultsTo(new File("purpur.yml"))
|
||||
+ .describedAs("Yml file");
|
||||
+ // Purpur end
|
||||
+
|
||||
// Paper start
|
||||
acceptsAll(asList("server-name"), "Name of the server")
|
||||
.withRequiredArg()
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..61d193d8ddd87817bf2c560037d42366cff1eca9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -0,0 +1,175 @@
|
||||
+package org.purpurmc.purpur;
|
||||
+
|
||||
+import com.google.common.base.Throwables;
|
||||
+import com.google.common.collect.ImmutableMap;
|
||||
+import com.mojang.datafixers.util.Pair;
|
||||
+import net.kyori.adventure.bossbar.BossBar;
|
||||
+import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
+import net.minecraft.core.registries.BuiltInRegistries;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.world.effect.MobEffect;
|
||||
+import net.minecraft.world.effect.MobEffectInstance;
|
||||
+import net.minecraft.world.entity.EntityDimensions;
|
||||
+import net.minecraft.world.entity.EntityType;
|
||||
+import net.minecraft.world.food.FoodProperties;
|
||||
+import net.minecraft.world.food.Foods;
|
||||
+import net.minecraft.world.item.enchantment.Enchantment;
|
||||
+import net.minecraft.world.level.block.Block;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.configuration.ConfigurationSection;
|
||||
+import org.bukkit.configuration.InvalidConfigurationException;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+import org.purpurmc.purpur.command.PurpurCommand;
|
||||
+import org.purpurmc.purpur.task.TPSBarTask;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.io.IOException;
|
||||
+import java.lang.reflect.InvocationTargetException;
|
||||
+import java.lang.reflect.Method;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Collections;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.List;
|
||||
+import java.util.Map;
|
||||
+import java.util.Set;
|
||||
+import java.util.logging.Level;
|
||||
+
|
||||
+@SuppressWarnings("unused")
|
||||
+public class PurpurConfig {
|
||||
+ private static final String HEADER = "This is the main configuration file for Purpur.\n"
|
||||
+ + "As you can see, there's tons to configure. Some options may impact gameplay, so use\n"
|
||||
+ + "with caution, and make sure you know what each option does before configuring.\n"
|
||||
+ + "\n"
|
||||
+ + "If you need help with the configuration or have any questions related to Purpur,\n"
|
||||
+ + "join us in our Discord guild.\n"
|
||||
+ + "\n"
|
||||
+ + "Website: https://purpurmc.org \n"
|
||||
+ + "Docs: https://purpurmc.org/docs \n";
|
||||
+ private static File CONFIG_FILE;
|
||||
+ public static YamlConfiguration config;
|
||||
+
|
||||
+ private static Map<String, Command> commands;
|
||||
+
|
||||
+ public static int version;
|
||||
+ static boolean verbose;
|
||||
+
|
||||
+ public static void init(File configFile) {
|
||||
+ CONFIG_FILE = configFile;
|
||||
+ config = new YamlConfiguration();
|
||||
+ try {
|
||||
+ config.load(CONFIG_FILE);
|
||||
+ } catch (IOException ignore) {
|
||||
+ } catch (InvalidConfigurationException ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Could not load purpur.yml, please correct your syntax errors", ex);
|
||||
+ throw Throwables.propagate(ex);
|
||||
+ }
|
||||
+ config.options().header(HEADER);
|
||||
+ config.options().copyDefaults(true);
|
||||
+ verbose = getBoolean("verbose", false);
|
||||
+
|
||||
+ commands = new HashMap<>();
|
||||
+ commands.put("purpur", new PurpurCommand("purpur"));
|
||||
+
|
||||
+ version = getInt("config-version", 33);
|
||||
+ set("config-version", 33);
|
||||
+
|
||||
+ readConfig(PurpurConfig.class, null);
|
||||
+
|
||||
+ Blocks.rebuildCache();
|
||||
+ }
|
||||
+
|
||||
+ protected static void log(String s) {
|
||||
+ if (verbose) {
|
||||
+ log(Level.INFO, s);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ protected static void log(Level level, String s) {
|
||||
+ Bukkit.getLogger().log(level, s);
|
||||
+ }
|
||||
+
|
||||
+ public static void registerCommands() {
|
||||
+ for (Map.Entry<String, Command> entry : commands.entrySet()) {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Purpur", entry.getValue());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ static void readConfig(Class<?> clazz, Object instance) {
|
||||
+ for (Method method : clazz.getDeclaredMethods()) {
|
||||
+ if (Modifier.isPrivate(method.getModifiers())) {
|
||||
+ if (method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE) {
|
||||
+ try {
|
||||
+ method.setAccessible(true);
|
||||
+ method.invoke(instance);
|
||||
+ } catch (InvocationTargetException ex) {
|
||||
+ throw Throwables.propagate(ex.getCause());
|
||||
+ } catch (Exception ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ config.save(CONFIG_FILE);
|
||||
+ } catch (IOException ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Could not save " + CONFIG_FILE, ex);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static void set(String path, Object val) {
|
||||
+ config.addDefault(path, val);
|
||||
+ config.set(path, val);
|
||||
+ }
|
||||
+
|
||||
+ private static String getString(String path, String def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getString(path, config.getString(path));
|
||||
+ }
|
||||
+
|
||||
+ private static boolean getBoolean(String path, boolean def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getBoolean(path, config.getBoolean(path));
|
||||
+ }
|
||||
+
|
||||
+ private static double getDouble(String path, double def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getDouble(path, config.getDouble(path));
|
||||
+ }
|
||||
+
|
||||
+ private static int getInt(String path, int def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getInt(path, config.getInt(path));
|
||||
+ }
|
||||
+
|
||||
+ private static <T> List getList(String path, T def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getList(path, config.getList(path));
|
||||
+ }
|
||||
+
|
||||
+ static Map<String, Object> getMap(String path, Map<String, Object> def) {
|
||||
+ if (def != null && config.getConfigurationSection(path) == null) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return def;
|
||||
+ }
|
||||
+ return toMap(config.getConfigurationSection(path));
|
||||
+ }
|
||||
+
|
||||
+ private static Map<String, Object> toMap(ConfigurationSection section) {
|
||||
+ ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
|
||||
+ if (section != null) {
|
||||
+ for (String key : section.getKeys(false)) {
|
||||
+ Object obj = section.get(key);
|
||||
+ if (obj != null) {
|
||||
+ builder.put(key, obj instanceof ConfigurationSection val ? toMap(val) : obj);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return builder.build();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5f0732c2b8f85185b6dfc1db3119c22e8be7f5da
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -0,0 +1,92 @@
|
||||
+package org.purpurmc.purpur;
|
||||
+
|
||||
+import net.minecraft.core.registries.BuiltInRegistries;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.util.Mth;
|
||||
+import net.minecraft.world.entity.Entity;
|
||||
+import net.minecraft.world.entity.EntityType;
|
||||
+import net.minecraft.world.item.DyeColor;
|
||||
+import net.minecraft.world.item.Item;
|
||||
+import net.minecraft.world.item.Items;
|
||||
+import net.minecraft.world.level.block.Block;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
+import net.minecraft.world.level.block.state.properties.Tilt;
|
||||
+import org.purpurmc.purpur.tool.Flattenable;
|
||||
+import org.purpurmc.purpur.tool.Strippable;
|
||||
+import org.purpurmc.purpur.tool.Tillable;
|
||||
+import org.purpurmc.purpur.tool.Waxable;
|
||||
+import org.purpurmc.purpur.tool.Weatherable;
|
||||
+import org.apache.commons.lang.BooleanUtils;
|
||||
+import org.bukkit.ChatColor;
|
||||
+import org.bukkit.World;
|
||||
+import org.bukkit.configuration.ConfigurationSection;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.List;
|
||||
+import java.util.Map;
|
||||
+import java.util.function.Predicate;
|
||||
+import java.util.logging.Level;
|
||||
+import static org.purpurmc.purpur.PurpurConfig.log;
|
||||
+
|
||||
+@SuppressWarnings("unused")
|
||||
+public class PurpurWorldConfig {
|
||||
+
|
||||
+ private final String worldName;
|
||||
+ private final World.Environment environment;
|
||||
+
|
||||
+ public PurpurWorldConfig(String worldName, World.Environment environment) {
|
||||
+ this.worldName = worldName;
|
||||
+ this.environment = environment;
|
||||
+ init();
|
||||
+ }
|
||||
+
|
||||
+ public void init() {
|
||||
+ log("-------- World Settings For [" + worldName + "] --------");
|
||||
+ PurpurConfig.readConfig(PurpurWorldConfig.class, this);
|
||||
+ }
|
||||
+
|
||||
+ private void set(String path, Object val) {
|
||||
+ PurpurConfig.config.addDefault("world-settings.default." + path, val);
|
||||
+ PurpurConfig.config.set("world-settings.default." + path, val);
|
||||
+ if (PurpurConfig.config.get("world-settings." + worldName + "." + path) != null) {
|
||||
+ PurpurConfig.config.addDefault("world-settings." + worldName + "." + path, val);
|
||||
+ PurpurConfig.config.set("world-settings." + worldName + "." + path, val);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private ConfigurationSection getConfigurationSection(String path) {
|
||||
+ ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + worldName + "." + path);
|
||||
+ return section != null ? section : PurpurConfig.config.getConfigurationSection("world-settings.default." + path);
|
||||
+ }
|
||||
+
|
||||
+ private String getString(String path, String def) {
|
||||
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
+ return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
+ }
|
||||
+
|
||||
+ private boolean getBoolean(String path, boolean def) {
|
||||
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
+ return PurpurConfig.config.getBoolean("world-settings." + worldName + "." + path, PurpurConfig.config.getBoolean("world-settings.default." + path));
|
||||
+ }
|
||||
+
|
||||
+ private double getDouble(String path, double def) {
|
||||
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
+ return PurpurConfig.config.getDouble("world-settings." + worldName + "." + path, PurpurConfig.config.getDouble("world-settings.default." + path));
|
||||
+ }
|
||||
+
|
||||
+ private int getInt(String path, int def) {
|
||||
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
+ return PurpurConfig.config.getInt("world-settings." + worldName + "." + path, PurpurConfig.config.getInt("world-settings.default." + path));
|
||||
+ }
|
||||
+
|
||||
+ private <T> List<?> getList(String path, T def) {
|
||||
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
+ return PurpurConfig.config.getList("world-settings." + worldName + "." + path, PurpurConfig.config.getList("world-settings.default." + path));
|
||||
+ }
|
||||
+
|
||||
+ private Map<String, Object> getMap(String path, Map<String, Object> def) {
|
||||
+ final Map<String, Object> fallback = PurpurConfig.getMap("world-settings.default." + path, def);
|
||||
+ final Map<String, Object> value = PurpurConfig.getMap("world-settings." + worldName + "." + path, null);
|
||||
+ return value.isEmpty() ? fallback : value;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java b/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..afdf04f8b22ad0b7c0b41675e44687b49c2f86d6
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
|
||||
@@ -0,0 +1,65 @@
|
||||
+package org.purpurmc.purpur.command;
|
||||
+
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.ServerLevel;
|
||||
+import org.purpurmc.purpur.PurpurConfig;
|
||||
+import org.bukkit.ChatColor;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.util.Collections;
|
||||
+import java.util.List;
|
||||
+import java.util.stream.Collectors;
|
||||
+import java.util.stream.Stream;
|
||||
+
|
||||
+public class PurpurCommand extends Command {
|
||||
+ public PurpurCommand(String name) {
|
||||
+ super(name);
|
||||
+ this.description = "Purpur related commands";
|
||||
+ this.usageMessage = "/purpur [reload | version]";
|
||||
+ this.setPermission("bukkit.command.purpur");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
||||
+ if (args.length == 1) {
|
||||
+ return Stream.of("reload", "version")
|
||||
+ .filter(arg -> arg.startsWith(args[0].toLowerCase()))
|
||||
+ .collect(Collectors.toList());
|
||||
+ }
|
||||
+ return Collections.emptyList();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
+ if (!testPermission(sender)) return true;
|
||||
+
|
||||
+ if (args.length != 1) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (args[0].equalsIgnoreCase("reload")) {
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
|
||||
+
|
||||
+ MinecraftServer console = MinecraftServer.getServer();
|
||||
+ PurpurConfig.init((File) console.options.valueOf("purpur-settings"));
|
||||
+ for (ServerLevel level : console.getAllLevels()) {
|
||||
+ level.purpurConfig.init();
|
||||
+ }
|
||||
+ console.server.reloadCount++;
|
||||
+
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Purpur config reload complete.");
|
||||
+ } else if (args[0].equalsIgnoreCase("version")) {
|
||||
+ Command verCmd = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
|
||||
+ if (verCmd != null) {
|
||||
+ return verCmd.execute(sender, commandLabel, new String[0]);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,60 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 30 Jul 2021 14:31:25 -0500
|
||||
Subject: [PATCH] Purpur client support
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 271de9d39dd765e4b4153670daa5cf6a4df22456..5787e59a7ce1aedbe655928fa2e283823a450343 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -278,6 +278,7 @@ public class ServerPlayer extends Player {
|
||||
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
|
||||
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
|
||||
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event
|
||||
+ public boolean purpurClient = false; // Purpur
|
||||
|
||||
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
|
||||
public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 776c7df81d2b71a5610fe90475f4e8044850beab..63eac8b250b8bae40de432a0ffd4792122cbae74 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3595,6 +3595,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");
|
||||
|
||||
private static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support
|
||||
+ private static final ResourceLocation PURPUR_CLIENT = new ResourceLocation("purpur", "client"); // Purpur
|
||||
|
||||
@Override
|
||||
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
|
||||
@@ -3619,6 +3620,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
|
||||
this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
|
||||
}
|
||||
+ // Purpur start
|
||||
+ } else if (packet.identifier.equals(PURPUR_CLIENT)) {
|
||||
+ try {
|
||||
+ player.purpurClient = true;
|
||||
+ } catch (Exception ignore) {
|
||||
+ }
|
||||
+ // Purpur end
|
||||
} else {
|
||||
try {
|
||||
byte[] data = new byte[packet.data.readableBytes()];
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 4e6fea7cf11b1e29ae7c7098a6f5d06bb5f93cc2..7f7375c0a3e680ef60fb9fc6157b72bb0812d1c3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3267,4 +3267,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return this.spigot;
|
||||
}
|
||||
// Spigot end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean usesPurpurClient() {
|
||||
+ return getHandle().purpurClient;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 Jun 2022 06:20:21 -0500
|
||||
Subject: [PATCH] Fix decompile errors
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/Painting.java b/src/main/java/net/minecraft/world/entity/decoration/Painting.java
|
||||
index 0f4ef103afcbabc04880c8fc3547b861341c15fc..d5784a19cec98eb199a51acd9e1f4de8c6bf7265 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/Painting.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/Painting.java
|
||||
@@ -121,7 +121,7 @@ public class Painting extends HangingEntity implements VariantHolder<Holder<Pain
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
- Holder<PaintingVariant> holder = loadVariant(nbt).orElseGet(Painting::getDefaultVariant);
|
||||
+ Holder<PaintingVariant> holder = loadVariant(nbt).orElseGet(() -> (Holder.Reference<PaintingVariant>) getDefaultVariant()); // Purpur - decompile error TODO: still needed?
|
||||
this.setVariant(holder);
|
||||
this.direction = Direction.from2DDataValue(nbt.getByte("facing"));
|
||||
super.readAdditionalSaveData(nbt);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
||||
index c1abeb62f63d2f8fb891efec8f76c6736b8f7f75..7815af9b64ead32d6f7bcad6f86b2d21ec4aec22 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
|
||||
@@ -182,7 +182,7 @@ public class Zoglin extends Monster implements Enemy, HoglinBase {
|
||||
|
||||
@Override
|
||||
public Brain<Zoglin> getBrain() {
|
||||
- return super.getBrain();
|
||||
+ return (Brain<Zoglin>) super.getBrain(); // Purpur - decompile error
|
||||
}
|
||||
|
||||
protected void updateActivity() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
index d02ee11066fc4f07ccb110b09b86d895ff90d4f2..e1be4a77fae0b9120781f460079269b85c993930 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
|
||||
@@ -70,7 +70,7 @@ public class PiglinBrute extends AbstractPiglin {
|
||||
|
||||
@Override
|
||||
public Brain<PiglinBrute> getBrain() {
|
||||
- return super.getBrain();
|
||||
+ return (Brain<PiglinBrute>) super.getBrain(); // Purpur - decompile error
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
index 877035b6c6593a28f475b9c5bcd7727e3fcdb802..0453397c157c8c7968947445f41bc46b68b111e8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
@@ -1159,7 +1159,7 @@ public class Blocks {
|
||||
}
|
||||
|
||||
private static Boolean ocelotOrParrot(BlockState state, BlockGetter world, BlockPos pos, EntityType<?> type) {
|
||||
- return (boolean)type == EntityType.OCELOT || type == EntityType.PARROT;
|
||||
+ return type == EntityType.OCELOT || type == EntityType.PARROT; // Purpur - decompile error
|
||||
}
|
||||
|
||||
private static BedBlock bed(DyeColor color) {
|
||||
@@ -1,107 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 29 Jun 2021 21:37:40 -0500
|
||||
Subject: [PATCH] Component related conveniences
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 0c3da427151d9a2ce1ca69acff283a153bd758f7..944866d42dbb4732f669c8c697934fdf0c212978 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1780,6 +1780,26 @@ public class ServerPlayer extends Player {
|
||||
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public void sendActionBarMessage(@Nullable String message) {
|
||||
+ if (message != null && !message.isEmpty()) {
|
||||
+ sendActionBarMessage(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void sendActionBarMessage(@Nullable net.kyori.adventure.text.Component message) {
|
||||
+ if (message != null) {
|
||||
+ sendActionBarMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void sendActionBarMessage(@Nullable Component message) {
|
||||
+ if (message != null) {
|
||||
+ displayClientMessage(message, true);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void displayClientMessage(Component message, boolean overlay) {
|
||||
this.sendSystemMessage(message, overlay);
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index f097ec5b4e3ad6b1a7c464a8cff4f8b2568fcf4f..78636bf26ac8efaffd8a8f4b5bbc703d6b670b7c 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1045,6 +1045,20 @@ public abstract class PlayerList {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
+ // Purpur Start
|
||||
+ public void broadcastMiniMessage(@Nullable String message, boolean overlay) {
|
||||
+ if (message != null && !message.isEmpty()) {
|
||||
+ this.broadcastMessage(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message), overlay);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void broadcastMessage(@Nullable net.kyori.adventure.text.Component message, boolean overlay) {
|
||||
+ if (message != null) {
|
||||
+ this.broadcastSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), overlay);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public void broadcastAll(Packet<?> packet, ResourceKey<Level> dimension) {
|
||||
Iterator iterator = this.players.iterator();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
index 25a5a3b949a0eb632611355e74ccd4865be108ca..14fcfd7c1d3a62833978e163f4e0d6f9b2203042 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -126,6 +126,15 @@ public class DamageSource {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public Component getLocalizedDeathMessage(String str, LivingEntity entity) {
|
||||
+ net.kyori.adventure.text.Component name = io.papermc.paper.adventure.PaperAdventure.asAdventure(entity.getDisplayName());
|
||||
+ net.kyori.adventure.text.minimessage.tag.resolver.TagResolver template = net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.component("player", name);
|
||||
+ net.kyori.adventure.text.Component component = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(str, template);
|
||||
+ return io.papermc.paper.adventure.PaperAdventure.asVanilla(component);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public String getMsgId() {
|
||||
return this.type().msgId();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 36795968f4c296f680f79cc5a795391ae13c64e4..6951b47abb5d36cdd9fe200152a93155c31aedaf 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4047,6 +4047,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return SlotAccess.NULL;
|
||||
}
|
||||
|
||||
+ // Purpur Start
|
||||
+ public void sendMiniMessage(@Nullable String message) {
|
||||
+ if (message != null && !message.isEmpty()) {
|
||||
+ this.sendMessage(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void sendMessage(@Nullable net.kyori.adventure.text.Component message) {
|
||||
+ if (message != null) {
|
||||
+ this.sendSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void sendSystemMessage(Component message) {}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,288 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 23 May 2019 21:50:37 -0500
|
||||
Subject: [PATCH] Barrels and enderchests 6 rows
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 78636bf26ac8efaffd8a8f4b5bbc703d6b670b7c..42801a26b9d5f8af2d0ce1fef864bb031cfa8965 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1170,6 +1170,27 @@ public abstract class PlayerList {
|
||||
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
|
||||
this.server.getCommands().sendCommands(player);
|
||||
} // Paper
|
||||
+
|
||||
+ // Purpur start
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.enderChestSixRows && org.purpurmc.purpur.PurpurConfig.enderChestPermissionRows) {
|
||||
+ org.bukkit.craftbukkit.entity.CraftHumanEntity bukkit = player.getBukkitEntity();
|
||||
+ if (bukkit.hasPermission("purpur.enderchest.rows.six")) {
|
||||
+ player.sixRowEnderchestSlotCount = 54;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.five")) {
|
||||
+ player.sixRowEnderchestSlotCount = 45;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.four")) {
|
||||
+ player.sixRowEnderchestSlotCount = 36;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.three")) {
|
||||
+ player.sixRowEnderchestSlotCount = 27;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.two")) {
|
||||
+ player.sixRowEnderchestSlotCount = 18;
|
||||
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.one")) {
|
||||
+ player.sixRowEnderchestSlotCount = 9;
|
||||
+ }
|
||||
+ } else {
|
||||
+ player.sixRowEnderchestSlotCount = -1;
|
||||
+ }
|
||||
+ //Purpur end
|
||||
}
|
||||
|
||||
public boolean isWhiteListed(GameProfile profile) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index cf008b8c7a2eb0c642fd9c2da376df86dcd588e2..96726f06b83193fd7c5156efe6411b10eb1db435 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -187,6 +187,7 @@ public abstract class Player extends LivingEntity {
|
||||
public boolean affectsSpawning = true;
|
||||
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET;
|
||||
// Paper end
|
||||
+ public int sixRowEnderchestSlotCount = -1; // Purpur
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean fauxSleeping;
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/ChestMenu.java b/src/main/java/net/minecraft/world/inventory/ChestMenu.java
|
||||
index 0dbfd23bbfc6ad203f048142f8c90ef741849fe1..9a80427d2bb470b6b1638e59aba57216676dcbd2 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/ChestMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/ChestMenu.java
|
||||
@@ -67,10 +67,30 @@ public class ChestMenu extends AbstractContainerMenu {
|
||||
return new ChestMenu(MenuType.GENERIC_9x6, syncId, playerInventory, 6);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public static ChestMenu oneRow(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x1, syncId, playerInventory, inventory, 1);
|
||||
+ }
|
||||
+
|
||||
+ public static ChestMenu twoRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x2, syncId, playerInventory, inventory, 2);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public static ChestMenu threeRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
return new ChestMenu(MenuType.GENERIC_9x3, syncId, playerInventory, inventory, 3);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public static ChestMenu fourRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x4, syncId, playerInventory, inventory, 4);
|
||||
+ }
|
||||
+
|
||||
+ public static ChestMenu fiveRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
+ return new ChestMenu(MenuType.GENERIC_9x5, syncId, playerInventory, inventory, 5);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public static ChestMenu sixRows(int syncId, Inventory playerInventory, Container inventory) {
|
||||
return new ChestMenu(MenuType.GENERIC_9x6, syncId, playerInventory, inventory, 6);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/PlayerEnderChestContainer.java b/src/main/java/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
index 4703f23316f82a1a942907b46d2d6dcb7d70ec37..162798f57a05b78121fa6c4fadf5adee80fbe221 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
@@ -30,11 +30,18 @@ public class PlayerEnderChestContainer extends SimpleContainer {
|
||||
}
|
||||
|
||||
public PlayerEnderChestContainer(Player owner) {
|
||||
- super(27);
|
||||
+ super(org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? 54 : 27); // Purpur
|
||||
this.owner = owner;
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public int getContainerSize() {
|
||||
+ return owner.sixRowEnderchestSlotCount < 0 ? super.getContainerSize() : owner.sixRowEnderchestSlotCount;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public void setActiveChest(EnderChestBlockEntity blockEntity) {
|
||||
this.activeChest = blockEntity;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
index 7385e91f32f070e86a4e0fd3d214f55d832c7979..7b73de87236a60ce7343c29ec147e1866b448ba3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
|
||||
@@ -85,6 +85,34 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
||||
EnderChestBlockEntity enderChestBlockEntity = (EnderChestBlockEntity)blockEntity;
|
||||
playerEnderChestContainer.setActiveChest(enderChestBlockEntity);
|
||||
player.openMenu(new SimpleMenuProvider((syncId, inventory, playerx) -> {
|
||||
+ // Purpur start
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.enderChestSixRows) {
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.enderChestPermissionRows) {
|
||||
+ org.bukkit.craftbukkit.entity.CraftHumanEntity bukkitPlayer = player.getBukkitEntity();
|
||||
+ if (bukkitPlayer.hasPermission("purpur.enderchest.rows.six")) {
|
||||
+ player.sixRowEnderchestSlotCount = 54;
|
||||
+ return ChestMenu.sixRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.five")) {
|
||||
+ player.sixRowEnderchestSlotCount = 45;
|
||||
+ return ChestMenu.fiveRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.four")) {
|
||||
+ player.sixRowEnderchestSlotCount = 36;
|
||||
+ return ChestMenu.fourRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.three")) {
|
||||
+ player.sixRowEnderchestSlotCount = 27;
|
||||
+ return ChestMenu.threeRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.two")) {
|
||||
+ player.sixRowEnderchestSlotCount = 18;
|
||||
+ return ChestMenu.twoRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ } else if (bukkitPlayer.hasPermission("purpur.enderchest.rows.one")) {
|
||||
+ player.sixRowEnderchestSlotCount = 9;
|
||||
+ return ChestMenu.oneRow(syncId, inventory, playerEnderChestContainer);
|
||||
+ }
|
||||
+ }
|
||||
+ player.sixRowEnderchestSlotCount = -1;
|
||||
+ return ChestMenu.sixRows(syncId, inventory, playerEnderChestContainer);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
return ChestMenu.threeRows(syncId, inventory, playerEnderChestContainer);
|
||||
}, CONTAINER_TITLE));
|
||||
player.awardStat(Stats.OPEN_ENDERCHEST);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
index 416aa989ebb18a8741cc9d605a1180ab830f6643..e38a0adf5463c48311ad08b8d2e5b5c2d989a3b5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
@@ -67,7 +67,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
|
||||
public BarrelBlockEntity(BlockPos pos, BlockState state) {
|
||||
super(BlockEntityType.BARREL, pos, state);
|
||||
- this.items = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
+ // Purpur start
|
||||
+ this.items = NonNullList.withSize(switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> 54;
|
||||
+ case 5 -> 45;
|
||||
+ case 4 -> 36;
|
||||
+ case 2 -> 18;
|
||||
+ case 1 -> 9;
|
||||
+ default -> 27;
|
||||
+ }, ItemStack.EMPTY);
|
||||
+ // Purpur end
|
||||
this.openersCounter = new ContainerOpenersCounter() {
|
||||
@Override
|
||||
protected void onOpen(Level world, BlockPos pos, BlockState state) {
|
||||
@@ -118,7 +127,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
|
||||
@Override
|
||||
public int getContainerSize() {
|
||||
- return 27;
|
||||
+ // Purpur start
|
||||
+ return switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> 54;
|
||||
+ case 5 -> 45;
|
||||
+ case 4 -> 36;
|
||||
+ case 2 -> 18;
|
||||
+ case 1 -> 9;
|
||||
+ default -> 27;
|
||||
+ };
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,7 +156,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
|
||||
@Override
|
||||
protected AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) {
|
||||
- return ChestMenu.threeRows(syncId, playerInventory, this);
|
||||
+ // Purpur start
|
||||
+ return switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> ChestMenu.sixRows(syncId, playerInventory, this);
|
||||
+ case 5 -> ChestMenu.fiveRows(syncId, playerInventory, this);
|
||||
+ case 4 -> ChestMenu.fourRows(syncId, playerInventory, this);
|
||||
+ case 2 -> ChestMenu.twoRows(syncId, playerInventory, this);
|
||||
+ case 1 -> ChestMenu.oneRow(syncId, playerInventory, this);
|
||||
+ default -> ChestMenu.threeRows(syncId, playerInventory, this);
|
||||
+ };
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
index 633e6f4922ccaf59979a22885162f42c65bf628a..15001e7c8eae3a89f9d8669be532d56b70d538ef 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
@@ -181,8 +181,19 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
case PLAYER:
|
||||
case CHEST:
|
||||
case ENDER_CHEST:
|
||||
+ // Purpur start
|
||||
+ this.delegate = new ChestMenu(org.purpurmc.purpur.PurpurConfig.enderChestSixRows ? MenuType.GENERIC_9x6 : MenuType.GENERIC_9x3, windowId, bottom, top, top.getContainerSize() / 9);
|
||||
+ break;
|
||||
case BARREL:
|
||||
- this.delegate = new ChestMenu(MenuType.GENERIC_9x3, windowId, bottom, top, top.getContainerSize() / 9);
|
||||
+ this.delegate = new ChestMenu(switch (org.purpurmc.purpur.PurpurConfig.barrelRows) {
|
||||
+ case 6 -> MenuType.GENERIC_9x6;
|
||||
+ case 5 -> MenuType.GENERIC_9x5;
|
||||
+ case 4 -> MenuType.GENERIC_9x4;
|
||||
+ case 2 -> MenuType.GENERIC_9x2;
|
||||
+ case 1 -> MenuType.GENERIC_9x1;
|
||||
+ default -> MenuType.GENERIC_9x3;
|
||||
+ }, windowId, bottom, top, top.getContainerSize() / 9);
|
||||
+ // Purpur end
|
||||
break;
|
||||
case DISPENSER:
|
||||
case DROPPER:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
index 471ae4458e7ea7c29d7551b32cec98180fbccd4e..23db63c78e9fcf86cd498b3ed36ca50253c2fe97 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
@@ -83,7 +83,7 @@ public class CraftInventory implements Inventory {
|
||||
|
||||
@Override
|
||||
public void setContents(ItemStack[] items) {
|
||||
- Preconditions.checkArgument(items.length <= this.getSize(), "Invalid inventory size (%s); expected %s or less", items.length, this.getSize());
|
||||
+ // Preconditions.checkArgument(items.length <= this.getSize(), "Invalid inventory size (%s); expected %s or less", items.length, this.getSize()); // Purpur
|
||||
|
||||
for (int i = 0; i < this.getSize(); i++) {
|
||||
if (i >= items.length) {
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 8ad548fc059568d37675e017548b171d4dd1d555..7937023274acf3a1efdd21bbdd2f933f4399baeb 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -177,4 +177,39 @@ public class PurpurConfig {
|
||||
private static void messages() {
|
||||
cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
|
||||
}
|
||||
+
|
||||
+ public static int barrelRows = 3;
|
||||
+ public static boolean enderChestSixRows = false;
|
||||
+ public static boolean enderChestPermissionRows = false;
|
||||
+ private static void blockSettings() {
|
||||
+ if (version < 3) {
|
||||
+ boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
+ set("settings.blocks.barrel.six-rows", oldValue);
|
||||
+ set("settings.packed-barrels", null);
|
||||
+ oldValue = getBoolean("settings.large-ender-chests", true);
|
||||
+ set("settings.blocks.ender_chest.six-rows", oldValue);
|
||||
+ set("settings.large-ender-chests", null);
|
||||
+ }
|
||||
+ if (version < 20) {
|
||||
+ boolean oldValue = getBoolean("settings.blocks.barrel.six-rows", false);
|
||||
+ set("settings.blocks.barrel.rows", oldValue ? 6 : 3);
|
||||
+ set("settings.blocks.barrel.six-rows", null);
|
||||
+ }
|
||||
+ barrelRows = getInt("settings.blocks.barrel.rows", barrelRows);
|
||||
+ if (barrelRows < 1 || barrelRows > 6) {
|
||||
+ Bukkit.getLogger().severe("settings.blocks.barrel.rows must be 1-6, resetting to default");
|
||||
+ barrelRows = 3;
|
||||
+ }
|
||||
+ org.bukkit.event.inventory.InventoryType.BARREL.setDefaultSize(switch (barrelRows) {
|
||||
+ case 6 -> 54;
|
||||
+ case 5 -> 45;
|
||||
+ case 4 -> 36;
|
||||
+ case 2 -> 18;
|
||||
+ case 1 -> 9;
|
||||
+ default -> 27;
|
||||
+ });
|
||||
+ enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
|
||||
+ org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
+ enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
+ }
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 22:50:12 -0500
|
||||
Subject: [PATCH] Llama API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java
|
||||
index 21725aee29e9120d1c7e1e19f91c21a73a28844f..849f0c7c6d13df00d90211a48d8b56ab156812b8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java
|
||||
@@ -22,6 +22,7 @@ public class LlamaFollowCaravanGoal extends Goal {
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
+ if (!this.llama.shouldJoinCaravan) return false; // Purpur
|
||||
if (!this.llama.isLeashed() && !this.llama.inCaravan()) {
|
||||
List<Entity> list = this.llama.level().getEntities(this.llama, this.llama.getBoundingBox().inflate(9.0D, 4.0D, 9.0D), (entity) -> {
|
||||
EntityType<?> entityType = entity.getType();
|
||||
@@ -71,6 +72,7 @@ public class LlamaFollowCaravanGoal extends Goal {
|
||||
|
||||
@Override
|
||||
public boolean canContinueToUse() {
|
||||
+ if (!this.llama.shouldJoinCaravan) return false; // Purpur
|
||||
if (this.llama.inCaravan() && this.llama.getCaravanHead().isAlive() && this.firstIsLeashed(this.llama, 0)) {
|
||||
double d = this.llama.distanceToSqr(this.llama.getCaravanHead());
|
||||
if (d > 676.0D) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
|
||||
index 967d1ff37ecc9a2cf81a1a6be8ceeb96b42ff847..72fe2dd69a9ae51e14ec91a83eac2dd74bd76cca 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
|
||||
@@ -73,6 +73,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
|
||||
private Llama caravanHead;
|
||||
@Nullable
|
||||
public Llama caravanTail; // Paper
|
||||
+ public boolean shouldJoinCaravan = true; // Purpur
|
||||
|
||||
public Llama(EntityType<? extends Llama> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -168,7 +169,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
|
||||
if (!this.inventory.getItem(1).isEmpty()) {
|
||||
nbt.put("DecorItem", this.inventory.getItem(1).save(new CompoundTag()));
|
||||
}
|
||||
-
|
||||
+ nbt.putBoolean("Purpur.ShouldJoinCaravan", shouldJoinCaravan); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -179,7 +180,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
|
||||
if (nbt.contains("DecorItem", 10)) {
|
||||
this.inventory.setItem(1, ItemStack.of(nbt.getCompound("DecorItem")));
|
||||
}
|
||||
-
|
||||
+ if (nbt.contains("Purpur.ShouldJoinCaravan")) this.shouldJoinCaravan = nbt.getBoolean("Purpur.ShouldJoinCaravan"); // Purpur
|
||||
this.updateContainerEquipment();
|
||||
}
|
||||
|
||||
@@ -520,6 +521,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
|
||||
|
||||
public void leaveCaravan() {
|
||||
if (this.caravanHead != null) {
|
||||
+ new org.purpurmc.purpur.event.entity.LlamaLeaveCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity()).callEvent(); // Purpur
|
||||
this.caravanHead.caravanTail = null;
|
||||
}
|
||||
|
||||
@@ -527,6 +529,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
|
||||
}
|
||||
|
||||
public void joinCaravan(Llama llama) {
|
||||
+ if (!shouldJoinCaravan || !new org.purpurmc.purpur.event.entity.LlamaJoinCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity(), (org.bukkit.entity.Llama) llama.getBukkitEntity()).callEvent()) return; // Purpur
|
||||
this.caravanHead = llama;
|
||||
this.caravanHead.caravanTail = this;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
||||
index 0ad16ee7b33582d214dab41eeee378d52c8e38ed..16bd1294c219f15ada653ef810bc2d748222d0da 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
||||
@@ -90,4 +90,16 @@ public class CraftLlama extends CraftChestedHorse implements Llama, com.destroys
|
||||
return this.getHandle().caravanTail == null ? null : (Llama) this.getHandle().caravanTail.getBukkitEntity();
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean shouldJoinCaravan() {
|
||||
+ return getHandle().shouldJoinCaravan;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setShouldJoinCaravan(boolean shouldJoinCaravan) {
|
||||
+ getHandle().shouldJoinCaravan = shouldJoinCaravan;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,331 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 8 Aug 2019 15:29:15 -0500
|
||||
Subject: [PATCH] AFK API
|
||||
|
||||
Adds the option for display names to be used in the afk broadcast
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 33d13eaa0edef9e1e6652affbc8e04fa51c31df1..f9571a379214d24a24e0b6b6277636666c1661f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2122,8 +2122,68 @@ public class ServerPlayer extends Player {
|
||||
|
||||
public void resetLastActionTime() {
|
||||
this.lastActionTime = Util.getMillis();
|
||||
+ this.setAfk(false); // Purpur
|
||||
}
|
||||
|
||||
+ // Purpur Start
|
||||
+ private boolean isAfk = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public void setAfk(boolean afk) {
|
||||
+ if (this.isAfk == afk) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ String msg = afk ? org.purpurmc.purpur.PurpurConfig.afkBroadcastAway : org.purpurmc.purpur.PurpurConfig.afkBroadcastBack;
|
||||
+
|
||||
+ org.purpurmc.purpur.event.PlayerAFKEvent event = new org.purpurmc.purpur.event.PlayerAFKEvent(this.getBukkitEntity(), afk, this.level().purpurConfig.idleTimeoutKick, msg, !Bukkit.isPrimaryThread());
|
||||
+ if (!event.callEvent() || event.shouldKick()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ this.isAfk = afk;
|
||||
+
|
||||
+ if (!afk) {
|
||||
+ resetLastActionTime();
|
||||
+ }
|
||||
+
|
||||
+ msg = event.getBroadcastMsg();
|
||||
+ if (msg != null && !msg.isEmpty()) {
|
||||
+ String playerName = this.getGameProfile().getName();
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.afkBroadcastUseDisplayName) {
|
||||
+ net.kyori.adventure.text.Component playerDisplayNameComponent = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(this.getBukkitEntity().getDisplayName());
|
||||
+ playerName = net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer.plainText().serialize(playerDisplayNameComponent);
|
||||
+ }
|
||||
+ server.getPlayerList().broadcastMiniMessage(String.format(msg, playerName), false);
|
||||
+ }
|
||||
+
|
||||
+ if (this.level().purpurConfig.idleTimeoutUpdateTabList) {
|
||||
+ String scoreboardName = getScoreboardName();
|
||||
+ String playerListName = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().serialize(getBukkitEntity().playerListName());
|
||||
+ String[] split = playerListName.split(scoreboardName);
|
||||
+ String prefix = (split.length > 0 ? split[0] : "").replace(org.purpurmc.purpur.PurpurConfig.afkTabListPrefix, "");
|
||||
+ String suffix = (split.length > 1 ? split[1] : "").replace(org.purpurmc.purpur.PurpurConfig.afkTabListSuffix, "");
|
||||
+ if (afk) {
|
||||
+ getBukkitEntity().setPlayerListName(org.purpurmc.purpur.PurpurConfig.afkTabListPrefix + prefix + scoreboardName + suffix + org.purpurmc.purpur.PurpurConfig.afkTabListSuffix, true);
|
||||
+ } else {
|
||||
+ getBukkitEntity().setPlayerListName(prefix + scoreboardName + suffix);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ((ServerLevel) this.level()).updateSleepingPlayerList();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isAfk() {
|
||||
+ return this.isAfk;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canBeCollidedWith() {
|
||||
+ return !this.isAfk() && super.canBeCollidedWith();
|
||||
+ }
|
||||
+ // Purpur End
|
||||
+
|
||||
public ServerStatsCounter getStats() {
|
||||
return this.stats;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index e936fa6e638a7ff4b087ecb4247c467be6fe9c57..f23e8f89e09551d245fcef5507ecd061ed1b3ca9 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -342,6 +342,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
private boolean justTeleported = false;
|
||||
private boolean hasMoved; // Spigot
|
||||
|
||||
+ // Purpur start
|
||||
+ private final com.google.common.cache.LoadingCache<CraftPlayer, Boolean> kickPermissionCache = com.google.common.cache.CacheBuilder.newBuilder()
|
||||
+ .maximumSize(1000)
|
||||
+ .expireAfterWrite(1, java.util.concurrent.TimeUnit.MINUTES)
|
||||
+ .build(
|
||||
+ new com.google.common.cache.CacheLoader<>() {
|
||||
+ @Override
|
||||
+ public Boolean load(CraftPlayer player) {
|
||||
+ return player.hasPermission("purpur.bypassIdleKick");
|
||||
+ }
|
||||
+ }
|
||||
+ );
|
||||
+ // Purpur end
|
||||
+
|
||||
public CraftPlayer getCraftPlayer() {
|
||||
return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
|
||||
}
|
||||
@@ -435,6 +449,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
|
||||
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits.
|
||||
+ // Purpur start
|
||||
+ this.player.setAfk(true);
|
||||
+ if (!this.player.level().purpurConfig.idleTimeoutKick || (!Boolean.parseBoolean(System.getenv("PURPUR_FORCE_IDLE_KICK")) && kickPermissionCache.getUnchecked(this.player.getBukkitEntity()))) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
|
||||
}
|
||||
@@ -753,6 +773,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur
|
||||
+
|
||||
// Skip the first time we do this
|
||||
if (true) { // Spigot - don't skip any move events
|
||||
Location oldTo = to.clone();
|
||||
@@ -1582,7 +1604,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
if (!event.isAllowed()) {
|
||||
flag2 = true; // Paper - diff on change, this should be moved wrongly
|
||||
if (event.getLogWarning())
|
||||
- ServerGamePacketListenerImpl.LOGGER.warn("{} moved wrongly!", this.player.getName().getString());
|
||||
+ ServerGamePacketListenerImpl.LOGGER.warn("{} moved wrongly!, ({})", this.player.getName().getString(), d11); // Purpur
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
@@ -1644,6 +1666,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur
|
||||
+
|
||||
// Skip the first time we do this
|
||||
if (from.getX() != Double.MAX_VALUE) {
|
||||
Location oldTo = to.clone();
|
||||
diff --git a/src/main/java/net/minecraft/server/players/SleepStatus.java b/src/main/java/net/minecraft/server/players/SleepStatus.java
|
||||
index 823efad652d8ff9e96b99375b102fef6f017716e..caa8a69bde0c212c36dd990a67836ac2f95548c0 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/SleepStatus.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/SleepStatus.java
|
||||
@@ -19,7 +19,7 @@ public class SleepStatus {
|
||||
|
||||
public boolean areEnoughDeepSleeping(int percentage, List<ServerPlayer> players) {
|
||||
// CraftBukkit start
|
||||
- int j = (int) players.stream().filter((eh) -> { return eh.isSleepingLongEnough() || eh.fauxSleeping; }).count();
|
||||
+ int j = (int) players.stream().filter((eh) -> { return eh.isSleepingLongEnough() || eh.fauxSleeping || (eh.level().purpurConfig.idleTimeoutCountAsSleeping && eh.isAfk()); }).count(); // Purpur
|
||||
boolean anyDeepSleep = players.stream().anyMatch(Player::isSleepingLongEnough);
|
||||
|
||||
return anyDeepSleep && j >= this.sleepersNeeded(percentage);
|
||||
@@ -52,7 +52,7 @@ public class SleepStatus {
|
||||
|
||||
if (!entityplayer.isSpectator()) {
|
||||
++this.activePlayers;
|
||||
- if (entityplayer.isSleeping() || entityplayer.fauxSleeping) { // CraftBukkit
|
||||
+ if ((entityplayer.isSleeping() || entityplayer.fauxSleeping) || (entityplayer.level().purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk())) { // CraftBukkit // Purpur
|
||||
++this.sleepingPlayers;
|
||||
}
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
||||
index 3ff999734d14e2b6e7828e117f5ee32a60c26bc1..cfa9607241c3e69777ffc317206996c2f783437a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
||||
@@ -39,6 +39,7 @@ public final class EntitySelector {
|
||||
return net.minecraft.util.Mth.clamp(serverPlayer.getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= playerInsomniaTicks;
|
||||
};
|
||||
// Paper end
|
||||
+ public static Predicate<Player> notAfk = (player) -> !player.isAfk(); // Purpur
|
||||
|
||||
private EntitySelector() {}
|
||||
// Paper start
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
index d25307ae8bbdf10ae067ec70fc2cb957b852a0eb..54bdb81785b617e13e67530752395f2a0c6d703a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
@@ -64,6 +64,10 @@ public class TargetingConditions {
|
||||
return false;
|
||||
} else if (this.selector != null && !this.selector.test(targetEntity)) {
|
||||
return false;
|
||||
+ // Purpur start
|
||||
+ } else if (!targetEntity.level().purpurConfig.idleTimeoutTargetPlayer && targetEntity instanceof net.minecraft.server.level.ServerPlayer player && player.isAfk()) {
|
||||
+ return false;
|
||||
+ // Purpur end
|
||||
} else {
|
||||
if (baseEntity == null) {
|
||||
if (this.isCombat && (!targetEntity.canBeSeenAsEnemy() || targetEntity.level().getDifficulty() == Difficulty.PEACEFUL)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 96726f06b83193fd7c5156efe6411b10eb1db435..7b39cb5346925c14f3f144d622ca7e5855420aa6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -193,6 +193,13 @@ public abstract class Player extends LivingEntity {
|
||||
public boolean fauxSleeping;
|
||||
public int oldLevel = -1;
|
||||
|
||||
+ public void setAfk(boolean afk) {
|
||||
+ }
|
||||
+
|
||||
+ public boolean isAfk() {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public CraftHumanEntity getBukkitEntity() {
|
||||
return (CraftHumanEntity) super.getBukkitEntity();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||
index 3b959f42d958bf0f426853aee56753d6c455fcdb..d17abb283ea818244df0379d6b57fc634071e0b9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||
@@ -154,7 +154,7 @@ public interface EntityGetter {
|
||||
|
||||
default boolean hasNearbyAlivePlayer(double x, double y, double z, double range) {
|
||||
for(Player player : this.players()) {
|
||||
- if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) {
|
||||
+ if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player) && EntitySelector.notAfk.test(player)) {
|
||||
double d = player.distanceToSqr(x, y, z);
|
||||
if (range < 0.0D || d < range * range) {
|
||||
return true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 7f7375c0a3e680ef60fb9fc6157b72bb0812d1c3..d0986b7b130f790c21d2324d0014d258bc36c527 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -517,10 +517,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public void setPlayerListName(String name) {
|
||||
+ // Purpur start
|
||||
+ setPlayerListName(name, false);
|
||||
+ }
|
||||
+ public void setPlayerListName(String name, boolean useMM) {
|
||||
+ // Purpur end
|
||||
if (name == null) {
|
||||
name = getName();
|
||||
}
|
||||
- this.getHandle().listName = name.equals(getName()) ? null : CraftChatMessage.fromStringOrNull(name);
|
||||
+ this.getHandle().listName = name.equals(getName()) ? null : useMM ? io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(name)) : CraftChatMessage.fromStringOrNull(name); // Purpur
|
||||
for (ServerPlayer player : (List<ServerPlayer>) server.getHandle().players) {
|
||||
if (player.getBukkitEntity().canSee(this)) {
|
||||
player.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME, this.getHandle()));
|
||||
@@ -3273,5 +3278,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public boolean usesPurpurClient() {
|
||||
return getHandle().purpurClient;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isAfk() {
|
||||
+ return getHandle().isAfk();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setAfk(boolean setAfk) {
|
||||
+ getHandle().setAfk(setAfk);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void resetIdleTimer() {
|
||||
+ getHandle().resetLastActionTime();
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 7937023274acf3a1efdd21bbdd2f933f4399baeb..3fba9f640ef03219c89a2a405e4d5a5870e366bf 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -174,8 +174,18 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static String cannotRideMob = "<red>You cannot mount that mob";
|
||||
+ public static String afkBroadcastAway = "<yellow><italic>%s is now AFK";
|
||||
+ public static String afkBroadcastBack = "<yellow><italic>%s is no longer AFK";
|
||||
+ public static boolean afkBroadcastUseDisplayName = false;
|
||||
+ public static String afkTabListPrefix = "[AFK] ";
|
||||
+ public static String afkTabListSuffix = "";
|
||||
private static void messages() {
|
||||
cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
|
||||
+ afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
|
||||
+ afkBroadcastBack = getString("settings.messages.afk-broadcast-back", afkBroadcastBack);
|
||||
+ afkBroadcastUseDisplayName = getBoolean("settings.messages.afk-broadcast-use-display-name", afkBroadcastUseDisplayName);
|
||||
+ afkTabListPrefix = MiniMessage.miniMessage().serialize(MiniMessage.miniMessage().deserialize(getString("settings.messages.afk-tab-list-prefix", afkTabListPrefix)));
|
||||
+ afkTabListSuffix = MiniMessage.miniMessage().serialize(MiniMessage.miniMessage().deserialize(getString("settings.messages.afk-tab-list-suffix", afkTabListSuffix)));
|
||||
}
|
||||
|
||||
public static int barrelRows = 3;
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 27ce55687c7c59fdfdcc4553240ea8b023919b77..3ed1a91c93f659306acaf8bad6820f49208554c8 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -90,6 +90,24 @@ public class PurpurWorldConfig {
|
||||
return value.isEmpty() ? fallback : value;
|
||||
}
|
||||
|
||||
+ public boolean idleTimeoutKick = true;
|
||||
+ public boolean idleTimeoutTickNearbyEntities = true;
|
||||
+ public boolean idleTimeoutCountAsSleeping = false;
|
||||
+ public boolean idleTimeoutUpdateTabList = false;
|
||||
+ public boolean idleTimeoutTargetPlayer = true;
|
||||
+ private void playerSettings() {
|
||||
+ if (PurpurConfig.version < 19) {
|
||||
+ boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
||||
+ set("gameplay-mechanics.player.idle-timeout.mods-target", null);
|
||||
+ set("gameplay-mechanics.player.idle-timeout.mobs-target", oldVal);
|
||||
+ }
|
||||
+ idleTimeoutKick = System.getenv("PURPUR_FORCE_IDLE_KICK") == null ? getBoolean("gameplay-mechanics.player.idle-timeout.kick-if-idle", idleTimeoutKick) : Boolean.parseBoolean(System.getenv("PURPUR_FORCE_IDLE_KICK"));
|
||||
+ idleTimeoutTickNearbyEntities = getBoolean("gameplay-mechanics.player.idle-timeout.tick-nearby-entities", idleTimeoutTickNearbyEntities);
|
||||
+ idleTimeoutCountAsSleeping = getBoolean("gameplay-mechanics.player.idle-timeout.count-as-sleeping", idleTimeoutCountAsSleeping);
|
||||
+ idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
|
||||
+ idleTimeoutTargetPlayer = getBoolean("gameplay-mechanics.player.idle-timeout.mobs-target", idleTimeoutTargetPlayer);
|
||||
+ }
|
||||
+
|
||||
public boolean babiesAreRidable = true;
|
||||
public boolean untamedTamablesAreRidable = true;
|
||||
public boolean useNightVisionWhenRiding = false;
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 68557964e27fa1e5ba218178f9bcc0b28e3a78d9..12adaba78ec30e463963f99c0d78e844756143a1 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -203,6 +203,7 @@ public class ActivationRange
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if (!player.level().purpurConfig.idleTimeoutTickNearbyEntities && player.isAfk()) continue; // Purpur
|
||||
// Paper start
|
||||
int worldHeight = world.getHeight();
|
||||
ActivationRange.maxBB = player.getBoundingBox().inflate( maxRange, worldHeight, maxRange );
|
||||
@@ -1,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 26 May 2019 15:19:14 -0500
|
||||
Subject: [PATCH] Bring back server name
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
index 818289e831e3dad29345c43265e2efd7689bc500..1ea3012995c738c67b31e997c138f824f9e69ba1 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -58,6 +58,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
public final boolean onlineMode = this.get("online-mode", true);
|
||||
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
|
||||
public final String serverIp = this.get("server-ip", "");
|
||||
+ public final String serverName = this.get("server-name", "Unknown Server"); // Purpur
|
||||
public final boolean spawnAnimals = this.get("spawn-animals", true);
|
||||
public final boolean spawnNpcs = this.get("spawn-npcs", true);
|
||||
public final boolean pvp = this.get("pvp", true);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index a78cf70e754ec35366fc269cca8e2deda14635b0..5acff437226157b851ad4231d0a6e7344da8a1ea 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -3165,4 +3165,11 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public String getServerName() {
|
||||
+ return this.getProperties().serverName;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 21 Mar 2020 11:47:39 -0500
|
||||
Subject: [PATCH] Configurable server mod name
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index da825e7667032cb656585367bf4b96bc18f57aa6..80c085498d9b61bae2e06df873c1ad66cc7d8ae5 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1696,7 +1696,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
- return "Purpur"; // Purpur - Purpur > // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return org.purpurmc.purpur.PurpurConfig.serverModName; // Purpur - Purpur > // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
}
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport details) {
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 6b768cff1318b4bcebeed95345f3cfdce05a2c16..3d72f71c851e2d46e9cbeab9cdbadc532cb90eb2 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -188,6 +188,11 @@ public class PurpurConfig {
|
||||
afkTabListSuffix = MiniMessage.miniMessage().serialize(MiniMessage.miniMessage().deserialize(getString("settings.messages.afk-tab-list-suffix", afkTabListSuffix)));
|
||||
}
|
||||
|
||||
+ public static String serverModName = "Purpur";
|
||||
+ private static void serverModName() {
|
||||
+ serverModName = getString("settings.server-mod-name", serverModName);
|
||||
+ }
|
||||
+
|
||||
public static int barrelRows = 3;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
@@ -1,91 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 5 May 2019 12:58:45 -0500
|
||||
Subject: [PATCH] LivingEntity safeFallDistance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 0d07e666f4da002a353d03844d62a0e3aac44d9d..92745269118d8a0cb91cbbebdd7700f7737d2b9a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -253,6 +253,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
private boolean skipDropExperience;
|
||||
// CraftBukkit start
|
||||
public int expToDrop;
|
||||
+ public float safeFallDistance = 3.0F; // Purpur
|
||||
public boolean forceDrops;
|
||||
public ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||
@@ -353,7 +354,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.tryAddSoulSpeed();
|
||||
}
|
||||
|
||||
- if (!this.level().isClientSide && this.fallDistance > 3.0F && onGround && !state.isAir()) {
|
||||
+ if (!this.level().isClientSide && this.fallDistance > this.safeFallDistance && onGround && !state.isAir()) { // Purpur
|
||||
double d1 = this.getX();
|
||||
double d2 = this.getY();
|
||||
double d3 = this.getZ();
|
||||
@@ -368,7 +369,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
d3 = (double) landedPosition.getZ() + 0.5D + d5 / d6 * 0.5D;
|
||||
}
|
||||
|
||||
- float f = (float) Mth.ceil(this.fallDistance - 3.0F);
|
||||
+ float f = (float) Mth.ceil(this.fallDistance - this.safeFallDistance); // Purpur
|
||||
double d7 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||
int i = (int) (150.0D * d7);
|
||||
|
||||
@@ -2054,7 +2055,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
MobEffectInstance mobeffect = this.getEffect(MobEffects.JUMP);
|
||||
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
|
||||
|
||||
- return Mth.ceil((fallDistance - 3.0F - f2) * damageMultiplier);
|
||||
+ return Mth.ceil((fallDistance - this.safeFallDistance - f2) * damageMultiplier); // Purpur
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
index 296cc895fbd090b4d43807f4ca393f6dd853e0ce..8400f02a37bdef4a9f92879a6b186ebe1f2f145e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
@@ -384,7 +384,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
||||
|
||||
@Override
|
||||
protected int calculateFallDamage(float fallDistance, float damageMultiplier) {
|
||||
- return Mth.ceil((fallDistance * 0.5F - 3.0F) * damageMultiplier);
|
||||
+ return Mth.ceil((fallDistance * 0.5F - this.safeFallDistance) * damageMultiplier);
|
||||
}
|
||||
|
||||
protected int getInventorySize() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Giant.java b/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||
index 3f7d21a5be726d301e1bcaa11f1788b51c23a7cd..db95323da1aef267aa4fbe56aaff63cb8684e15b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.world.level.LevelReader;
|
||||
public class Giant extends Monster {
|
||||
public Giant(EntityType<? extends Giant> type, Level world) {
|
||||
super(type, world);
|
||||
+ this.safeFallDistance = 10.0F; // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 7bc8b62ff6aa355f3f025fc6c3a3d4c6b355853b..f7ae6d11c6043a2037dbfd160b409579bd9a35fd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1094,4 +1094,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
getHandle().knockback(strength, directionX, directionZ);
|
||||
};
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public float getSafeFallDistance() {
|
||||
+ return getHandle().safeFallDistance;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setSafeFallDistance(float safeFallDistance) {
|
||||
+ getHandle().safeFallDistance = safeFallDistance;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 23 Jul 2019 10:07:16 -0500
|
||||
Subject: [PATCH] Lagging threshold
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index a8ce4fd1a94ad4cc3bc189625851d34a47f42167..54f3c35ad02a09865c1bce38e9405dad048142b3 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -307,6 +307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Spigot end
|
||||
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
|
||||
public static long currentTickLong = 0L; // Paper
|
||||
+ public boolean lagging = false; // Purpur
|
||||
|
||||
public volatile Thread shutdownThread; // Paper
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
@@ -1156,6 +1157,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.recentTps[1] = tps5.getAverage();
|
||||
this.recentTps[2] = tps15.getAverage();
|
||||
// Paper end
|
||||
+ lagging = recentTps[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur
|
||||
tickSection = curTime;
|
||||
}
|
||||
// Spigot end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5acff437226157b851ad4231d0a6e7344da8a1ea..9048d5b642bc25d433e8a6a6a8e0287d693e1d94 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -3171,5 +3171,10 @@ public final class CraftServer implements Server {
|
||||
public String getServerName() {
|
||||
return this.getProperties().serverName;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLagging() {
|
||||
+ return getServer().lagging;
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index bb7acf61cf2928181d014a17166d4d1414218e01..34afed28faeb56352b48faf8078a5fb07912eb5e 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -193,6 +193,11 @@ public class PurpurConfig {
|
||||
serverModName = getString("settings.server-mod-name", serverModName);
|
||||
}
|
||||
|
||||
+ public static double laggingThreshold = 19.0D;
|
||||
+ private static void tickLoopSettings() {
|
||||
+ laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
+ }
|
||||
+
|
||||
public static int barrelRows = 3;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
@@ -1,64 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 18:21:00 -0500
|
||||
Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index aa5cec6d56d7a8e80861aa4c9b4a74ca3e64be8c..08beb4c4dfcb0986cdebb4d0cacc25e4e9c17674 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -315,6 +315,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
return (EntityType) Registry.register(BuiltInRegistries.ENTITY_TYPE, id, (EntityType<T>) type.build(id)); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public static EntityType<?> getFromBukkitType(org.bukkit.entity.EntityType bukkitType) {
|
||||
+ return getFromKey(new ResourceLocation(bukkitType.getKey().toString()));
|
||||
+ }
|
||||
+
|
||||
+ public static EntityType<?> getFromKey(ResourceLocation location) {
|
||||
+ return BuiltInRegistries.ENTITY_TYPE.get(location);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public static ResourceLocation getKey(EntityType<?> type) {
|
||||
return BuiltInRegistries.ENTITY_TYPE.getKey(type);
|
||||
}
|
||||
@@ -530,6 +540,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
return this.category;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public String getName() {
|
||||
+ return BuiltInRegistries.ENTITY_TYPE.getKey(this).getPath();
|
||||
+ }
|
||||
+
|
||||
+ public String getTranslatedName() {
|
||||
+ return getDescription().getString();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public String getDescriptionId() {
|
||||
if (this.descriptionId == null) {
|
||||
this.descriptionId = Util.makeDescriptionId("entity", BuiltInRegistries.ENTITY_TYPE.getKey(this));
|
||||
diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
index 741719301e6fc91a598e74342810c4185e6fde26..6fbff9c02fbabf03c9c649a9ea6128021081f9cd 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
@@ -68,6 +68,15 @@ public class SpawnEggItem extends Item {
|
||||
SpawnerBlockEntity tileentitymobspawner = (SpawnerBlockEntity) tileentity;
|
||||
EntityType<?> entitytypes = this.getType(itemstack.getTag());
|
||||
|
||||
+ // Purpur start
|
||||
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.CreatureSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(entitytypes.getName()));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
+ entitytypes = EntityType.getFromBukkitType(event.getEntityType());
|
||||
+ // Purpur end
|
||||
+
|
||||
tileentitymobspawner.setEntityId(entitytypes, world.getRandom());
|
||||
tileentity.setChanged();
|
||||
world.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|
||||
@@ -1,169 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 2 May 2020 20:55:44 -0500
|
||||
Subject: [PATCH] Player invulnerabilities
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index f9571a379214d24a24e0b6b6277636666c1661f1..ffc10f3cb841eafbf90b7f26b485991ced31d4d1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -279,6 +279,7 @@ public class ServerPlayer extends Player {
|
||||
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
|
||||
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event
|
||||
public boolean purpurClient = false; // Purpur
|
||||
+ public boolean acceptingResourcePack = false; // Purpur
|
||||
|
||||
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
|
||||
public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
@@ -419,6 +420,7 @@ public class ServerPlayer extends Player {
|
||||
this.bukkitPickUpLoot = true;
|
||||
this.maxHealthCache = this.getMaxHealth();
|
||||
this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
|
||||
+ this.spawnInvulnerableTime = world.purpurConfig.playerSpawnInvulnerableTicks; // Purpur
|
||||
}
|
||||
|
||||
// Yes, this doesn't match Vanilla, but it's the best we can do for now.
|
||||
@@ -1100,6 +1102,12 @@ public class ServerPlayer extends Player {
|
||||
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public boolean isSpawnInvulnerable() {
|
||||
+ return spawnInvulnerableTime > 0 || frozen;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public boolean hurt(DamageSource source, float amount) {
|
||||
if (this.isInvulnerableTo(source)) {
|
||||
@@ -1107,7 +1115,7 @@ public class ServerPlayer extends Player {
|
||||
} else {
|
||||
boolean flag = this.server.isDedicatedServer() && this.isPvpAllowed() && source.is(DamageTypeTags.IS_FALL);
|
||||
|
||||
- if (!flag && this.spawnInvulnerableTime > 0 && !source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) {
|
||||
+ if (!flag && isSpawnInvulnerable() && !source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { // Purpur
|
||||
return false;
|
||||
} else {
|
||||
Entity entity = source.getEntity();
|
||||
@@ -1286,6 +1294,7 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ this.spawnInvulnerableTime = worldserver.purpurConfig.playerSpawnInvulnerableTicks; // Purpur
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -2108,6 +2117,7 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
|
||||
public void sendTexturePack(String url, String hash, boolean required, @Nullable Component resourcePackPrompt) {
|
||||
+ this.acceptingResourcePack = true; // Purpur
|
||||
this.connection.send(new ClientboundResourcePackPacket(url, hash, required, resourcePackPrompt));
|
||||
}
|
||||
|
||||
@@ -2695,9 +2705,17 @@ public class ServerPlayer extends Player {
|
||||
|
||||
@Override
|
||||
public boolean isImmobile() {
|
||||
- return super.isImmobile() || (this.connection != null && this.connection.isDisconnected()); // Paper
|
||||
+ return super.isImmobile() || frozen || (this.connection != null && this.connection.isDisconnected()); // Paper // Purpur
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ private boolean frozen = false;
|
||||
+
|
||||
+ public void setFrozen(boolean frozen) {
|
||||
+ this.frozen = frozen;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public Scoreboard getScoreboard() {
|
||||
return this.getBukkitEntity().getScoreboard().getHandle();
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index f23e8f89e09551d245fcef5507ecd061ed1b3ca9..81cbb6a55fd3e6a3b9ec96cc54b43e123c243482 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2149,12 +2149,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@Override
|
||||
public void handleResourcePackResponse(ServerboundResourcePackPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
+ // Purpur start
|
||||
+ if (player.level().purpurConfig.playerInvulnerableWhileAcceptingResourcePack && !this.player.acceptingResourcePack) {
|
||||
+ ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack packet exploitation attempt", this.player.getName());
|
||||
+ this.disconnect(Component.translatable("multiplayer.texturePrompt.failure.line1"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // "Server resource pack couldn't be applied"
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) {
|
||||
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getGameProfile().getName()); // Paper - Don't print component in resource pack rejection message
|
||||
this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - add cause
|
||||
}
|
||||
// Paper start
|
||||
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()];
|
||||
+ if (player.level().purpurConfig.playerInvulnerableWhileAcceptingResourcePack) player.setFrozen(packStatus == PlayerResourcePackStatusEvent.Status.ACCEPTED); // Purpur
|
||||
+ this.player.acceptingResourcePack = packStatus == PlayerResourcePackStatusEvent.Status.ACCEPTED; // Purpur
|
||||
player.getBukkitEntity().setResourcePackStatus(packStatus);
|
||||
this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 42801a26b9d5f8af2d0ce1fef864bb031cfa8965..2cac536ebbc21a23a2219c630fe477bf9c00ce65 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -985,6 +985,8 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ entityplayer1.spawnInvulnerableTime = entityplayer1.level().purpurConfig.playerSpawnInvulnerableTicks; // Purpur
|
||||
+
|
||||
// CraftBukkit end
|
||||
return entityplayer1;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index d0986b7b130f790c21d2324d0014d258bc36c527..c6ede1fac5c68f2912a9c401765bd10b09afe7f9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3293,5 +3293,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void resetIdleTimer() {
|
||||
getHandle().resetLastActionTime();
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isSpawnInvulnerable() {
|
||||
+ return getHandle().isSpawnInvulnerable();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getSpawnInvulnerableTicks() {
|
||||
+ return getHandle().spawnInvulnerableTime;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setSpawnInvulnerableTicks(int spawnInvulnerableTime) {
|
||||
+ getHandle().spawnInvulnerableTime = spawnInvulnerableTime;
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 3ed1a91c93f659306acaf8bad6820f49208554c8..f521d0e73908037c76c5669b401e422040e2a77b 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -95,6 +95,8 @@ public class PurpurWorldConfig {
|
||||
public boolean idleTimeoutCountAsSleeping = false;
|
||||
public boolean idleTimeoutUpdateTabList = false;
|
||||
public boolean idleTimeoutTargetPlayer = true;
|
||||
+ public int playerSpawnInvulnerableTicks = 60;
|
||||
+ public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
||||
private void playerSettings() {
|
||||
if (PurpurConfig.version < 19) {
|
||||
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
||||
@@ -106,6 +108,8 @@ public class PurpurWorldConfig {
|
||||
idleTimeoutCountAsSleeping = getBoolean("gameplay-mechanics.player.idle-timeout.count-as-sleeping", idleTimeoutCountAsSleeping);
|
||||
idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
|
||||
idleTimeoutTargetPlayer = getBoolean("gameplay-mechanics.player.idle-timeout.mobs-target", idleTimeoutTargetPlayer);
|
||||
+ playerSpawnInvulnerableTicks = getInt("gameplay-mechanics.player.spawn-invulnerable-ticks", playerSpawnInvulnerableTicks);
|
||||
+ playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
public boolean babiesAreRidable = true;
|
||||
@@ -1,174 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 19 Apr 2020 00:17:56 -0500
|
||||
Subject: [PATCH] Anvil API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 706b354ac9a1a6a4a1e61b2a109180d1dd22bbbd..9ca261c9f21279558961649cb4849ac379d67573 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -76,6 +76,7 @@ public abstract class AbstractContainerMenu {
|
||||
@Nullable
|
||||
private ContainerSynchronizer synchronizer;
|
||||
private boolean suppressRemoteUpdates;
|
||||
+ @javax.annotation.Nullable protected ItemStack activeQuickItem = null; // Purpur
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean checkReachable = true;
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
index e0c3a4ba27e21c3692e601acd0af60873bcbb84c..b500a04b8135604f0159a741b3d228c9e87b2a46 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
@@ -23,6 +23,13 @@ import org.slf4j.Logger;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
// CraftBukkit end
|
||||
|
||||
+// Purpur start
|
||||
+import net.minecraft.nbt.IntTag;
|
||||
+import net.minecraft.network.protocol.game.ClientboundContainerSetDataPacket;
|
||||
+import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+// Purpur end
|
||||
+
|
||||
public class AnvilMenu extends ItemCombinerMenu {
|
||||
|
||||
public static final int INPUT_SLOT = 0;
|
||||
@@ -51,6 +58,8 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
public int maximumRepairCost = 40;
|
||||
private CraftInventoryView bukkitEntity;
|
||||
// CraftBukkit end
|
||||
+ public boolean bypassCost = false; // Purpur
|
||||
+ public boolean canDoUnsafeEnchants = false; // Purpur
|
||||
|
||||
public AnvilMenu(int syncId, Inventory inventory) {
|
||||
this(syncId, inventory, ContainerLevelAccess.NULL);
|
||||
@@ -78,12 +87,15 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
|
||||
@Override
|
||||
protected boolean mayPickup(Player player, boolean present) {
|
||||
- return (player.getAbilities().instabuild || player.experienceLevel >= this.cost.get()) && this.cost.get() > AnvilMenu.DEFAULT_DENIED_COST && present; // CraftBukkit - allow cost 0 like a free item
|
||||
+ return (player.getAbilities().instabuild || player.experienceLevel >= this.cost.get()) && (bypassCost || this.cost.get() > AnvilMenu.DEFAULT_DENIED_COST) && present; // CraftBukkit - allow cost 0 like a free item // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTake(Player player, ItemStack stack) {
|
||||
+ ItemStack itemstack = activeQuickItem == null ? stack : activeQuickItem; // Purpur
|
||||
+ if (org.purpurmc.purpur.event.inventory.AnvilTakeResultEvent.getHandlerList().getRegisteredListeners().length > 0) new org.purpurmc.purpur.event.inventory.AnvilTakeResultEvent(player.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)).callEvent(); // Purpur
|
||||
if (!player.getAbilities().instabuild) {
|
||||
+ if (bypassCost) ((ServerPlayer) player).lastSentExp = -1; else // Purpur
|
||||
player.giveExperienceLevels(-this.cost.get());
|
||||
}
|
||||
|
||||
@@ -134,6 +146,12 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
|
||||
@Override
|
||||
public void createResult() {
|
||||
+ // Purpur start
|
||||
+ bypassCost = false;
|
||||
+ canDoUnsafeEnchants = false;
|
||||
+ if (org.purpurmc.purpur.event.inventory.AnvilUpdateResultEvent.getHandlerList().getRegisteredListeners().length > 0) new org.purpurmc.purpur.event.inventory.AnvilUpdateResultEvent(getBukkitView()).callEvent();
|
||||
+ // Purpur end
|
||||
+
|
||||
ItemStack itemstack = this.inputSlots.getItem(0);
|
||||
|
||||
this.cost.set(1);
|
||||
@@ -210,7 +228,7 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
int i2 = (Integer) map1.get(enchantment);
|
||||
|
||||
i2 = l1 == i2 ? i2 + 1 : Math.max(i2, l1);
|
||||
- boolean flag3 = enchantment.canEnchant(itemstack);
|
||||
+ boolean flag3 = canDoUnsafeEnchants || enchantment.canEnchant(itemstack); // Purpur
|
||||
|
||||
if (this.player.getAbilities().instabuild || itemstack.is(Items.ENCHANTED_BOOK)) {
|
||||
flag3 = true;
|
||||
@@ -222,7 +240,7 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
Enchantment enchantment1 = (Enchantment) iterator1.next();
|
||||
|
||||
if (enchantment1 != enchantment && !enchantment.isCompatibleWith(enchantment1)) {
|
||||
- flag3 = false;
|
||||
+ flag3 = canDoUnsafeEnchants; // Purpur
|
||||
++i;
|
||||
}
|
||||
}
|
||||
@@ -293,6 +311,13 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
this.cost.set(this.maximumRepairCost - 1); // CraftBukkit
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (bypassCost && cost.get() >= maximumRepairCost) {
|
||||
+ itemstack.addTagElement("Purpur.realCost", IntTag.valueOf(cost.get()));
|
||||
+ cost.set(maximumRepairCost - 1);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
if (this.cost.get() >= this.maximumRepairCost && !this.player.getAbilities().instabuild) { // CraftBukkit
|
||||
itemstack1 = ItemStack.EMPTY;
|
||||
}
|
||||
@@ -315,6 +340,12 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), itemstack1); // CraftBukkit
|
||||
sendAllDataToRemote(); // CraftBukkit - SPIGOT-6686: Always send completed inventory to stay in sync with client
|
||||
this.broadcastChanges();
|
||||
+ // Purpur start
|
||||
+ if (canDoUnsafeEnchants && itemstack1 != ItemStack.EMPTY) {
|
||||
+ ((ServerPlayer) player).connection.send(new ClientboundContainerSetSlotPacket(containerId, incrementStateId(), 2, itemstack1));
|
||||
+ ((ServerPlayer) player).connection.send(new ClientboundContainerSetDataPacket(containerId, 0, cost.get()));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
|
||||
index ff770b9ce68a62418de0c7ed389650626fa1dcb2..102739c0089ff3f6b3432f954304d43a3dfebc35 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java
|
||||
@@ -177,7 +177,9 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
+ this.activeQuickItem = itemstack; // Purpur
|
||||
slot1.onTake(player, itemstack1);
|
||||
+ this.activeQuickItem = null; // Purpur
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
|
||||
index 88d3ca586ff6905f18a8ab9f0e229f440ed44088..27dd4eb4781a3c75772860c11db886e1038cecd2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
|
||||
@@ -9,7 +9,7 @@ import org.bukkit.inventory.AnvilInventory;
|
||||
public class CraftInventoryAnvil extends CraftResultInventory implements AnvilInventory {
|
||||
|
||||
private final Location location;
|
||||
- private final AnvilMenu container;
|
||||
+ public final AnvilMenu container; // Purpur - private -> public
|
||||
|
||||
public CraftInventoryAnvil(Location location, Container inventory, Container resultInventory, AnvilMenu container) {
|
||||
super(inventory, resultInventory);
|
||||
@@ -57,4 +57,26 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn
|
||||
Preconditions.checkArgument(levels >= 0, "Maximum repair cost must be positive (or 0)");
|
||||
container.maximumRepairCost = levels;
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean canBypassCost() {
|
||||
+ return container.bypassCost;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setBypassCost(boolean bypassCost) {
|
||||
+ container.bypassCost = bypassCost;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean canDoUnsafeEnchants() {
|
||||
+ return container.canDoUnsafeEnchants;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setDoUnsafeEnchants(boolean canDoUnsafeEnchants) {
|
||||
+ container.canDoUnsafeEnchants = canDoUnsafeEnchants;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 11 Oct 2019 00:17:39 -0500
|
||||
Subject: [PATCH] Alternative Keepalive Handling
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 81cbb6a55fd3e6a3b9ec96cc54b43e123c243482..317342df5d3afe65e09853fd9ffe4aca127152d2 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -265,6 +265,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
private long keepAliveTime = Util.getMillis();
|
||||
private boolean keepAlivePending;
|
||||
private long keepAliveChallenge;
|
||||
+ private it.unimi.dsi.fastutil.longs.LongList keepAlives = new it.unimi.dsi.fastutil.longs.LongArrayList(); // Purpur
|
||||
// CraftBukkit start - multithreaded fields
|
||||
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
|
||||
private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits
|
||||
@@ -417,6 +418,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
long currentTime = Util.getMillis();
|
||||
long elapsedTime = currentTime - this.keepAliveTime;
|
||||
|
||||
+ // Purpur start
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.useAlternateKeepAlive) {
|
||||
+ if (elapsedTime >= 1000L) { // 1 second
|
||||
+ if (!processedDisconnect && keepAlives.size() * 1000L >= KEEPALIVE_LIMIT) {
|
||||
+ LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName());
|
||||
+ disconnect(Component.translatable("disconnect.timeout"), org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT);
|
||||
+ } else {
|
||||
+ keepAliveTime = currentTime; // hijack this field for 1 second intervals
|
||||
+ keepAlives.add(currentTime); // currentTime is ID
|
||||
+ send(new ClientboundKeepAlivePacket(currentTime));
|
||||
+ }
|
||||
+ }
|
||||
+ } else
|
||||
+ // Purpur end
|
||||
+
|
||||
if (this.keepAlivePending) {
|
||||
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
|
||||
@@ -3580,6 +3596,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
@Override
|
||||
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
|
||||
+ // Purpur start
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.useAlternateKeepAlive) {
|
||||
+ long id = packet.getId();
|
||||
+ if (keepAlives.size() > 0 && keepAlives.contains(id)) {
|
||||
+ int ping = (int) (Util.getMillis() - id);
|
||||
+ player.latency = (player.latency * 3 + ping) / 4;
|
||||
+ keepAlives.clear(); // we got a valid response, lets roll with it and forget the rest
|
||||
+ }
|
||||
+ } else
|
||||
+ // Purpur end
|
||||
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread
|
||||
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
|
||||
int i = (int) (Util.getMillis() - this.keepAliveTime);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 34afed28faeb56352b48faf8078a5fb07912eb5e..ad239ba9259c5a63b40261ebc44224893496b47d 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -198,6 +198,11 @@ public class PurpurConfig {
|
||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
}
|
||||
|
||||
+ public static boolean useAlternateKeepAlive = false;
|
||||
+ private static void useAlternateKeepAlive() {
|
||||
+ useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
|
||||
+ }
|
||||
+
|
||||
public static int barrelRows = 3;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
@@ -1,175 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 9 May 2019 14:27:37 -0500
|
||||
Subject: [PATCH] Silk touch spawners
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java
|
||||
index 5f20e075c532f0f1d413242949d1738c0c152bf7..e6f8cb165f7e3da5f0edfc952d14059516de8acf 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/Items.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/Items.java
|
||||
@@ -294,7 +294,7 @@ public class Items {
|
||||
public static final Item PURPUR_BLOCK = registerBlock(Blocks.PURPUR_BLOCK);
|
||||
public static final Item PURPUR_PILLAR = registerBlock(Blocks.PURPUR_PILLAR);
|
||||
public static final Item PURPUR_STAIRS = registerBlock(Blocks.PURPUR_STAIRS);
|
||||
- public static final Item SPAWNER = registerBlock(Blocks.SPAWNER);
|
||||
+ public static final Item SPAWNER = registerBlock(new org.purpurmc.purpur.item.SpawnerItem(Blocks.SPAWNER, new Item.Properties().rarity(Rarity.EPIC))); // Purpur
|
||||
public static final Item CHEST = registerBlock(Blocks.CHEST);
|
||||
public static final Item CRAFTING_TABLE = registerBlock(Blocks.CRAFTING_TABLE);
|
||||
public static final Item FARMLAND = registerBlock(Blocks.FARMLAND);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java
|
||||
index 936d844a5a246138c9f9ae4ae6e318242b8f1420..93f5f226cf6fd6110e4daa02b3f5d9ad253814a0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java
|
||||
@@ -40,6 +40,58 @@ public class SpawnerBlock extends BaseEntityBlock {
|
||||
return createTickerHelper(type, BlockEntityType.MOB_SPAWNER, world.isClientSide ? SpawnerBlockEntity::clientTick : SpawnerBlockEntity::serverTick);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public void playerDestroy(Level level, net.minecraft.world.entity.player.Player player, BlockPos pos, BlockState state, BlockEntity blockEntity, ItemStack stack, boolean includeDrops) {
|
||||
+ if (level.purpurConfig.silkTouchEnabled && player.getBukkitEntity().hasPermission("purpur.drop.spawners") && isSilkTouch(level, stack)) {
|
||||
+ Optional<net.minecraft.world.entity.EntityType<?>> type = net.minecraft.world.entity.EntityType.by(((SpawnerBlockEntity) blockEntity).getSpawner().nextSpawnData.getEntityToSpawn());
|
||||
+
|
||||
+ net.minecraft.world.entity.EntityType<?> entityType = type.orElse(null);
|
||||
+ final net.kyori.adventure.text.Component mobName = io.papermc.paper.adventure.PaperAdventure.asAdventure(entityType == null ? Component.empty() : entityType.getDescription());
|
||||
+ CompoundTag display = new CompoundTag();
|
||||
+ CompoundTag tag = new CompoundTag();
|
||||
+
|
||||
+ String name = level.purpurConfig.silkTouchSpawnerName;
|
||||
+ if (name != null && !name.isEmpty() && !name.equals("Monster Spawner")) {
|
||||
+ net.kyori.adventure.text.Component displayName = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(name, net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.component("mob", mobName));
|
||||
+ if (name.startsWith("<reset>")) {
|
||||
+ displayName = displayName.decoration(net.kyori.adventure.text.format.TextDecoration.ITALIC, false);
|
||||
+ }
|
||||
+ display.put("Name", net.minecraft.nbt.StringTag.valueOf(io.papermc.paper.adventure.PaperAdventure.asJsonString(displayName, java.util.Locale.ROOT)));
|
||||
+ tag.put("display", display);
|
||||
+ }
|
||||
+
|
||||
+ List<String> lore = level.purpurConfig.silkTouchSpawnerLore;
|
||||
+ if (lore != null && !lore.isEmpty()) {
|
||||
+ net.minecraft.nbt.ListTag list = new net.minecraft.nbt.ListTag();
|
||||
+ for (String line : lore) {
|
||||
+ net.kyori.adventure.text.Component lineComponent = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(line, net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.component("mob", mobName));
|
||||
+ if (line.startsWith("<reset>")) {
|
||||
+ lineComponent = lineComponent.decoration(net.kyori.adventure.text.format.TextDecoration.ITALIC, false);
|
||||
+ }
|
||||
+ list.add(net.minecraft.nbt.StringTag.valueOf(io.papermc.paper.adventure.PaperAdventure.asJsonString(lineComponent, java.util.Locale.ROOT)));
|
||||
+ }
|
||||
+ display.put("Lore", list);
|
||||
+ tag.put("display", display);
|
||||
+ }
|
||||
+
|
||||
+ ItemStack item = new ItemStack(Blocks.SPAWNER.asItem());
|
||||
+ if (entityType != null) {
|
||||
+ tag.putString("Purpur.mob_type", entityType.getName());
|
||||
+ tag.putDouble("HideFlags", 32); // hides the "Interact with Spawn Egg" tooltip
|
||||
+ item.setTag(tag);
|
||||
+ }
|
||||
+
|
||||
+ popResource(level, pos, item);
|
||||
+ }
|
||||
+ super.playerDestroy(level, player, pos, state, blockEntity, stack, includeDrops);
|
||||
+ }
|
||||
+
|
||||
+ private boolean isSilkTouch(Level level, ItemStack stack) {
|
||||
+ return stack != null && level.purpurConfig.silkTouchTools.contains(stack.getItem()) && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.SILK_TOUCH, stack) >= level.purpurConfig.minimumSilkTouchSpawnerRequire;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void spawnAfterBreak(BlockState state, ServerLevel world, BlockPos pos, ItemStack tool, boolean dropExperience) {
|
||||
super.spawnAfterBreak(state, world, pos, tool, dropExperience);
|
||||
@@ -48,6 +100,7 @@ public class SpawnerBlock extends BaseEntityBlock {
|
||||
|
||||
@Override
|
||||
public int getExpDrop(BlockState iblockdata, ServerLevel worldserver, BlockPos blockposition, ItemStack itemstack, boolean flag) {
|
||||
+ if (isSilkTouch(worldserver, itemstack)) return 0; // Purpur
|
||||
if (flag) {
|
||||
int i = 15 + worldserver.random.nextInt(15) + worldserver.random.nextInt(15);
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index f521d0e73908037c76c5669b401e422040e2a77b..ef20a9601527281d052c531e7e769ea480622481 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -112,6 +112,38 @@ public class PurpurWorldConfig {
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
+ public boolean silkTouchEnabled = false;
|
||||
+ public String silkTouchSpawnerName = "<reset><white>Monster Spawner";
|
||||
+ public List<String> silkTouchSpawnerLore = new ArrayList<>();
|
||||
+ public List<Item> silkTouchTools = new ArrayList<>();
|
||||
+ public int minimumSilkTouchSpawnerRequire = 1;
|
||||
+ private void silkTouchSettings() {
|
||||
+ if (PurpurConfig.version < 21) {
|
||||
+ String oldName = getString("gameplay-mechanics.silk-touch.spawner-name", silkTouchSpawnerName);
|
||||
+ set("gameplay-mechanics.silk-touch.spawner-name", "<reset>" + ChatColor.toMM(oldName.replace("{mob}", "<mob>")));
|
||||
+ List<String> list = new ArrayList<>();
|
||||
+ getList("gameplay-mechanics.silk-touch.spawner-lore", List.of("Spawns a <mob>"))
|
||||
+ .forEach(line -> list.add("<reset>" + ChatColor.toMM(line.toString().replace("{mob}", "<mob>"))));
|
||||
+ set("gameplay-mechanics.silk-touch.spawner-lore", list);
|
||||
+ }
|
||||
+ silkTouchEnabled = getBoolean("gameplay-mechanics.silk-touch.enabled", silkTouchEnabled);
|
||||
+ silkTouchSpawnerName = getString("gameplay-mechanics.silk-touch.spawner-name", silkTouchSpawnerName);
|
||||
+ minimumSilkTouchSpawnerRequire = getInt("gameplay-mechanics.silk-touch.minimal-level", minimumSilkTouchSpawnerRequire);
|
||||
+ silkTouchSpawnerLore.clear();
|
||||
+ getList("gameplay-mechanics.silk-touch.spawner-lore", List.of("Spawns a <mob>"))
|
||||
+ .forEach(line -> silkTouchSpawnerLore.add(line.toString()));
|
||||
+ silkTouchTools.clear();
|
||||
+ getList("gameplay-mechanics.silk-touch.tools", List.of(
|
||||
+ "minecraft:iron_pickaxe",
|
||||
+ "minecraft:golden_pickaxe",
|
||||
+ "minecraft:diamond_pickaxe",
|
||||
+ "minecraft:netherite_pickaxe"
|
||||
+ )).forEach(key -> {
|
||||
+ Item item = BuiltInRegistries.ITEM.get(new ResourceLocation(key.toString()));
|
||||
+ if (item != Items.AIR) silkTouchTools.add(item);
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
public boolean babiesAreRidable = true;
|
||||
public boolean untamedTamablesAreRidable = true;
|
||||
public boolean useNightVisionWhenRiding = false;
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/item/SpawnerItem.java b/src/main/java/org/purpurmc/purpur/item/SpawnerItem.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c038fb2bbb0f0e78380bc24bbd6348b869669a90
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/item/SpawnerItem.java
|
||||
@@ -0,0 +1,36 @@
|
||||
+package org.purpurmc.purpur.item;
|
||||
+
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
+import net.minecraft.world.entity.EntityType;
|
||||
+import net.minecraft.world.entity.player.Player;
|
||||
+import net.minecraft.world.item.BlockItem;
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.level.Level;
|
||||
+import net.minecraft.world.level.block.Block;
|
||||
+import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.SpawnerBlockEntity;
|
||||
+import net.minecraft.world.level.block.state.BlockState;
|
||||
+
|
||||
+public class SpawnerItem extends BlockItem {
|
||||
+
|
||||
+ public SpawnerItem(Block block, Properties settings) {
|
||||
+ super(block, settings);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected boolean updateCustomBlockEntityTag(BlockPos pos, Level level, Player player, ItemStack stack, BlockState state) {
|
||||
+ boolean handled = super.updateCustomBlockEntityTag(pos, level, player, stack, state);
|
||||
+ if (level.purpurConfig.silkTouchEnabled && player.getBukkitEntity().hasPermission("purpur.place.spawners")) {
|
||||
+ BlockEntity spawner = level.getBlockEntity(pos);
|
||||
+ if (spawner instanceof SpawnerBlockEntity && stack.hasTag()) {
|
||||
+ CompoundTag tag = stack.getTag();
|
||||
+ if (tag.contains("Purpur.mob_type")) {
|
||||
+ EntityType.byString(tag.getString("Purpur.mob_type")).ifPresent(type ->
|
||||
+ ((SpawnerBlockEntity) spawner).getSpawner().setEntityId(type, level, level.random, pos));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return handled;
|
||||
+ }
|
||||
+}
|
||||
@@ -1,57 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 22:15:46 -0500
|
||||
Subject: [PATCH] Add turtle egg block options
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
index 6c1a0e6f961e46a1a89850746a71e97b32514adf..1942649e868fc985a488034c411a6721595ecc67 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
@@ -193,6 +193,25 @@ public class TurtleEggBlock extends Block {
|
||||
}
|
||||
|
||||
private boolean canDestroyEgg(Level world, Entity entity) {
|
||||
- return !(entity instanceof Turtle) && !(entity instanceof Bat) ? (!(entity instanceof LivingEntity) ? false : entity instanceof Player || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) : false;
|
||||
+ // Purpur start
|
||||
+ if (entity instanceof Turtle || entity instanceof Bat) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (world.purpurConfig.turtleEggsBreakFromExpOrbs && entity instanceof net.minecraft.world.entity.ExperienceOrb) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (world.purpurConfig.turtleEggsBreakFromItems && entity instanceof net.minecraft.world.entity.item.ItemEntity) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (world.purpurConfig.turtleEggsBreakFromMinecarts && entity instanceof net.minecraft.world.entity.vehicle.AbstractMinecart) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (!(entity instanceof LivingEntity)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (entity instanceof Player) return true;
|
||||
+
|
||||
+ return world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
||||
+ // Purpur end
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index ef20a9601527281d052c531e7e769ea480622481..1b06b531cc334b00b8f12634bd36766619098f16 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -144,6 +144,15 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean turtleEggsBreakFromExpOrbs = true;
|
||||
+ public boolean turtleEggsBreakFromItems = true;
|
||||
+ public boolean turtleEggsBreakFromMinecarts = true;
|
||||
+ private void turtleEggSettings() {
|
||||
+ turtleEggsBreakFromExpOrbs = getBoolean("blocks.turtle_egg.break-from-exp-orbs", turtleEggsBreakFromExpOrbs);
|
||||
+ turtleEggsBreakFromItems = getBoolean("blocks.turtle_egg.break-from-items", turtleEggsBreakFromItems);
|
||||
+ turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
+ }
|
||||
+
|
||||
public boolean babiesAreRidable = true;
|
||||
public boolean untamedTamablesAreRidable = true;
|
||||
public boolean useNightVisionWhenRiding = false;
|
||||
@@ -1,74 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:52:12 -0500
|
||||
Subject: [PATCH] Logger settings (suppressing pointless logs)
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
index acc49f66bf34e2507d0ee6fec0a56b11bfc68f46..52891c4a4260d1938f2f4565b5219ad303555638 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -147,6 +147,7 @@ public class PlayerAdvancements {
|
||||
if (advancement == null) {
|
||||
// CraftBukkit start
|
||||
if (entry.getKey().getNamespace().equals("minecraft")) {
|
||||
+ if (!org.purpurmc.purpur.PurpurConfig.loggerSuppressIgnoredAdvancementWarnings) // Purpur
|
||||
PlayerAdvancements.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.playerSavePath);
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
index 877498729c66de9aa6a27c9148f7494d7895615c..acd7468ee3c86d3456e96e4ec3d7e6a4c612e89d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
@@ -297,6 +297,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
return true;
|
||||
} else {
|
||||
// Paper start
|
||||
+ if (!org.purpurmc.purpur.PurpurConfig.loggerSuppressSetBlockFarChunk) // Purpur
|
||||
if (!hasSetFarWarned) {
|
||||
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||
hasSetFarWarned = true;
|
||||
diff --git a/src/main/java/net/minecraft/stats/ServerRecipeBook.java b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
index ea29e07a105f3ba6a878bdccf36e7eaf66280280..d5dce6c8d85938d61a57a78f82381d26daf8f87a 100644
|
||||
--- a/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
+++ b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
|
||||
@@ -125,6 +125,7 @@ public class ServerRecipeBook extends RecipeBook {
|
||||
Optional<? extends Recipe<?>> optional = recipeManager.byKey(minecraftkey);
|
||||
|
||||
if (!optional.isPresent()) {
|
||||
+ if (!org.purpurmc.purpur.PurpurConfig.loggerSuppressUnrecognizedRecipeErrors) // Purpur
|
||||
ServerRecipeBook.LOGGER.error("Tried to load unrecognized recipe: {} removed now.", minecraftkey);
|
||||
} else {
|
||||
handler.accept((Recipe) optional.get());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index 2677e21d8239bf0361a3bc5c9a50c328e54d70f6..544a79d5da661aff19e2019f7b83a3a49350bb68 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
@@ -256,6 +256,7 @@ public final class CraftLegacy {
|
||||
}
|
||||
|
||||
static {
|
||||
+ if (!org.purpurmc.purpur.PurpurConfig.loggerSuppressInitLegacyMaterialError) // Purpur
|
||||
LOGGER.warn("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!"); // Paper - doesn't need to be an error
|
||||
if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDebugging()) {
|
||||
new Exception().printStackTrace();
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index fa27bb42697cd5741b7308b34cd768232604a20f..9db231480f0763c2b6514a956ec9398b98b7d1bc 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -237,4 +237,15 @@ public class PurpurConfig {
|
||||
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
+
|
||||
+ public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||
+ public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
||||
+ public static boolean loggerSuppressUnrecognizedRecipeErrors = false;
|
||||
+ public static boolean loggerSuppressSetBlockFarChunk = false;
|
||||
+ private static void loggerSettings() {
|
||||
+ loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
+ loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
+ loggerSuppressUnrecognizedRecipeErrors = getBoolean("settings.logger.suppress-unrecognized-recipe-errors", loggerSuppressUnrecognizedRecipeErrors);
|
||||
+ loggerSuppressSetBlockFarChunk = getBoolean("settings.logger.suppress-setblock-in-far-chunk-errors", loggerSuppressSetBlockFarChunk);
|
||||
+ }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 15 Dec 2019 12:53:59 -0600
|
||||
Subject: [PATCH] Disable outdated build check
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 2be5346e48f9f8410f3e4e9a2aa57b063495eb93..20aed44f6d50ff279002259c05c84e7d15904142 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -292,7 +292,7 @@ public class Main {
|
||||
System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
|
||||
}
|
||||
|
||||
- if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||
+ if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { // Purpur
|
||||
Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
@@ -1,140 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||
Subject: [PATCH] Giants AI settings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Giant.java b/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||
index db95323da1aef267aa4fbe56aaff63cb8684e15b..12e27b36b3f9949eb644175dd346c487277b2d39 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||
@@ -1,13 +1,36 @@
|
||||
package net.minecraft.world.entity.monster;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
+import net.minecraft.world.Difficulty;
|
||||
+import net.minecraft.world.DifficultyInstance;
|
||||
import net.minecraft.world.entity.EntityDimensions;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
+import net.minecraft.world.entity.EquipmentSlot;
|
||||
+import net.minecraft.world.entity.MobSpawnType;
|
||||
import net.minecraft.world.entity.Pose;
|
||||
+import net.minecraft.world.entity.SpawnGroupData;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
+import net.minecraft.world.entity.ai.goal.FloatGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.MoveTowardsRestrictionGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
|
||||
+import net.minecraft.world.entity.animal.IronGolem;
|
||||
+import net.minecraft.world.entity.animal.Turtle;
|
||||
+import net.minecraft.world.entity.npc.Villager;
|
||||
+import net.minecraft.world.entity.player.Player;
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
+import net.minecraft.world.level.ServerLevelAccessor;
|
||||
+
|
||||
+import javax.annotation.Nullable;
|
||||
|
||||
public class Giant extends Monster {
|
||||
public Giant(EntityType<? extends Giant> type, Level world) {
|
||||
@@ -33,8 +56,23 @@ public class Giant extends Monster {
|
||||
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
- this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
- this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
+ if (level().purpurConfig.giantHaveAI) {
|
||||
+ this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
+ this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
+ this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 16.0F));
|
||||
+ this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
|
||||
+ this.goalSelector.addGoal(5, new MoveTowardsRestrictionGoal(this, 1.0D));
|
||||
+ if (level().purpurConfig.giantHaveHostileAI) {
|
||||
+ this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.0D, false));
|
||||
+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
+ this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers(ZombifiedPiglin.class));
|
||||
+ this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
|
||||
+ this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Villager.class, false));
|
||||
+ this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
|
||||
+ this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, true));
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@@ -45,6 +83,32 @@ public class Giant extends Monster {
|
||||
this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(this.level().purpurConfig.giantAttackDamage);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
|
||||
+ SpawnGroupData groupData = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
||||
+ if (groupData == null) {
|
||||
+ populateDefaultEquipmentSlots(this.random, difficulty);
|
||||
+ populateDefaultEquipmentEnchantments(this.random, difficulty);
|
||||
+ }
|
||||
+ return groupData;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void populateDefaultEquipmentSlots(net.minecraft.util.RandomSource random, DifficultyInstance difficulty) {
|
||||
+ super.populateDefaultEquipmentSlots(this.random, difficulty);
|
||||
+ // TODO make configurable
|
||||
+ if (random.nextFloat() < (level().getDifficulty() == Difficulty.HARD ? 0.1F : 0.05F)) {
|
||||
+ this.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float getJumpPower() {
|
||||
+ // make giants jump as high as everything else relative to their size
|
||||
+ // 1.0 makes bottom of feet about as high as their waist when they jump
|
||||
+ return level().purpurConfig.giantJumpHeight;
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) {
|
||||
return 10.440001F;
|
||||
@@ -56,6 +120,6 @@ public class Giant extends Monster {
|
||||
|
||||
@Override
|
||||
public float getWalkTargetValue(BlockPos pos, LevelReader world) {
|
||||
- return world.getPathfindingCostFromLightLevels(pos);
|
||||
+ return super.getWalkTargetValue(pos, world); // Purpur - fix light requirements for natural spawns
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 1b06b531cc334b00b8f12634bd36766619098f16..916249a2ad6721182f0e71e785db3b50839d4961 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -558,6 +558,10 @@ public class PurpurWorldConfig {
|
||||
public double giantMovementSpeed = 0.5D;
|
||||
public double giantAttackDamage = 50.0D;
|
||||
public double giantMaxHealth = 100.0D;
|
||||
+ public float giantStepHeight = 2.0F;
|
||||
+ public float giantJumpHeight = 1.0F;
|
||||
+ public boolean giantHaveAI = false;
|
||||
+ public boolean giantHaveHostileAI = false;
|
||||
private void giantSettings() {
|
||||
giantRidable = getBoolean("mobs.giant.ridable", giantRidable);
|
||||
giantRidableInWater = getBoolean("mobs.giant.ridable-in-water", giantRidableInWater);
|
||||
@@ -574,6 +578,10 @@ public class PurpurWorldConfig {
|
||||
set("mobs.giant.attributes.max_health", oldValue);
|
||||
}
|
||||
giantMaxHealth = getDouble("mobs.giant.attributes.max_health", giantMaxHealth);
|
||||
+ giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||
+ giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
}
|
||||
|
||||
public boolean glowSquidRidable = false;
|
||||
@@ -1,51 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 7 Jul 2019 19:52:16 -0500
|
||||
Subject: [PATCH] Zombie horse naturally spawn
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 4c3b5a26a6b04afff3a707929ced3c62b5256a67..11f92c1011a1accaf485e5785d2e9ebc8440406c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -971,10 +971,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
|
||||
|
||||
if (flag1) {
|
||||
- SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create(this);
|
||||
+ // Purpur start
|
||||
+ net.minecraft.world.entity.animal.horse.AbstractHorse entityhorseskeleton;
|
||||
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
|
||||
+ entityhorseskeleton = EntityType.ZOMBIE_HORSE.create(this);
|
||||
+ } else {
|
||||
+ entityhorseskeleton = EntityType.SKELETON_HORSE.create(this);
|
||||
+ if (entityhorseskeleton != null) ((SkeletonHorse) entityhorseskeleton).setTrap(true);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
if (entityhorseskeleton != null) {
|
||||
- entityhorseskeleton.setTrap(true);
|
||||
+ //entityhorseskeleton.setTrap(true); // Purpur - moved up
|
||||
entityhorseskeleton.setAge(0);
|
||||
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
this.addFreshEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 916249a2ad6721182f0e71e785db3b50839d4961..1f636491c6da434708359224107cfc1de1cd6034 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1488,6 +1488,7 @@ public class PurpurWorldConfig {
|
||||
public double zombieHorseJumpStrengthMax = 1.0D;
|
||||
public double zombieHorseMovementSpeedMin = 0.2D;
|
||||
public double zombieHorseMovementSpeedMax = 0.2D;
|
||||
+ public double zombieHorseSpawnChance = 0.0D;
|
||||
private void zombieHorseSettings() {
|
||||
zombieHorseRidableInWater = getBoolean("mobs.zombie_horse.ridable-in-water", zombieHorseRidableInWater);
|
||||
zombieHorseCanSwim = getBoolean("mobs.zombie_horse.can-swim", zombieHorseCanSwim);
|
||||
@@ -1503,6 +1504,7 @@ public class PurpurWorldConfig {
|
||||
zombieHorseJumpStrengthMax = getDouble("mobs.zombie_horse.attributes.jump_strength.max", zombieHorseJumpStrengthMax);
|
||||
zombieHorseMovementSpeedMin = getDouble("mobs.zombie_horse.attributes.movement_speed.min", zombieHorseMovementSpeedMin);
|
||||
zombieHorseMovementSpeedMax = getDouble("mobs.zombie_horse.attributes.movement_speed.max", zombieHorseMovementSpeedMax);
|
||||
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
}
|
||||
|
||||
public boolean zombieVillagerRidable = false;
|
||||
@@ -1,45 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 29 Nov 2019 22:37:44 -0600
|
||||
Subject: [PATCH] Charged creeper naturally spawn
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
index e31094f270117dec3053620c06e409953fb6d710..a1e3f29ce49dc41ad70f74ee224250fe9ebea175 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
@@ -255,6 +255,14 @@ public class Creeper extends Monster implements PowerableMob {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.creeperMaxHealth);
|
||||
}
|
||||
|
||||
+ public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.MobSpawnType spawnReason, @Nullable net.minecraft.world.entity.SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
|
||||
+ double chance = world.getLevel().purpurConfig.creeperChargedChance;
|
||||
+ if (chance > 0D && random.nextDouble() <= chance) {
|
||||
+ setPowered(true);
|
||||
+ }
|
||||
+ return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
protected SoundEvent getHurtSound(DamageSource source) {
|
||||
return SoundEvents.CREEPER_HURT;
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 1f636491c6da434708359224107cfc1de1cd6034..607298a7fe2f2f7b2320a028d1343c1575decf31 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -349,6 +349,7 @@ public class PurpurWorldConfig {
|
||||
public boolean creeperRidableInWater = true;
|
||||
public boolean creeperControllable = true;
|
||||
public double creeperMaxHealth = 20.0D;
|
||||
+ public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
||||
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
||||
@@ -359,6 +360,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.creeper.attributes.max_health", oldValue);
|
||||
}
|
||||
creeperMaxHealth = getDouble("mobs.creeper.attributes.max_health", creeperMaxHealth);
|
||||
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
public boolean dolphinRidable = false;
|
||||
@@ -1,56 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 31 Aug 2019 17:47:11 -0500
|
||||
Subject: [PATCH] Rabbit naturally spawn toast and killer
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
index 9be247def3ab8c74c569f653ec971aaf1b5ed5c9..6d5213d26dbd9d36c5cbe6056091d9e5c85e23c4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
@@ -468,10 +468,23 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
|
||||
}
|
||||
|
||||
this.setVariant(entityrabbit_variant);
|
||||
+
|
||||
+ // Purpur start
|
||||
+ if (entityrabbit_variant != Variant.EVIL && world.getLevel().purpurConfig.rabbitNaturalToast > 0D && random.nextDouble() <= world.getLevel().purpurConfig.rabbitNaturalToast) {
|
||||
+ setCustomName(Component.translatable("Toast"));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
return super.finalizeSpawn(world, difficulty, spawnReason, (SpawnGroupData) entityData, entityNbt);
|
||||
}
|
||||
|
||||
private static Rabbit.Variant getRandomRabbitVariant(LevelAccessor world, BlockPos pos) {
|
||||
+ // Purpur start
|
||||
+ Level level = world.getMinecraftWorld();
|
||||
+ if (level.purpurConfig.rabbitNaturalKiller > 0D && world.getRandom().nextDouble() <= level.purpurConfig.rabbitNaturalKiller) {
|
||||
+ return Rabbit.Variant.EVIL;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
Holder<Biome> holder = world.getBiome(pos);
|
||||
int i = world.getRandom().nextInt(100);
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 607298a7fe2f2f7b2320a028d1343c1575decf31..5974f2ec7f42cf5ea58a5cfa124f0165a5fc5785 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -992,6 +992,8 @@ public class PurpurWorldConfig {
|
||||
public boolean rabbitRidableInWater = true;
|
||||
public boolean rabbitControllable = true;
|
||||
public double rabbitMaxHealth = 3.0D;
|
||||
+ public double rabbitNaturalToast = 0.0D;
|
||||
+ public double rabbitNaturalKiller = 0.0D;
|
||||
private void rabbitSettings() {
|
||||
rabbitRidable = getBoolean("mobs.rabbit.ridable", rabbitRidable);
|
||||
rabbitRidableInWater = getBoolean("mobs.rabbit.ridable-in-water", rabbitRidableInWater);
|
||||
@@ -1002,6 +1004,8 @@ public class PurpurWorldConfig {
|
||||
set("mobs.rabbit.attributes.max_health", oldValue);
|
||||
}
|
||||
rabbitMaxHealth = getDouble("mobs.rabbit.attributes.max_health", rabbitMaxHealth);
|
||||
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
||||
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
}
|
||||
|
||||
public boolean ravagerRidable = false;
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 4 Jun 2019 15:50:08 -0500
|
||||
Subject: [PATCH] Fix 'outdated server' showing in ping before server fully
|
||||
boots
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
index 2c13147bc063a09bb7907d6f90c3a1e811a09eb1..3edb0c392cec7fdabebad81da1a8b06a700fbfca 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
@@ -153,6 +153,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
this.connection.send(new ClientboundStatusResponsePacket(ping));
|
||||
// CraftBukkit end
|
||||
*/
|
||||
+ if (MinecraftServer.getServer().getStatus().version().isEmpty()) return; // Purpur - do not respond to pings before we know the protocol version
|
||||
com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(MinecraftServer.getServer(), this.connection);
|
||||
// Paper end
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 13 Jul 2019 15:56:22 -0500
|
||||
Subject: [PATCH] Tulips change fox type
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
|
||||
index d6370eb9af9842710052e0e497af52122f265488..cedc4dac776dde310dbf1a22272ce54b14ca2c9e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
|
||||
@@ -35,6 +35,7 @@ import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.util.StringRepresentable;
|
||||
import net.minecraft.world.DifficultyInstance;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
+import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.entity.AgeableMob;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
@@ -88,6 +89,7 @@ import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.CaveVines;
|
||||
import net.minecraft.world.level.block.SweetBerryBushBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
+import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.level.pathfinder.BlockPathTypes;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
@@ -387,6 +389,11 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
|
||||
}
|
||||
|
||||
private void setTargetGoals() {
|
||||
+ // Purpur start - do not add duplicate goals
|
||||
+ this.targetSelector.removeGoal(this.landTargetGoal);
|
||||
+ this.targetSelector.removeGoal(this.turtleEggTargetGoal);
|
||||
+ this.targetSelector.removeGoal(this.fishTargetGoal);
|
||||
+ // Purpur end
|
||||
if (this.getVariant() == Fox.Type.RED) {
|
||||
this.targetSelector.addGoal(4, this.landTargetGoal);
|
||||
this.targetSelector.addGoal(4, this.turtleEggTargetGoal);
|
||||
@@ -420,6 +427,7 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
|
||||
|
||||
public void setVariant(Fox.Type variant) {
|
||||
this.entityData.set(Fox.DATA_TYPE_ID, variant.getId());
|
||||
+ this.setTargetGoals(); // Purpur - fix API bug not updating pathfinders on type change
|
||||
}
|
||||
|
||||
List<UUID> getTrustedUUIDs() {
|
||||
@@ -756,6 +764,29 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
|
||||
return this.getTrustedUUIDs().contains(uuid);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
+ if (level().purpurConfig.foxTypeChangesWithTulips) {
|
||||
+ ItemStack itemstack = player.getItemInHand(hand);
|
||||
+ if (getVariant() == Type.RED && itemstack.getItem() == Items.WHITE_TULIP) {
|
||||
+ setVariant(Type.SNOW);
|
||||
+ if (!player.getAbilities().instabuild) {
|
||||
+ itemstack.shrink(1);
|
||||
+ }
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ } else if (getVariant() == Type.SNOW && itemstack.getItem() == Items.ORANGE_TULIP) {
|
||||
+ setVariant(Type.RED);
|
||||
+ if (!player.getAbilities().instabuild) {
|
||||
+ itemstack.shrink(1);
|
||||
+ }
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ }
|
||||
+ return super.mobInteract(player, hand);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
// Paper start - Cancellable death event
|
||||
protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(DamageSource source) {
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 5974f2ec7f42cf5ea58a5cfa124f0165a5fc5785..d0b82fb2d43207f997b85c2a2d6abc3af98c2fbd 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -513,6 +513,7 @@ public class PurpurWorldConfig {
|
||||
public boolean foxRidableInWater = true;
|
||||
public boolean foxControllable = true;
|
||||
public double foxMaxHealth = 10.0D;
|
||||
+ public boolean foxTypeChangesWithTulips = false;
|
||||
private void foxSettings() {
|
||||
foxRidable = getBoolean("mobs.fox.ridable", foxRidable);
|
||||
foxRidableInWater = getBoolean("mobs.fox.ridable-in-water", foxRidableInWater);
|
||||
@@ -523,6 +524,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.fox.attributes.max_health", oldValue);
|
||||
}
|
||||
foxMaxHealth = getDouble("mobs.fox.attributes.max_health", foxMaxHealth);
|
||||
+ foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
}
|
||||
|
||||
public boolean frogRidable = false;
|
||||
@@ -1,83 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 26 Mar 2020 19:46:44 -0500
|
||||
Subject: [PATCH] Breedable Polar Bears
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/PolarBear.java b/src/main/java/net/minecraft/world/entity/animal/PolarBear.java
|
||||
index 48ec595e76c09cf719477a543364f1206664afa5..b2cf680e377f849a7cc17136ebca3cf33e34048c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/PolarBear.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/PolarBear.java
|
||||
@@ -99,6 +99,27 @@ public class PolarBear extends Animal implements NeutralMob {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.polarBearMaxHealth);
|
||||
}
|
||||
|
||||
+ public boolean canMate(Animal other) {
|
||||
+ if (other == this) {
|
||||
+ return false;
|
||||
+ } else if (this.isStanding()) {
|
||||
+ return false;
|
||||
+ } else if (this.getTarget() != null) {
|
||||
+ return false;
|
||||
+ } else if (!(other instanceof PolarBear)) {
|
||||
+ return false;
|
||||
+ } else {
|
||||
+ PolarBear bear = (PolarBear) other;
|
||||
+ if (bear.isStanding()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (bear.getTarget() != null) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ return this.isInLove() && bear.isInLove();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@Nullable
|
||||
@Override
|
||||
public AgeableMob getBreedOffspring(ServerLevel world, AgeableMob entity) {
|
||||
@@ -107,7 +128,7 @@ public class PolarBear extends Animal implements NeutralMob {
|
||||
|
||||
@Override
|
||||
public boolean isFood(ItemStack stack) {
|
||||
- return false;
|
||||
+ return level().purpurConfig.polarBearBreedableItem != null && stack.getItem() == level().purpurConfig.polarBearBreedableItem; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,6 +138,12 @@ public class PolarBear extends Animal implements NeutralMob {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.goalSelector.addGoal(1, new PolarBear.PolarBearMeleeAttackGoal());
|
||||
this.goalSelector.addGoal(1, new PolarBear.PolarBearPanicGoal());
|
||||
+ // Purpur start
|
||||
+ if (level().purpurConfig.polarBearBreedableItem != null) {
|
||||
+ this.goalSelector.addGoal(2, new net.minecraft.world.entity.ai.goal.BreedGoal(this, 1.0D));
|
||||
+ this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.0D, net.minecraft.world.item.crafting.Ingredient.of(level().purpurConfig.polarBearBreedableItem), false));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25D));
|
||||
this.goalSelector.addGoal(5, new RandomStrollGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index d0b82fb2d43207f997b85c2a2d6abc3af98c2fbd..f994a8eb776c2ad1029b447ebab0273eb01e302f 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -964,6 +964,8 @@ public class PurpurWorldConfig {
|
||||
public boolean polarBearRidableInWater = true;
|
||||
public boolean polarBearControllable = true;
|
||||
public double polarBearMaxHealth = 30.0D;
|
||||
+ public String polarBearBreedableItemString = "";
|
||||
+ public Item polarBearBreedableItem = null;
|
||||
private void polarBearSettings() {
|
||||
polarBearRidable = getBoolean("mobs.polar_bear.ridable", polarBearRidable);
|
||||
polarBearRidableInWater = getBoolean("mobs.polar_bear.ridable-in-water", polarBearRidableInWater);
|
||||
@@ -974,6 +976,9 @@ public class PurpurWorldConfig {
|
||||
set("mobs.polar_bear.attributes.max_health", oldValue);
|
||||
}
|
||||
polarBearMaxHealth = getDouble("mobs.polar_bear.attributes.max_health", polarBearMaxHealth);
|
||||
+ polarBearBreedableItemString = getString("mobs.polar_bear.breedable-item", polarBearBreedableItemString);
|
||||
+ Item item = BuiltInRegistries.ITEM.get(new ResourceLocation(polarBearBreedableItemString));
|
||||
+ if (item != Items.AIR) polarBearBreedableItem = item;
|
||||
}
|
||||
|
||||
public boolean pufferfishRidable = false;
|
||||
@@ -1,71 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 Apr 2020 13:19:34 -0500
|
||||
Subject: [PATCH] Chickens can retaliate
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Chicken.java b/src/main/java/net/minecraft/world/entity/animal/Chicken.java
|
||||
index ea404a84a43a02a5614d5142bb78a586edfc69f6..0f49705e3c7adf033cee9d0746319885c830224f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Chicken.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Chicken.java
|
||||
@@ -74,19 +74,30 @@ public class Chicken extends Animal {
|
||||
@Override
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.chickenMaxHealth);
|
||||
+ if (level().purpurConfig.chickenRetaliate) {
|
||||
+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(2.0D);
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
- this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D));
|
||||
+ // this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D)); // Purpur - moved down
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.0D, Chicken.FOOD_ITEMS, false));
|
||||
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.1D));
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||
+ // Purpur start
|
||||
+ if (level().purpurConfig.chickenRetaliate) {
|
||||
+ this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.0D, false));
|
||||
+ this.targetSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal(this));
|
||||
+ } else {
|
||||
+ this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,7 +106,7 @@ public class Chicken extends Animal {
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
- return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
+ return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D).add(Attributes.ATTACK_DAMAGE, 0.0D); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index f994a8eb776c2ad1029b447ebab0273eb01e302f..535fc8b625b49c2451e17f5e73ea44b634adc6d9 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -303,6 +303,7 @@ public class PurpurWorldConfig {
|
||||
public boolean chickenRidableInWater = false;
|
||||
public boolean chickenControllable = true;
|
||||
public double chickenMaxHealth = 4.0D;
|
||||
+ public boolean chickenRetaliate = false;
|
||||
private void chickenSettings() {
|
||||
chickenRidable = getBoolean("mobs.chicken.ridable", chickenRidable);
|
||||
chickenRidableInWater = getBoolean("mobs.chicken.ridable-in-water", chickenRidableInWater);
|
||||
@@ -313,6 +314,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.chicken.attributes.max_health", oldValue);
|
||||
}
|
||||
chickenMaxHealth = getDouble("mobs.chicken.attributes.max_health", chickenMaxHealth);
|
||||
+ chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
}
|
||||
|
||||
public boolean codRidable = false;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user