mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: df0d7b0d Update upstream CB 6ea3c2cf [CI-SKIP] Rebuild patches d7bed4cb Heavily optimise random block ticking (#2914) b66d9ff8 Update upstream CB ba71c5d6 Stop stripping private use block Unicode from signs 28d9dcfc Entity Jump API (#1587) 9976a768 Fix PlayerNaturallySpawnCreaturesEvent boolean inversion 054e20da Clean up imports on ThrownEggHatchEvent a8984ccb Add ThrownEggHatchEvent (#1982) 9f24d495 Allow nerfed blazes, endermen to take water damage (#2847)
This commit is contained in:
2
Paper
2
Paper
Submodule Paper updated: f09fed894f...df0d7b0d5c
@@ -1 +1 @@
|
||||
1.15.2--b1a9373b711c4c77b9feab2527f766c5bce67268
|
||||
1.15.2--f2dd6bbbd577228dc95225f66d44f5fd5e90b3e1
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
From 3fcfaee80a5a2fda4d08e86daf4401f4d8529ab2 Mon Sep 17 00:00:00 2001
|
||||
From 991336514b39c0b09f2aa31b78647b0a9728e40f 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] Rebrand
|
||||
|
||||
---
|
||||
pom.xml | 13 ++++++-------
|
||||
src/main/java/co/aikar/timings/TimingsExport.java | 4 ++--
|
||||
2 files changed, 8 insertions(+), 9 deletions(-)
|
||||
src/main/java/co/aikar/timings/TimingsExport.java | 2 +-
|
||||
2 files changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 2cb97140..58a1f7d0 100644
|
||||
@@ -46,25 +46,18 @@ index 2cb97140..58a1f7d0 100644
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index 23eb8c65..667de7bd 100644
|
||||
index 23eb8c65..b3739826 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -283,13 +283,13 @@ class TimingsExport extends Thread {
|
||||
@@ -283,7 +283,7 @@ class TimingsExport extends Thread {
|
||||
String response = null;
|
||||
String timingsURL = null;
|
||||
try {
|
||||
- HttpURLConnection con = (HttpURLConnection) new URL("http://timings.aikar.co/post").openConnection();
|
||||
+ HttpURLConnection con = (HttpURLConnection) new URL("https://timings.pl3x.net/post").openConnection();
|
||||
+ HttpURLConnection con = (HttpURLConnection) new URL("http://timings.pl3x.net/post").openConnection();
|
||||
con.setDoOutput(true);
|
||||
String hostName = "BrokenHost";
|
||||
try {
|
||||
hostName = InetAddress.getLocalHost().getHostName();
|
||||
} catch (Exception ignored) {}
|
||||
- con.setRequestProperty("User-Agent", "Paper/" + Bukkit.getUnsafe().getTimingsServerName() + "/" + hostName);
|
||||
+ con.setRequestProperty("User-Agent", "Purpur/" + Bukkit.getUnsafe().getTimingsServerName() + "/" + hostName);
|
||||
con.setRequestMethod("POST");
|
||||
con.setInstanceFollowRedirects(false);
|
||||
|
||||
--
|
||||
2.24.0
|
||||
|
||||
|
||||
104
patches/api/0002-Ridables.patch
Normal file
104
patches/api/0002-Ridables.patch
Normal file
@@ -0,0 +1,104 @@
|
||||
From 58f629ff04510107d4e0005e5cfc3c614ecbcf52 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
|
||||
|
||||
---
|
||||
.../event/entity/RidableSpacebarEvent.java | 37 ++++++++++++++++++
|
||||
src/main/java/org/bukkit/entity/Entity.java | 38 +++++++++++++++++++
|
||||
2 files changed, 75 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/entity/RidableSpacebarEvent.java
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/RidableSpacebarEvent.java b/src/main/java/net/pl3x/purpur/event/entity/RidableSpacebarEvent.java
|
||||
new file mode 100644
|
||||
index 00000000..c0ec5a13
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/RidableSpacebarEvent.java
|
||||
@@ -0,0 +1,37 @@
|
||||
+package net.pl3x.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;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 5518ecd2..809021b2 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -656,4 +656,42 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@NotNull
|
||||
org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason();
|
||||
// Paper end
|
||||
+
|
||||
+ // 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();
|
||||
+
|
||||
+ /**
|
||||
+ * Check if shift is required to mount this entity
|
||||
+ *
|
||||
+ * @return True if shift is required
|
||||
+ */
|
||||
+ boolean requireShiftToMount();
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From c1200033ce45f4a05561b8f86f3a354014471567 Mon Sep 17 00:00:00 2001
|
||||
From 310e46f83be4cb38be1ba3e3c13683253d3cc45f Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 31 Dec 2019 23:00:07 -0600
|
||||
Subject: [PATCH] Remove pointless annotations and deprecations
|
||||
@@ -14,7 +14,7 @@ Subject: [PATCH] Remove pointless annotations and deprecations
|
||||
7 files changed, 9 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 5c39d73f2..10d0537d0 100644
|
||||
index 355bd2e2..50415189 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -807,13 +807,10 @@ public final class Bukkit {
|
||||
@@ -32,7 +32,7 @@ index 5c39d73f2..10d0537d0 100644
|
||||
public static OfflinePlayer getOfflinePlayer(@NotNull String name) {
|
||||
return server.getOfflinePlayer(name);
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 88b7d606c..97a981923 100644
|
||||
index 98e7ba90..248c32b0 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -672,13 +672,10 @@ public interface Server extends PluginMessageRecipient {
|
||||
@@ -50,7 +50,7 @@ index 88b7d606c..97a981923 100644
|
||||
public OfflinePlayer getOfflinePlayer(@NotNull String name);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/command/CommandExecutor.java b/src/main/java/org/bukkit/command/CommandExecutor.java
|
||||
index 45cb8da12..383b43e1b 100644
|
||||
index 45cb8da1..383b43e1 100644
|
||||
--- a/src/main/java/org/bukkit/command/CommandExecutor.java
|
||||
+++ b/src/main/java/org/bukkit/command/CommandExecutor.java
|
||||
@@ -19,5 +19,5 @@ public interface CommandExecutor {
|
||||
@@ -61,7 +61,7 @@ index 45cb8da12..383b43e1b 100644
|
||||
+ public boolean onCommand(CommandSender sender, Command command, String label, String[] args); // Purpur - remove pointless annotations
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/command/TabCompleter.java b/src/main/java/org/bukkit/command/TabCompleter.java
|
||||
index e9cf71f5c..34d3462c7 100644
|
||||
index e9cf71f5..34d3462c 100644
|
||||
--- a/src/main/java/org/bukkit/command/TabCompleter.java
|
||||
+++ b/src/main/java/org/bukkit/command/TabCompleter.java
|
||||
@@ -23,5 +23,5 @@ public interface TabCompleter {
|
||||
@@ -72,7 +72,7 @@ index e9cf71f5c..34d3462c7 100644
|
||||
+ public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args); // Purpur - remove pointless annotations
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index d7d6a3e83..cf8d77491 100644
|
||||
index d7d6a3e8..cf8d7749 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -204,13 +204,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
@@ -100,7 +100,7 @@ index d7d6a3e83..cf8d77491 100644
|
||||
ItemMeta meta = getItemMeta();
|
||||
return (meta == null) ? 0 : (short) ((Damageable) meta).getDamage();
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
|
||||
index 04fa3991f..24d65491c 100644
|
||||
index 04fa3991..24d65491 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
|
||||
@@ -287,7 +287,7 @@ public abstract class JavaPlugin extends PluginBase {
|
||||
@@ -122,7 +122,7 @@ index 04fa3991f..24d65491c 100644
|
||||
}
|
||||
|
||||
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
index a48be38b1..951b81e79 100644
|
||||
index a48be38b..951b81e7 100644
|
||||
--- a/src/test/java/org/bukkit/AnnotationTest.java
|
||||
+++ b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
@@ -41,6 +41,11 @@ public class AnnotationTest {
|
||||
@@ -1,47 +0,0 @@
|
||||
From 1e48e4bb7fdee96019ee7217e9826aaa8df2c14c Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:21:23 -0500
|
||||
Subject: [PATCH] cows to mooshroom when fed mushrooms
|
||||
|
||||
---
|
||||
.../paper/event/entity/EntityTransformedEvent.java | 6 ++++++
|
||||
.../java/org/bukkit/event/entity/EntityTransformEvent.java | 6 ++++++
|
||||
2 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java
|
||||
index 12194f1fc..8b2e533d3 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java
|
||||
@@ -83,6 +83,12 @@ public class EntityTransformedEvent extends EntityEvent implements Cancellable {
|
||||
* When a mooshroom turns to a cow
|
||||
*/
|
||||
SHEARED,
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * When a cow turns to a mooshroom
|
||||
+ */
|
||||
+ SHROOMED,
|
||||
+ // Purpur end
|
||||
/**
|
||||
* When a pig turns to a zombiepigman
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityTransformEvent.java b/src/main/java/org/bukkit/event/entity/EntityTransformEvent.java
|
||||
index 1370380ae..b1c265194 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityTransformEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityTransformEvent.java
|
||||
@@ -96,6 +96,12 @@ public class EntityTransformEvent extends EntityEvent implements Cancellable {
|
||||
* When a mooshroom (or MUSHROOM_COW) is sheared and a cow spawns.
|
||||
*/
|
||||
SHEARED,
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * When a cow turns to a mooshroom
|
||||
+ */
|
||||
+ SHROOMED,
|
||||
+ // Purpur end
|
||||
/**
|
||||
* When lightning strikes a entity.
|
||||
*/
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 7a311ecfaa92372c2c11233b1d68fe4b46f4262f Mon Sep 17 00:00:00 2001
|
||||
From feca342eda755a4e536ec48a4c1d528c80a35402 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
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Allow inventory resizing
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
index 75e719ae8..fb7abc2a5 100644
|
||||
index 10c3b6d7..931e5ff7 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
|
||||
@@ -128,7 +128,7 @@ public enum InventoryType {
|
||||
@@ -34,5 +34,5 @@ index 75e719ae8..fb7abc2a5 100644
|
||||
return size;
|
||||
}
|
||||
--
|
||||
2.23.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2fa5ae33c37672f73d97561789f802555505ab5a Mon Sep 17 00:00:00 2001
|
||||
From 4d187d87c842770caedf16ca9f051fd1b3732d9d 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] Implement AFK API
|
||||
@@ -11,7 +11,7 @@ Subject: [PATCH] Implement AFK API
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/PlayerAFKEvent.java b/src/main/java/net/pl3x/purpur/event/PlayerAFKEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..4db334854
|
||||
index 00000000..4db33485
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/PlayerAFKEvent.java
|
||||
@@ -0,0 +1,70 @@
|
||||
@@ -86,7 +86,7 @@ index 000000000..4db334854
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 877ea4f32..b9fe2a0fa 100644
|
||||
index 877ea4f3..b9fe2a0f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2067,4 +2067,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1,62 +0,0 @@
|
||||
From ec82ba52f74b2cd9cb328e4ee9424b30f2e5c018 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 06:08:35 -0500
|
||||
Subject: [PATCH] Integrate ridables
|
||||
|
||||
---
|
||||
.../java/org/bukkit/entity/LivingEntity.java | 14 ++++++++++++++
|
||||
src/main/java/org/bukkit/entity/Mob.java | 16 ++++++++++++++++
|
||||
2 files changed, 30 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index f47a6869f..3a8961853 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -696,5 +696,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param safeFallDistance Safe fall distance
|
||||
*/
|
||||
void setSafeFallDistance(float safeFallDistance);
|
||||
+
|
||||
+ /**
|
||||
+ * Whether or not this entity can be ridden in water
|
||||
+ *
|
||||
+ * @return Whether or not this entity can be ridden in water
|
||||
+ */
|
||||
+ boolean canBeRiddenInWater();
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether or not this entity can be ridden in water
|
||||
+ *
|
||||
+ * @param canBeRiddenInWater Whether or not this entity can be ridden in water
|
||||
+ */
|
||||
+ void setCanBeRiddenInWater(boolean canBeRiddenInWater);
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
|
||||
index 784db447d..b3a9c1a45 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Mob.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Mob.java
|
||||
@@ -42,4 +42,20 @@ public interface Mob extends LivingEntity, Lootable {
|
||||
*/
|
||||
@Nullable
|
||||
public LivingEntity getTarget();
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get if this mob is ridable
|
||||
+ *
|
||||
+ * @return True if ridable
|
||||
+ */
|
||||
+ boolean isRidable();
|
||||
+
|
||||
+ /**
|
||||
+ * Set if this mob is ridable
|
||||
+ *
|
||||
+ * @param ridable True to make ridable
|
||||
+ */
|
||||
+ void setRidable(boolean ridable);
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 4caa1b9ad55df3d7d832905898fd2866d9871f13 Mon Sep 17 00:00:00 2001
|
||||
From 8f4805c659215292c3cc6ae82997f07764f28654 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 11 Jan 2020 23:12:00 -0600
|
||||
Subject: [PATCH] Add EntityPortalReadyEvent
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Add EntityPortalReadyEvent
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/EntityPortalReadyEvent.java b/src/main/java/net/pl3x/purpur/event/entity/EntityPortalReadyEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..37f11c104
|
||||
index 00000000..37f11c10
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/EntityPortalReadyEvent.java
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -1,25 +1,25 @@
|
||||
From ba6cb31517bc0cdeb1fb90caf3eb3bbc8d58c617 Mon Sep 17 00:00:00 2001
|
||||
From cf027551379cf75f6751acda9b3e8d1dc5b75dc1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 30 Jan 2020 00:41:08 -0600
|
||||
Subject: [PATCH] Add tick times API
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/Bukkit.java | 19 +++++++++++++++++++
|
||||
src/main/java/org/bukkit/Server.java | 15 +++++++++++++++
|
||||
2 files changed, 34 insertions(+)
|
||||
src/main/java/org/bukkit/Bukkit.java | 20 ++++++++++++++++++++
|
||||
src/main/java/org/bukkit/Server.java | 17 +++++++++++++++++
|
||||
2 files changed, 37 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 10d0537d0..d49cf61b4 100644
|
||||
index 50415189..36e48723 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1634,6 +1634,25 @@ public final class Bukkit {
|
||||
public static boolean isLagging() {
|
||||
return server.isLagging();
|
||||
@@ -1620,4 +1620,24 @@ public final class Bukkit {
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the last 100 tick times (in nanos)
|
||||
+ *
|
||||
+ * @return Last 100 tick times (in nanos)
|
||||
+ */
|
||||
+ @NotNull
|
||||
@@ -35,18 +35,18 @@ index 10d0537d0..d49cf61b4 100644
|
||||
+ public static double getAverageTickTime() {
|
||||
+ return server == null ? 0D : server.getAverageTickTime();
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
@NotNull
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 97a981923..f98c6a046 100644
|
||||
index 248c32b0..c28cc59c 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1428,5 +1428,20 @@ public interface Server extends PluginMessageRecipient {
|
||||
* @return True if lagging
|
||||
@@ -1413,4 +1413,21 @@ public interface Server extends PluginMessageRecipient {
|
||||
*/
|
||||
boolean isLagging();
|
||||
int getCurrentTick();
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the last 100 tick times (in nanos)
|
||||
+ *
|
||||
@@ -61,7 +61,7 @@ index 97a981923..f98c6a046 100644
|
||||
+ * @return Average tick time (in millis)
|
||||
+ */
|
||||
+ double getAverageTickTime();
|
||||
// Purpur end
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.24.0
|
||||
@@ -1,22 +1,21 @@
|
||||
From e51447a1efd39253f34151d4229b2f68ac2a4328 Mon Sep 17 00:00:00 2001
|
||||
From 9c988f7504d9e12aca27e2835286ef100b5a4b43 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
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/Bukkit.java | 11 +++++++++++
|
||||
src/main/java/org/bukkit/Server.java | 9 +++++++++
|
||||
2 files changed, 20 insertions(+)
|
||||
src/main/java/org/bukkit/Bukkit.java | 9 +++++++++
|
||||
src/main/java/org/bukkit/Server.java | 7 +++++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 355bd2e22..79560dcca 100644
|
||||
index 36e48723..451dc570 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1619,6 +1619,17 @@ public final class Bukkit {
|
||||
@@ -1622,6 +1622,15 @@ public final class Bukkit {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Purpur start - bring back server name
|
||||
// Purpur start
|
||||
+ /**
|
||||
+ * Get the name of this server
|
||||
+ * @return the name of the server
|
||||
@@ -25,29 +24,28 @@ index 355bd2e22..79560dcca 100644
|
||||
+ public static String getServerName() {
|
||||
+ return server.getServerName();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@NotNull
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
/**
|
||||
* Get the last 100 tick times (in nanos)
|
||||
* @return Last 100 tick times (in nanos)
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 98e7ba900..863da99d4 100644
|
||||
index c28cc59c..57bb2dde 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1416,4 +1416,13 @@ public interface Server extends PluginMessageRecipient {
|
||||
*/
|
||||
int getCurrentTick();
|
||||
@@ -1415,6 +1415,13 @@ public interface Server extends PluginMessageRecipient {
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start - bring back server name
|
||||
|
||||
// Purpur start
|
||||
+ /**
|
||||
+ * Get the name of this server
|
||||
+ * @return the name of the server
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ String getServerName();
|
||||
+ // Purpur end
|
||||
}
|
||||
+
|
||||
/**
|
||||
* Get the last 100 tick times (in nanos)
|
||||
*
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 79e01bbeefe94343e21159ad58547e0af028ea5b Mon Sep 17 00:00:00 2001
|
||||
From d98d5e617a7514cd7b899a2d0fb8da7588b5c934 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 5 May 2019 12:58:19 -0500
|
||||
Subject: [PATCH] Implement LivingEntity safeFallDistance
|
||||
@@ -8,12 +8,12 @@ Subject: [PATCH] Implement LivingEntity safeFallDistance
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index a78f390d7..f47a6869f 100644
|
||||
index 77f4246d..2e1e27b0 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -681,4 +681,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -701,4 +701,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
*/
|
||||
boolean isHandRaised();
|
||||
void setJumping(boolean jumping);
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
@@ -33,5 +33,5 @@ index a78f390d7..f47a6869f 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From b83812676462910150c6547ac1e5249c10cb5783 Mon Sep 17 00:00:00 2001
|
||||
From 274c8049b8a80b1677134d12cabff19a0bfbad2e 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] Add ExecuteCommandEvent
|
||||
@@ -11,7 +11,7 @@ Subject: [PATCH] Add ExecuteCommandEvent
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/ExecuteCommandEvent.java b/src/main/java/net/pl3x/purpur/event/ExecuteCommandEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..3250bd4dc
|
||||
index 00000000..3250bd4d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/ExecuteCommandEvent.java
|
||||
@@ -0,0 +1,130 @@
|
||||
@@ -146,7 +146,7 @@ index 000000000..3250bd4dc
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
index 460fda05a..1e0eb0999 100644
|
||||
index 460fda05..1e0eb099 100644
|
||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
@@ -147,6 +147,19 @@ public class SimpleCommandMap implements CommandMap {
|
||||
@@ -179,5 +179,5 @@ index 460fda05a..1e0eb0999 100644
|
||||
} catch (CommandException ex) {
|
||||
server.getPluginManager().callEvent(new ServerExceptionEvent(new ServerCommandException(ex, target, sender, args))); // Paper
|
||||
--
|
||||
2.23.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From f8e61f206d1d08534ccdfea936d48944e776113a Mon Sep 17 00:00:00 2001
|
||||
From b94ddbb2afac2538d00ac7adf6080f9e8a5e7d2e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 12 Jul 2019 02:09:58 -0500
|
||||
Subject: [PATCH] Implement ChunkTooLargeEvent
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Implement ChunkTooLargeEvent
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/ChunkTooLargeEvent.java b/src/main/java/net/pl3x/purpur/event/ChunkTooLargeEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..f9d4a42c6
|
||||
index 00000000..f9d4a42c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/ChunkTooLargeEvent.java
|
||||
@@ -0,0 +1,109 @@
|
||||
@@ -124,5 +124,5 @@ index 000000000..f9d4a42c6
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.23.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 41324ce78820672bb1261893cceefd11d6022bd0 Mon Sep 17 00:00:00 2001
|
||||
From ae537506a49446a9f91e2fec2bfc636debe99fe4 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] Implement lagging threshold
|
||||
@@ -9,14 +9,13 @@ Subject: [PATCH] Implement lagging threshold
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 79560dcca..5c39d73f2 100644
|
||||
index 451dc570..7bdd962b 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1628,6 +1628,15 @@ public final class Bukkit {
|
||||
public static String getServerName() {
|
||||
@@ -1631,6 +1631,15 @@ public final class Bukkit {
|
||||
return server.getServerName();
|
||||
}
|
||||
+
|
||||
|
||||
+ /**
|
||||
+ * Check if server is lagging according to laggy threshold setting
|
||||
+ *
|
||||
@@ -25,26 +24,28 @@ index 79560dcca..5c39d73f2 100644
|
||||
+ public static boolean isLagging() {
|
||||
+ return server.isLagging();
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
@NotNull
|
||||
+
|
||||
/**
|
||||
* Get the last 100 tick times (in nanos)
|
||||
* @return Last 100 tick times (in nanos)
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 863da99d4..88b7d606c 100644
|
||||
index 57bb2dde..ca195120 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1424,5 +1424,12 @@ public interface Server extends PluginMessageRecipient {
|
||||
*/
|
||||
@@ -1422,6 +1422,13 @@ public interface Server extends PluginMessageRecipient {
|
||||
@NotNull
|
||||
String getServerName();
|
||||
+
|
||||
|
||||
+ /**
|
||||
+ * Check if server is lagging according to laggy threshold setting
|
||||
+ *
|
||||
+ * @return True if lagging
|
||||
+ */
|
||||
+ boolean isLagging();
|
||||
// Purpur end
|
||||
}
|
||||
+
|
||||
/**
|
||||
* Get the last 100 tick times (in nanos)
|
||||
*
|
||||
--
|
||||
2.24.0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 75d012a30e129dfce7a9d17c99e2e69399f48e3f Mon Sep 17 00:00:00 2001
|
||||
From e65b38277758c8b2133f679404b5ec33a70fd072 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 31 May 2019 21:24:21 -0500
|
||||
Subject: [PATCH] Advancement API Additions
|
||||
@@ -1,4 +1,4 @@
|
||||
From 9bf10e66e9db9009871610710edb16a8ce420688 Mon Sep 17 00:00:00 2001
|
||||
From ffb5a9e257eb752cc814a8c2ad34281fc0cbcedd Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 16:37:04 -0500
|
||||
Subject: [PATCH] Implement ItemFactory#getMonsterEgg
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Implement ItemFactory#getMonsterEgg
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
index 03ba22659..630c15d23 100644
|
||||
index 03ba2265..630c15d2 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
@@ -166,4 +166,15 @@ public interface ItemFactory {
|
||||
@@ -28,5 +28,5 @@ index 03ba22659..630c15d23 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.23.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 0d962b82c49e96e14993d5dda1422e617dd5d3c6 Mon Sep 17 00:00:00 2001
|
||||
From 2bc86d35277b1f10a66da66679ebad753cc5e2e6 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] Implement PlayerSetSpawnerTypeWithEggEvent
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Implement PlayerSetSpawnerTypeWithEggEvent
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java b/src/main/java/net/pl3x/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..c050b75e9
|
||||
index 00000000..c050b75e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java
|
||||
@@ -0,0 +1,85 @@
|
||||
@@ -100,5 +100,5 @@ index 000000000..c050b75e9
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.23.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 32f1ce9130091a21f6e05bfc6a655ae7d8d91cac Mon Sep 17 00:00:00 2001
|
||||
From f9b7f2c2980f030dac545c5968f53ff0336919ee Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 03:20:49 -0500
|
||||
Subject: [PATCH] Add MonsterEggSpawnEvent
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Add MonsterEggSpawnEvent
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java b/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..983d67234
|
||||
index 00000000..983d6723
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java
|
||||
@@ -0,0 +1,67 @@
|
||||
@@ -82,5 +82,5 @@ index 000000000..983d67234
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From f3d4ab537b7cd73292713f6571fe36c876910483 Mon Sep 17 00:00:00 2001
|
||||
From 2cc5826c577ada95c503685def71ca2229fc42b2 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 03:27:55 -0500
|
||||
Subject: [PATCH] Add ThrownEggHatchEvent
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Add ThrownEggHatchEvent
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/ThrownEggHatchEvent.java b/src/main/java/net/pl3x/purpur/event/entity/ThrownEggHatchEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..815e871d0
|
||||
index 00000000..815e871d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/ThrownEggHatchEvent.java
|
||||
@@ -0,0 +1,113 @@
|
||||
@@ -128,5 +128,5 @@ index 000000000..815e871d0
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
From 5c6ebf213cb5ff0c16fb1c8f2e7721b666873ae7 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 23:58:29 -0500
|
||||
Subject: [PATCH] Add block and fluid tick events
|
||||
|
||||
---
|
||||
.../purpur/event/block/BlockTickEvent.java | 55 +++++++++++++++++++
|
||||
.../purpur/event/block/FluidTickEvent.java | 55 +++++++++++++++++++
|
||||
src/main/java/org/bukkit/World.java | 30 ++++++++++
|
||||
3 files changed, 140 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/block/BlockTickEvent.java
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/block/FluidTickEvent.java
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/block/BlockTickEvent.java b/src/main/java/net/pl3x/purpur/event/block/BlockTickEvent.java
|
||||
new file mode 100644
|
||||
index 00000000..02787304
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/block/BlockTickEvent.java
|
||||
@@ -0,0 +1,55 @@
|
||||
+package net.pl3x.purpur.event.block;
|
||||
+
|
||||
+import org.bukkit.World;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a block is ticked by the server.
|
||||
+ */
|
||||
+public class BlockTickEvent extends BlockEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final boolean isRandomTick;
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ public BlockTickEvent(@NotNull World world, int x, int y, int z) {
|
||||
+ this(world, x, y, z, false);
|
||||
+ }
|
||||
+
|
||||
+ public BlockTickEvent(@NotNull World world, int x, int y, int z, boolean isRandomTick) {
|
||||
+ super(world.getBlockAt(x, y, z));
|
||||
+ this.isRandomTick = isRandomTick;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Check if this is a random tick
|
||||
+ *
|
||||
+ * @return True if random
|
||||
+ */
|
||||
+ public boolean isRandomTick() {
|
||||
+ return isRandomTick;
|
||||
+ }
|
||||
+
|
||||
+ @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;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/block/FluidTickEvent.java b/src/main/java/net/pl3x/purpur/event/block/FluidTickEvent.java
|
||||
new file mode 100644
|
||||
index 00000000..1a8f0b67
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/block/FluidTickEvent.java
|
||||
@@ -0,0 +1,55 @@
|
||||
+package net.pl3x.purpur.event.block;
|
||||
+
|
||||
+import org.bukkit.World;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a fluid is ticked by the server.
|
||||
+ */
|
||||
+public class FluidTickEvent extends BlockEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final boolean isRandomTick;
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ public FluidTickEvent(@NotNull World world, int x, int y, int z) {
|
||||
+ this(world, x, y, z, false);
|
||||
+ }
|
||||
+
|
||||
+ public FluidTickEvent(@NotNull World world, int x, int y, int z, boolean isRandomTick) {
|
||||
+ super(world.getBlockAt(x, y, z));
|
||||
+ this.isRandomTick = isRandomTick;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Check if this is a random tick
|
||||
+ *
|
||||
+ * @return True if random
|
||||
+ */
|
||||
+ public boolean isRandomTick() {
|
||||
+ return isRandomTick;
|
||||
+ }
|
||||
+
|
||||
+ @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;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 5047be15..c12d0efc 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3117,6 +3117,36 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
@NotNull
|
||||
public List<Raid> getRaids();
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get if {@link net.pl3x.purpur.event.block.BlockTickEvent} is enabled for this world
|
||||
+ *
|
||||
+ * @return True if enabled
|
||||
+ */
|
||||
+ boolean isBlockTickEventEnabled();
|
||||
+
|
||||
+ /**
|
||||
+ * Set if {@link net.pl3x.purpur.event.block.BlockTickEvent} is enabled for this world
|
||||
+ *
|
||||
+ * @param enabled True to enable
|
||||
+ */
|
||||
+ void setBlockTickEventEnabled(boolean enabled);
|
||||
+
|
||||
+ /**
|
||||
+ * Get if {@link net.pl3x.purpur.event.block.FluidTickEvent} is enabled for this world
|
||||
+ *
|
||||
+ * @return True if enabled
|
||||
+ */
|
||||
+ boolean isFluidTickEventEnabled();
|
||||
+
|
||||
+ /**
|
||||
+ * Set if {@link net.pl3x.purpur.event.block.FluidTickEvent} is enabled for this world
|
||||
+ *
|
||||
+ * @param enabled True to enable
|
||||
+ */
|
||||
+ void setFluidTickEventEnabled(boolean enabled);
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* Represents various map environment types that a world may be
|
||||
*/
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
From 08f61132cb4349e6e64d37f4bd67fb233ede48f7 Mon Sep 17 00:00:00 2001
|
||||
From 5290786e816577b65635c4bf4f19a5c0161cbd01 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 1 Feb 2020 22:22:07 -0600
|
||||
Subject: [PATCH] Add moon phase API
|
||||
|
||||
---
|
||||
src/main/java/net/pl3x/purpur/MoonPhase.java | 36 ++++++++++++++++++++
|
||||
src/main/java/org/bukkit/World.java | 8 +++++
|
||||
2 files changed, 44 insertions(+)
|
||||
src/main/java/org/bukkit/World.java | 10 ++++++
|
||||
2 files changed, 46 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/MoonPhase.java
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/MoonPhase.java b/src/main/java/net/pl3x/purpur/MoonPhase.java
|
||||
@@ -52,14 +52,14 @@ index 00000000..f5ad98c6
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 07e0f604..7566d701 100644
|
||||
index 5047be15..80d63e25 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3155,6 +3155,14 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
*/
|
||||
@@ -3117,6 +3117,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
@NotNull
|
||||
BlockData getPlacementBlockData(@NotNull BlockData blockData, @NotNull Location location);
|
||||
+
|
||||
public List<Raid> getRaids();
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the moon phase of the world at the current time
|
||||
+ *
|
||||
@@ -67,9 +67,11 @@ index 07e0f604..7566d701 100644
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ net.pl3x.purpur.MoonPhase getMoonPhase();
|
||||
// Purpur end
|
||||
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* Represents various map environment types that a world may be
|
||||
*/
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 559bc1e8985c4eac9aec6b3e33b8e9f269279860 Mon Sep 17 00:00:00 2001
|
||||
From 4ab0e022aceb013cac96033a9831f04f773a42ab Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 7 Oct 2019 00:15:28 -0500
|
||||
Subject: [PATCH] Add API for Villager#resetOffers()
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Add API for Villager#resetOffers()
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
||||
index ef48ad9b2..2bb9f768b 100644
|
||||
index ef48ad9b..2bb9f768 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -96,6 +96,13 @@ public interface Villager extends AbstractVillager {
|
||||
@@ -26,5 +26,5 @@ index ef48ad9b2..2bb9f768b 100644
|
||||
* Represents Villager type, usually corresponding to what biome they spawn
|
||||
* in.
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 0d5448283a81da963c941a60293006682b6c1e07 Mon Sep 17 00:00:00 2001
|
||||
From a3f61fb19e894e0cfa62861f71d831da596b7e56 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 22:19:31 -0500
|
||||
Subject: [PATCH] Expose getItemStack for Trident
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Expose getItemStack for Trident
|
||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Trident.java b/src/main/java/org/bukkit/entity/Trident.java
|
||||
index 3379ef9ba..27f19074e 100644
|
||||
index 3379ef9b..27f19074 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Trident.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Trident.java
|
||||
@@ -3,4 +3,14 @@ package org.bukkit.entity;
|
||||
@@ -28,5 +28,5 @@ index 3379ef9ba..27f19074e 100644
|
||||
+ // Purpur end
|
||||
+}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 8396505c1ca9dc7b9a9980c8f5e1dbdc5d86a387 Mon Sep 17 00:00:00 2001
|
||||
From 82710ce4f071a88af2810cd1fb22f102e8c19f16 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] Add more llama API
|
||||
@@ -13,7 +13,7 @@ Subject: [PATCH] Add more llama API
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/LlamaJoinCaravanEvent.java b/src/main/java/net/pl3x/purpur/event/entity/LlamaJoinCaravanEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..6e68c1399
|
||||
index 00000000..6e68c139
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/LlamaJoinCaravanEvent.java
|
||||
@@ -0,0 +1,61 @@
|
||||
@@ -80,7 +80,7 @@ index 000000000..6e68c1399
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/LlamaLeaveCaravanEvent.java b/src/main/java/net/pl3x/purpur/event/entity/LlamaLeaveCaravanEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..ec8d978c2
|
||||
index 00000000..ec8d978c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/LlamaLeaveCaravanEvent.java
|
||||
@@ -0,0 +1,34 @@
|
||||
@@ -119,7 +119,7 @@ index 000000000..ec8d978c2
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java
|
||||
index d23226ccb..1ef9479c9 100644
|
||||
index d23226cc..1ef9479c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Llama.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Llama.java
|
||||
@@ -3,6 +3,7 @@ package org.bukkit.entity;
|
||||
@@ -197,5 +197,5 @@ index d23226ccb..1ef9479c9 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 5ca385b0adb500d67a5ae59cda74cbcbe05a2cc7 Mon Sep 17 00:00:00 2001
|
||||
From 1a90d723b2773b3f90a56661c62366449bb90a41 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 23:34:38 -0500
|
||||
Subject: [PATCH] Add entity jump API
|
||||
@@ -11,7 +11,7 @@ Subject: [PATCH] Add entity jump API
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/EntityJumpEvent.java b/src/main/java/net/pl3x/purpur/event/entity/EntityJumpEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..08546c01d
|
||||
index 00000000..08546c01
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/EntityJumpEvent.java
|
||||
@@ -0,0 +1,46 @@
|
||||
@@ -62,13 +62,13 @@ index 000000000..08546c01d
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 3a8961853..7196c1b79 100644
|
||||
index 2e1e27b0..cf9b6252 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -710,5 +710,26 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param canBeRiddenInWater Whether or not this entity can be ridden in water
|
||||
@@ -716,5 +716,26 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param safeFallDistance Safe fall distance
|
||||
*/
|
||||
void setCanBeRiddenInWater(boolean canBeRiddenInWater);
|
||||
void setSafeFallDistance(float safeFallDistance);
|
||||
+
|
||||
+ /**
|
||||
+ * Get entity jump state
|
||||
@@ -93,5 +93,5 @@ index 3a8961853..7196c1b79 100644
|
||||
// Purpur end
|
||||
}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From d39d81493739e7454eaa6d595e207971ed2bb086 Mon Sep 17 00:00:00 2001
|
||||
From 982bdd34f20dbf01dd5161f7c40954a923ec905f Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:28:53 -0500
|
||||
Subject: [PATCH] Add more evoker API
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Add more evoker API
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Evoker.java b/src/main/java/org/bukkit/entity/Evoker.java
|
||||
index f8d173adc..f2a03f7f8 100644
|
||||
index f8d173ad..f2a03f7f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Evoker.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Evoker.java
|
||||
@@ -64,4 +64,21 @@ public interface Evoker extends Spellcaster {
|
||||
@@ -34,5 +34,5 @@ index f8d173adc..f2a03f7f8 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 0961dfd2209679bbd2bf0f76de5a6c77bfca7eb1 Mon Sep 17 00:00:00 2001
|
||||
From b0a84079d3680d3de82ea32fefb46d479ba874e2 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:34:36 -0500
|
||||
Subject: [PATCH] Add getPlacementBlockData to World
|
||||
@@ -8,13 +8,13 @@ Subject: [PATCH] Add getPlacementBlockData to World
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index c12d0efc..07e0f604 100644
|
||||
index 80d63e25..3a0be100 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3145,6 +3145,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
* @param enabled True to enable
|
||||
@@ -3125,6 +3125,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
*/
|
||||
void setFluidTickEventEnabled(boolean enabled);
|
||||
@NotNull
|
||||
net.pl3x.purpur.MoonPhase getMoonPhase();
|
||||
+
|
||||
+ /**
|
||||
+ * Get the hypothetical BlockData that would apply if one tries to set the given BlockData
|
||||
@@ -1,4 +1,4 @@
|
||||
From 6469abdfd45c6db049434e337552f85b5f8cd87c Mon Sep 17 00:00:00 2001
|
||||
From 0712c2e0d32b466effab27107ba67554f7c20279 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 02:25:05 -0500
|
||||
Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 7196c1b79..5789b4584 100644
|
||||
index cf9b6252..34848e54 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -731,5 +731,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -737,5 +737,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param jumping Jump state
|
||||
*/
|
||||
void setJumping(boolean jumping);
|
||||
@@ -35,5 +35,5 @@ index 7196c1b79..5789b4584 100644
|
||||
// Purpur end
|
||||
}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 8012a7d2499ce4337afaec99eab86a337090bcdd Mon Sep 17 00:00:00 2001
|
||||
From 4d106e53be61ef261508b0d0446a8d6091046b5d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 02:35:24 -0500
|
||||
Subject: [PATCH] Add getPlayer to SkeletonHorseTrapEvent
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Add getPlayer to SkeletonHorseTrapEvent
|
||||
1 file changed, 24 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java
|
||||
index d79dbcd68..1ed3ea8fa 100644
|
||||
index d79dbcd6..1ed3ea8f 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java
|
||||
@@ -1,20 +1,30 @@
|
||||
@@ -64,5 +64,5 @@ index d79dbcd68..1ed3ea8fa 100644
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 180cfc574c9ad070004fd1ffc2681b454f657e3d Mon Sep 17 00:00:00 2001
|
||||
From 9ba4891ed833191457fd5c47ac6fea3b13a2b004 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 02:43:10 -0500
|
||||
Subject: [PATCH] Add LootableInventoryFirstFillEvent
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Add LootableInventoryFirstFillEvent
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/block/LootableInventoryFirstFillEvent.java b/src/main/java/net/pl3x/purpur/event/block/LootableInventoryFirstFillEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..ef8eafb7c
|
||||
index 00000000..ef8eafb7
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/block/LootableInventoryFirstFillEvent.java
|
||||
@@ -0,0 +1,42 @@
|
||||
@@ -57,5 +57,5 @@ index 000000000..ef8eafb7c
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 53543ffa1feb61f871821e93f329ba8f6f3d92d7 Mon Sep 17 00:00:00 2001
|
||||
From 59558c50dd67e0e2bc093f1f9b93e21a5c154fe3 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 03:53:46 -0500
|
||||
Subject: [PATCH] Add back EntityCreatePortalEvent for EnderDragon
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] Add back EntityCreatePortalEvent for EnderDragon
|
||||
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/PortalType.java b/src/main/java/org/bukkit/PortalType.java
|
||||
index 427cfbb8b..e23565323 100644
|
||||
index 427cfbb8..e2356532 100644
|
||||
--- a/src/main/java/org/bukkit/PortalType.java
|
||||
+++ b/src/main/java/org/bukkit/PortalType.java
|
||||
@@ -15,6 +15,13 @@ public enum PortalType {
|
||||
@@ -27,7 +27,7 @@ index 427cfbb8b..e23565323 100644
|
||||
* This is a custom Plugin portal.
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java b/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java
|
||||
index 397baaefd..7456240b4 100644
|
||||
index 397baaef..7456240b 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityCreatePortalEvent.java
|
||||
@@ -11,10 +11,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -43,5 +43,5 @@ index 397baaefd..7456240b4 100644
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final List<BlockState> blocks;
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
114
patches/api/0029-Implement-EntityMoveEvent.patch
Normal file
114
patches/api/0029-Implement-EntityMoveEvent.patch
Normal file
@@ -0,0 +1,114 @@
|
||||
From 59a1e6ab2110ae99aae09ae0ca6686493273c7a2 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 11 Feb 2020 21:56:38 -0600
|
||||
Subject: [PATCH] Implement EntityMoveEvent
|
||||
|
||||
---
|
||||
.../purpur/event/entity/EntityMoveEvent.java | 95 +++++++++++++++++++
|
||||
1 file changed, 95 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/entity/EntityMoveEvent.java
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/entity/EntityMoveEvent.java b/src/main/java/net/pl3x/purpur/event/entity/EntityMoveEvent.java
|
||||
new file mode 100644
|
||||
index 00000000..4aff85b3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/EntityMoveEvent.java
|
||||
@@ -0,0 +1,95 @@
|
||||
+package net.pl3x.purpur.event.entity;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import org.bukkit.Location;
|
||||
+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;
|
||||
+
|
||||
+/**
|
||||
+ * Holds information for living entity movement events
|
||||
+ */
|
||||
+public class EntityMoveEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean canceled;
|
||||
+ private Location from;
|
||||
+ private Location to;
|
||||
+
|
||||
+ public EntityMoveEvent(@NotNull LivingEntity entity, Location from, Location to) {
|
||||
+ super(entity);
|
||||
+ this.from = from;
|
||||
+ this.to = to;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public LivingEntity getEntity() {
|
||||
+ return (LivingEntity) entity;
|
||||
+ }
|
||||
+
|
||||
+ 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;
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From dfc3aa2e6ea6503caca1d62421854293475ee6f4 Mon Sep 17 00:00:00 2001
|
||||
From a60d5c4caadfc97a4281961be0be3a014c427fd5 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
|
||||
@@ -57,7 +57,7 @@ index 349a0ea21..d70c8cab2 100644
|
||||
// Paper end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 913511388..b737a0f0c 100644
|
||||
index 3c966b4ab..4e8a53d10 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -80,6 +80,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -755,7 +755,7 @@ index 000000000..f8cf4ad23
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
new file mode 100644
|
||||
index 000000000..6f378b5f6
|
||||
index 000000000..2c8125894
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -0,0 +1,133 @@
|
||||
@@ -779,7 +779,7 @@ index 000000000..6f378b5f6
|
||||
+import java.util.logging.Level;
|
||||
+
|
||||
+public class PurpurConfig {
|
||||
+ private static final int CONFIG_VERSION = 2;
|
||||
+ private static final int CONFIG_VERSION = 3;
|
||||
+ 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"
|
||||
@@ -987,7 +987,7 @@ index fc074a66c..daa94187f 100644
|
||||
ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index eb5f44e30..7e8b6cab7 100644
|
||||
index af05f3c1e..533cfe738 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -138,6 +138,14 @@ public class Main {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
||||
From 505b22ce9bd06e098892507d3232b4905f71072d 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)
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/GenericAttributes.java | 1 +
|
||||
.../net/minecraft/server/WorldGenFeatureConfigured.java | 3 ++-
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 9 +++++++++
|
||||
.../java/org/bukkit/craftbukkit/legacy/CraftLegacy.java | 1 +
|
||||
4 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/GenericAttributes.java b/src/main/java/net/minecraft/server/GenericAttributes.java
|
||||
index 469e293c2..ca58302cf 100644
|
||||
--- a/src/main/java/net/minecraft/server/GenericAttributes.java
|
||||
+++ b/src/main/java/net/minecraft/server/GenericAttributes.java
|
||||
@@ -79,6 +79,7 @@ public class GenericAttributes {
|
||||
AttributeInstance attributeinstance = attributemapbase.a(nbttagcompound.getString("Name"));
|
||||
|
||||
if (attributeinstance == null) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressUnknownAttributeWarnings) // Purpur
|
||||
GenericAttributes.LOGGER.warn("Ignoring unknown attribute '{}'", nbttagcompound.getString("Name"));
|
||||
} else {
|
||||
a(attributeinstance, nbttagcompound);
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java b/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java
|
||||
index de8f1874a..1c2320cc5 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java
|
||||
@@ -25,7 +25,7 @@ public class WorldGenFeatureConfigured<FC extends WorldGenFeatureConfiguration,
|
||||
public WorldGenFeatureConfigured<?, ?> a(WorldGenDecoratorConfigured<?> worldgendecoratorconfigured) {
|
||||
WorldGenerator<WorldGenFeatureCompositeConfiguration> worldgenerator = this.b instanceof WorldGenFlowers ? WorldGenerator.DECORATED_FLOWER : WorldGenerator.DECORATED;
|
||||
|
||||
- return worldgenerator.b((WorldGenFeatureConfiguration) (new WorldGenFeatureCompositeConfiguration(this, worldgendecoratorconfigured)));
|
||||
+ return worldgenerator.b(new WorldGenFeatureCompositeConfiguration(this, worldgendecoratorconfigured)); // Purpur - decompile error
|
||||
}
|
||||
|
||||
public WorldGenFeatureRandomChoiceConfigurationWeight<FC> a(float f) {
|
||||
@@ -47,6 +47,7 @@ public class WorldGenFeatureConfigured<FC extends WorldGenFeatureConfiguration,
|
||||
try {
|
||||
return new WorldGenFeatureConfigured<>(worldgenerator, dynamic.get("config").orElseEmptyMap());
|
||||
} catch (RuntimeException runtimeexception) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressWorldGenFeatureDeserializationError) // Purpur
|
||||
WorldGenFeatureConfigured.LOGGER.warn("Error while deserializing {}", s);
|
||||
return new WorldGenFeatureConfigured<>(WorldGenerator.NO_OP, WorldGenFeatureEmptyConfiguration.e);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 2c8125894..15458be9d 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -130,4 +130,13 @@ public class PurpurConfig {
|
||||
config.addDefault(path, def);
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
+
|
||||
+ public static boolean loggerSuppressUnknownAttributeWarnings = false;
|
||||
+ public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||
+ public static boolean loggerSuppressWorldGenFeatureDeserializationError = false;
|
||||
+ private static void loggerSettings() {
|
||||
+ loggerSuppressUnknownAttributeWarnings = getBoolean("settings.logger.suppress-unknown-attribute-warnings", loggerSuppressUnknownAttributeWarnings);
|
||||
+ loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
+ loggerSuppressWorldGenFeatureDeserializationError = getBoolean("settings.logger.suppress-world-gen-feature-deserialization-errors", loggerSuppressWorldGenFeatureDeserializationError);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index b31e91150..756786acc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
@@ -254,6 +254,7 @@ public final class CraftLegacy {
|
||||
}
|
||||
|
||||
static {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressInitLegacyMaterialError) // Purpur
|
||||
System.err.println("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!");
|
||||
if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDebugging()) {
|
||||
new Exception().printStackTrace();
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 8be74ef793ffcd377ddebaa4a23f47fe11ea68ed Mon Sep 17 00:00:00 2001
|
||||
From e4c12c793366f2255c8d4597eca02cb497978206 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
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Disable outdated build check
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 7e8b6cab7..fd0748582 100644
|
||||
index 533cfe738..2278cf716 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -220,7 +220,7 @@ public class Main {
|
||||
@@ -1,4 +1,4 @@
|
||||
From e73415b5d39a42a222870c3be5d3d27802d2a762 Mon Sep 17 00:00:00 2001
|
||||
From 567c3758d8780d1a51af541d6d9758df8164ae1a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Wed, 1 Jan 2020 20:12:39 -0600
|
||||
Subject: [PATCH] Add obfhelpers for plugin use
|
||||
@@ -30,10 +30,10 @@ index fb97c51bb..50ed4001d 100644
|
||||
return IChatBaseComponent.ChatSerializer.a.toJson(ichatbasecomponent);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index e9801022e..6cc8157a0 100644
|
||||
index d6e43313b..4730c2beb 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -616,6 +616,7 @@ public final class ItemStack {
|
||||
@@ -595,6 +595,7 @@ public final class ItemStack {
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From aedad81d1950f053f3b8e58cb61a1d1089f3a86c Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:58:44 -0500
|
||||
Subject: [PATCH] Snowman set pumpkin on/off by player interaction
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntitySnowman.java | 37 ++++++++++---------
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 7 ++++
|
||||
2 files changed, 27 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
index 07ca1a498..54404dd4b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
@@ -8,6 +8,7 @@ import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
|
||||
public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
||||
|
||||
+ private static final RecipeItemStack PUMPKIN = RecipeItemStack.a(Blocks.PUMPKIN.getItem(), Blocks.CARVED_PUMPKIN.getItem(), Blocks.JACK_O_LANTERN.getItem()); // Purpur
|
||||
private static final DataWatcherObject<Byte> b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a);
|
||||
|
||||
public EntitySnowman(EntityTypes<? extends EntitySnowman> entitytypes, World world) {
|
||||
@@ -113,25 +114,27 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
if (itemstack.getItem() == Items.SHEARS && this.hasPumpkin()) {
|
||||
- if (!this.world.isClientSide) {
|
||||
- // CraftBukkit start
|
||||
- PlayerShearEntityEvent event = new PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity());
|
||||
- this.world.getServer().getPluginManager().callEvent(event);
|
||||
-
|
||||
- if (event.isCancelled()) {
|
||||
- return false;
|
||||
- }
|
||||
- // CraftBukkit end
|
||||
- this.setHasPumpkin(false);
|
||||
- itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
||||
- entityhuman1.broadcastItemBreak(enumhand);
|
||||
- });
|
||||
+ // Purpur start
|
||||
+ if (!new PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity()).callEvent()) return false; // CraftBukkit
|
||||
+
|
||||
+ setHasPumpkin(false);
|
||||
+ itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
||||
+ entityhuman1.broadcastItemBreak(enumhand);
|
||||
+ });
|
||||
+
|
||||
+ if (net.pl3x.purpur.PurpurConfig.snowmanDropsPumpkin) {
|
||||
+ EntityItem pumpkin = new EntityItem(world, locX(), locY(), locZ(), new ItemStack(Blocks.CARVED_PUMPKIN.getItem()));
|
||||
+ pumpkin.pickupDelay = 10;
|
||||
+ world.addEntity(pumpkin);
|
||||
+ }
|
||||
+ } else if (net.pl3x.purpur.PurpurConfig.snowmanPumpkinPutBack && !hasPumpkin() && PUMPKIN.test(itemstack)) {
|
||||
+ setHasPumpkin(true);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
}
|
||||
-
|
||||
- return true;
|
||||
- } else {
|
||||
- return false;
|
||||
}
|
||||
+ return true;
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
public boolean hasPumpkin() {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 26e95035b..0c408a10c 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -135,4 +135,11 @@ public class PurpurConfig {
|
||||
private static void cowsSettings() {
|
||||
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||
}
|
||||
+
|
||||
+ public static boolean snowmanDropsPumpkin = false;
|
||||
+ public static boolean snowmanPumpkinPutBack = false;
|
||||
+ private static void snowmansSettings() {
|
||||
+ snowmanDropsPumpkin = getBoolean("settings.mobs.snow_golem.drops-pumpkin-when-sheared", snowmanDropsPumpkin);
|
||||
+ snowmanPumpkinPutBack = getBoolean("settings.mobs.snow_golem.pumpkin-can-be-added-back", snowmanPumpkinPutBack);
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
From 37fc918ff51a18259c863ec7b2185c7e5e70b996 Mon Sep 17 00:00:00 2001
|
||||
From b050b6599be26debdb0331044bcc0b6f326f0b9e 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
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/Block.java | 1 +
|
||||
.../net/minecraft/server/BlockMobSpawner.java | 35 +++++++++++++++++++
|
||||
.../net/minecraft/server/EntityTypes.java | 14 ++++++++
|
||||
.../net/minecraft/server/ItemSpawner.java | 23 ++++++++++++
|
||||
src/main/java/net/minecraft/server/Items.java | 2 +-
|
||||
5 files changed, 74 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
.../net/minecraft/server/BlockMobSpawner.java | 34 +++++++++++++++++++
|
||||
.../net/minecraft/server/EntityTypes.java | 12 +++++++
|
||||
3 files changed, 47 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index 54a61283e6..4d29faccaa 100644
|
||||
index e40375b67..b29ed1cfa 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -494,6 +494,7 @@ public class Block implements IMaterial {
|
||||
@@ -25,7 +22,7 @@ index 54a61283e6..4d29faccaa 100644
|
||||
if (!world.isClientSide && !itemstack.isEmpty() && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) {
|
||||
float f = 0.5F;
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockMobSpawner.java b/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
index 5296fdf168..901d45f284 100644
|
||||
index 5296fdf16..69d04f6cb 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
@@ -11,6 +11,40 @@ public class BlockMobSpawner extends BlockTileEntity {
|
||||
@@ -69,16 +66,8 @@ index 5296fdf168..901d45f284 100644
|
||||
@Override
|
||||
public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
||||
super.dropNaturally(iblockdata, world, blockposition, itemstack);
|
||||
@@ -23,6 +57,7 @@ public class BlockMobSpawner extends BlockTileEntity {
|
||||
|
||||
@Override
|
||||
public int getExpDrop(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
||||
+ if (isSilkTouch(itemstack)) return 0; // Purpur
|
||||
int i = 15 + world.random.nextInt(15) + world.random.nextInt(15);
|
||||
|
||||
return i;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index 2fb04e3e93..dcba6d6c89 100644
|
||||
index a0d932c40..0dd9897b9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -136,10 +136,17 @@ public class EntityTypes<T extends Entity> {
|
||||
@@ -99,20 +88,18 @@ index 2fb04e3e93..dcba6d6c89 100644
|
||||
public static Optional<EntityTypes<?>> a(String s) {
|
||||
return IRegistry.ENTITY_TYPE.getOptional(MinecraftKey.a(s));
|
||||
}
|
||||
@@ -259,6 +266,12 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bb;
|
||||
@@ -263,6 +270,10 @@ public class EntityTypes<T extends Entity> {
|
||||
public String getName() {
|
||||
return IRegistry.ENTITY_TYPE.getKey(this).getKey();
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+
|
||||
+ public String getTranslatedName() {
|
||||
+ return getNameComponent().getString();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// Purpur end
|
||||
|
||||
public String f() {
|
||||
if (this.bg == null) {
|
||||
this.bg = SystemUtils.a("entity", IRegistry.ENTITY_TYPE.getKey(this));
|
||||
@@ -267,6 +280,7 @@ public class EntityTypes<T extends Entity> {
|
||||
@@ -273,6 +284,7 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bg;
|
||||
}
|
||||
|
||||
@@ -120,48 +107,6 @@ index 2fb04e3e93..dcba6d6c89 100644
|
||||
public IChatBaseComponent g() {
|
||||
if (this.bh == null) {
|
||||
this.bh = new ChatMessage(this.f(), new Object[0]);
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemSpawner.java b/src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
new file mode 100644
|
||||
index 0000000000..7dc68ffe92
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
@@ -0,0 +1,23 @@
|
||||
+package net.minecraft.server;
|
||||
+
|
||||
+public class ItemSpawner extends ItemBlock {
|
||||
+ public ItemSpawner(Block block, Info info) {
|
||||
+ super(block, info);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected boolean a(BlockPosition blockposition, World world, EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) {
|
||||
+ boolean handled = super.a(blockposition, world, entityhuman, itemstack, iblockdata);
|
||||
+ if (entityhuman.getBukkitEntity().hasPermission("purpur.place.spawners")) {
|
||||
+ TileEntity spawner = world.getTileEntity(blockposition);
|
||||
+ if (spawner instanceof TileEntityMobSpawner && itemstack.hasTag()) {
|
||||
+ NBTTagCompound tag = itemstack.getTag();
|
||||
+ if (tag.hasKey("Purpur.mob_type")) {
|
||||
+ EntityTypes.getType(tag.getString("Purpur.mob_type")).ifPresent(type ->
|
||||
+ ((TileEntityMobSpawner) spawner).getSpawner().setMobName(type));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return handled;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java
|
||||
index 54670f64cf..282fbca4fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/Items.java
|
||||
+++ b/src/main/java/net/minecraft/server/Items.java
|
||||
@@ -155,7 +155,7 @@ public class Items {
|
||||
public static final Item bU = a(Blocks.PURPUR_BLOCK, CreativeModeTab.b);
|
||||
public static final Item bV = a(Blocks.PURPUR_PILLAR, CreativeModeTab.b);
|
||||
public static final Item bW = a(Blocks.PURPUR_STAIRS, CreativeModeTab.b);
|
||||
- public static final Item bX = a(Blocks.SPAWNER);
|
||||
+ public static final Item bX = a(Blocks.SPAWNER, new ItemSpawner(Blocks.SPAWNER, new Item.Info().a(EnumItemRarity.EPIC))); // Purpur
|
||||
public static final Item bY = a(Blocks.OAK_STAIRS, CreativeModeTab.b);
|
||||
public static final Item bZ = a(Blocks.CHEST, CreativeModeTab.c);
|
||||
public static final Item ca = a(Blocks.DIAMOND_ORE, CreativeModeTab.b);
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
From 14e75a22b2727e6dee6075860a42f6855535490d Mon Sep 17 00:00:00 2001
|
||||
From 3be371c521916516fcd485e69ba2ab29ce7d4aa4 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] Make giants naturally spawn and have AI
|
||||
Subject: [PATCH] Giants naturally spawn and have AI
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BiomeBase.java | 1 +
|
||||
.../java/net/minecraft/server/Biomes.java | 25 ++++++++++++
|
||||
.../minecraft/server/EntityGiantZombie.java | 39 +++++++++++++++++--
|
||||
.../java/net/minecraft/server/Biomes.java | 6 ++
|
||||
.../minecraft/server/EntityGiantZombie.java | 68 +++++++++++++++++--
|
||||
.../minecraft/server/EntityInsentient.java | 2 +
|
||||
.../net/minecraft/server/SpawnerCreature.java | 8 ++++
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 7 ++++
|
||||
6 files changed, 78 insertions(+), 4 deletions(-)
|
||||
.../net/minecraft/server/SpawnerCreature.java | 8 +++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 12 ++++
|
||||
6 files changed, 93 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
index 0102a170d..963709846 100644
|
||||
@@ -25,79 +25,47 @@ index 0102a170d..963709846 100644
|
||||
((List) this.v.get(enumcreaturetype)).add(biomebase_biomemeta);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Biomes.java b/src/main/java/net/minecraft/server/Biomes.java
|
||||
index 12742870c..d1f8695fe 100644
|
||||
index 12742870c..749016a1c 100644
|
||||
--- a/src/main/java/net/minecraft/server/Biomes.java
|
||||
+++ b/src/main/java/net/minecraft/server/Biomes.java
|
||||
@@ -92,5 +92,30 @@ public abstract class Biomes {
|
||||
|
||||
@@ -93,4 +93,10 @@ public abstract class Biomes {
|
||||
static {
|
||||
Collections.addAll(BiomeBase.b, new BiomeBase[]{Biomes.OCEAN, Biomes.PLAINS, Biomes.DESERT, Biomes.MOUNTAINS, Biomes.FOREST, Biomes.TAIGA, Biomes.SWAMP, Biomes.RIVER, Biomes.FROZEN_RIVER, Biomes.SNOWY_TUNDRA, Biomes.SNOWY_MOUNTAINS, Biomes.MUSHROOM_FIELDS, Biomes.MUSHROOM_FIELD_SHORE, Biomes.BEACH, Biomes.DESERT_HILLS, Biomes.WOODED_HILLS, Biomes.TAIGA_HILLS, Biomes.JUNGLE, Biomes.JUNGLE_HILLS, Biomes.JUNGLE_EDGE, Biomes.DEEP_OCEAN, Biomes.STONE_SHORE, Biomes.SNOWY_BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.DARK_FOREST, Biomes.SNOWY_TAIGA, Biomes.SNOWY_TAIGA_HILLS, Biomes.GIANT_TREE_TAIGA, Biomes.GIANT_TREE_TAIGA_HILLS, Biomes.WOODED_MOUNTAINS, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.BADLANDS, Biomes.WOODED_BADLANDS_PLATEAU, Biomes.BADLANDS_PLATEAU});
|
||||
+
|
||||
+ // Purpur start - add natural mob spawns (maybe find a better place for this?)
|
||||
+ if (net.pl3x.purpur.PurpurConfig.giantsNaturallySpawn) {
|
||||
+ addSpawn("plains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("sunflower_plains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("desert", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1);
|
||||
+ addSpawn("desert_hills", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1);
|
||||
+ addSpawn("desert_lakes", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1);
|
||||
+ addSpawn("mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("modified_gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("savanna", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("shattered_savanna", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("shattered_savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ addSpawn("badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
+ addSpawn("badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
+ addSpawn("eroded_badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
+ addSpawn("modified_badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static void addSpawn(String biome, EnumCreatureType ct, EntityTypes et, int weight, int min_group, int max_group) {
|
||||
+ IRegistry.BIOME.get(new MinecraftKey(biome)).addMobSpawn(ct, new BiomeBase.BiomeMeta(et, weight, min_group, max_group));
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ public static void addSpawn(String biome, EnumCreatureType ct, EntityTypes et, int weight, int min_group, int max_group) {
|
||||
+ IRegistry.BIOME.get(new MinecraftKey(biome)).addMobSpawn(ct, new BiomeBase.BiomeMeta(et, weight, min_group, max_group));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index 12a96750c..4aaf4ea6c 100644
|
||||
index ff8a41a53..d132a6105 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -21,14 +21,27 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
super.initAttributes();
|
||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(100.0D);
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
|
||||
- this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(50.0D);
|
||||
+ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(12.0D); // Purpur - match ravager damage
|
||||
@@ -23,6 +23,45 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
return world.purpurConfig.giantRequireShiftToMount;
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
- this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
- this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ if (net.pl3x.purpur.PurpurConfig.giantsHaveAI) {
|
||||
+ protected void initPathfinder() {
|
||||
+ if (world.purpurConfig.giantHaveAI) {
|
||||
+ this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
+ this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D));
|
||||
+ this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class));
|
||||
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
||||
+ this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
+ this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, true));
|
||||
+ if (world.purpurConfig.giantHaveHostileAI) {
|
||||
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class));
|
||||
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
||||
+ this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
+ this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, true));
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -37,10 +50,28 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
// 1.0 makes bottom of feet about as high as their waist when they jump
|
||||
return 1.0F;
|
||||
}
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess world, DifficultyDamageScaler difficulty, EnumMobSpawn enummobspawn, GroupDataEntity groupDataEntity, NBTTagCompound nbt) {
|
||||
@@ -112,23 +80,59 @@ index 12a96750c..4aaf4ea6c 100644
|
||||
+ @Override
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficulty) {
|
||||
+ super.setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ // TODO make configurable
|
||||
+ if (random.nextFloat() < (world.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.05F)) {
|
||||
+ setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
||||
+ }
|
||||
+ }
|
||||
// Purpur end
|
||||
+
|
||||
@Override
|
||||
public float getJumpHeight() {
|
||||
// make giants jump as high as everything else relative to their size
|
||||
@@ -39,13 +78,34 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
@Override
|
||||
protected void initAttributes() {
|
||||
super.initAttributes();
|
||||
- this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(100.0D);
|
||||
- this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
|
||||
- this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(50.0D);
|
||||
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.giantMaxHealth); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.giantMovementSpeed); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(world.purpurConfig.giantAttackDamage); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
- return iworldreader.w(blockposition) - 0.5F;
|
||||
+ return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns
|
||||
}
|
||||
+
|
||||
+ // Purpur start - TODO make configurable
|
||||
+ static {
|
||||
+ Biomes.addSpawn("plains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("sunflower_plains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("desert", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1);
|
||||
+ Biomes.addSpawn("desert_hills", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1);
|
||||
+ Biomes.addSpawn("desert_lakes", EnumCreatureType.MONSTER, EntityTypes.GIANT, 2, 1, 1);
|
||||
+ Biomes.addSpawn("mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("modified_gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("savanna", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("shattered_savanna", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("shattered_savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 5, 1, 1);
|
||||
+ Biomes.addSpawn("badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
+ Biomes.addSpawn("badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
+ Biomes.addSpawn("eroded_badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
+ Biomes.addSpawn("modified_badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 9aafac6db..89b45da1b 100644
|
||||
index b25ebcfd9..d1b4a2280 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -868,6 +868,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -863,6 +863,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -136,7 +140,7 @@ index 9aafac6db..89b45da1b 100644
|
||||
protected void a(DifficultyDamageScaler difficultydamagescaler) {
|
||||
if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) {
|
||||
int i = this.random.nextInt(2);
|
||||
@@ -975,6 +976,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -970,6 +971,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +149,7 @@ index 9aafac6db..89b45da1b 100644
|
||||
float f = difficultydamagescaler.d();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index 58bbf2f9d..53d590041 100644
|
||||
index 58bbf2f9d..71920d7f8 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -77,6 +77,14 @@ public final class SpawnerCreature {
|
||||
@@ -154,7 +158,7 @@ index 58bbf2f9d..53d590041 100644
|
||||
|
||||
+ // Purpur start
|
||||
+ if (entitytypes == EntityTypes.GIANT) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.giantsNaturallySpawn) {
|
||||
+ if (!worldserver.purpurConfig.giantNaturallySpawn) {
|
||||
+ return i;
|
||||
+ }
|
||||
+ }
|
||||
@@ -163,24 +167,35 @@ index 58bbf2f9d..53d590041 100644
|
||||
if (entitytypes.b() && a(chunkgenerator, enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) {
|
||||
EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(entitytypes);
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index c4955fae6..d7da38bf5 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -141,6 +141,13 @@ public class PurpurConfig {
|
||||
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index a61999063..8cdcca3bd 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -242,12 +242,24 @@ public class PurpurWorldConfig {
|
||||
public boolean giantRequireShiftToMount = true;
|
||||
public float giantStepHeight = 2.0F;
|
||||
public float giantJumpHeight = 1.0F;
|
||||
+ public double giantMaxHealth = 100.0D;
|
||||
+ public double giantMovementSpeed = 0.5D;
|
||||
+ public double giantAttackDamage = 50.0D;
|
||||
+ public boolean giantNaturallySpawn = false;
|
||||
+ 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);
|
||||
giantRequireShiftToMount = getBoolean("mobs.giant.require-shift-to-mount", giantRequireShiftToMount);
|
||||
giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||
giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||
+ giantMaxHealth = getDouble("mobs.giant.max-health", giantMaxHealth);
|
||||
+ giantMovementSpeed = getDouble("mobs.giant.movement-speed", giantMovementSpeed);
|
||||
+ giantAttackDamage = getDouble("mobs.giant.attack-damage", giantAttackDamage);
|
||||
+ giantNaturallySpawn = getBoolean("mobs.giant.naturally-spawn", giantNaturallySpawn);
|
||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
}
|
||||
|
||||
+ public static boolean giantsNaturallySpawn = true;
|
||||
+ public static boolean giantsHaveAI = true;
|
||||
+ private static void giantsSettings() {
|
||||
+ giantsNaturallySpawn = getBoolean("settings.mobs.giant.naturally-spawn", giantsNaturallySpawn);
|
||||
+ giantsHaveAI = getBoolean("settings.mobs.giant.have-ai", giantsHaveAI);
|
||||
+ }
|
||||
+
|
||||
public static double crystalsAttackPhantomsRadius = 0.0D;
|
||||
public static float crystalsAttackPhantomDamage = 1.0F;
|
||||
public static double phantomsOrbitCrystalsRadius = 0.0D;
|
||||
public boolean guardianRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
95
patches/server/0009-Illusioners-naturally-spawn.patch
Normal file
95
patches/server/0009-Illusioners-naturally-spawn.patch
Normal file
@@ -0,0 +1,95 @@
|
||||
From 939a05a47fad8fee743409e57cf78a26a1f3bae3 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 11:09:25 -0500
|
||||
Subject: [PATCH] Illusioners naturally spawn
|
||||
|
||||
---
|
||||
.../server/EntityIllagerIllusioner.java | 27 ++++++++++++++++---
|
||||
.../net/minecraft/server/SpawnerCreature.java | 4 +++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 8 ++++++
|
||||
3 files changed, 36 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
index 3e6722cfc..9af93c636 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
@@ -58,9 +58,9 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
@Override
|
||||
protected void initAttributes() {
|
||||
super.initAttributes();
|
||||
- this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
|
||||
- this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(18.0D);
|
||||
- this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(32.0D);
|
||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.illusionerMovementSpeed); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(world.purpurConfig.illusionerFollowRange); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.illusionerMaxHealth); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -253,4 +253,25 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
return EntityIllagerWizard.Spell.DISAPPEAR;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ static {
|
||||
+ Biomes.addSpawn("plains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("sunflower_plains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("desert", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("desert_hills", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("desert_lakes", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("mountains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("modified_gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("savanna", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("shattered_savanna", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("shattered_savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ Biomes.addSpawn("badlands", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 10, 1, 1);
|
||||
+ Biomes.addSpawn("badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 10, 1, 1);
|
||||
+ Biomes.addSpawn("eroded_badlands", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 10, 1, 1);
|
||||
+ Biomes.addSpawn("modified_badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 10, 1, 1);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index 71920d7f8..2e868f5d5 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -82,6 +82,10 @@ public final class SpawnerCreature {
|
||||
if (!worldserver.purpurConfig.giantNaturallySpawn) {
|
||||
return i;
|
||||
}
|
||||
+ } else if (entitytypes == EntityTypes.ILLUSIONER) {
|
||||
+ if (!worldserver.purpurConfig.illusionerNaturallySpawn) {
|
||||
+ return i;
|
||||
+ }
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 8cdcca3bd..8d6d25272 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -288,10 +288,18 @@ public class PurpurWorldConfig {
|
||||
public boolean illusionerRidable = false;
|
||||
public boolean illusionerRidableInWater = false;
|
||||
public boolean illusionerRequireShiftToMount = true;
|
||||
+ public boolean illusionerNaturallySpawn = false;
|
||||
+ public double illusionerMaxHealth = 32.0D;
|
||||
+ public double illusionerMovementSpeed = 0.5D;
|
||||
+ public double illusionerFollowRange = 18.0D;
|
||||
private void illusionerSettings() {
|
||||
illusionerRidable = getBoolean("mobs.illusioner.ridable", illusionerRidable);
|
||||
illusionerRidableInWater = getBoolean("mobs.illusioner.ridable-in-water", illusionerRidableInWater);
|
||||
illusionerRequireShiftToMount = getBoolean("mobs.illusioner.require-shift-to-mount", illusionerRequireShiftToMount);
|
||||
+ illusionerNaturallySpawn = getBoolean("mobs.illusioner.naturally-spawn", illusionerNaturallySpawn);
|
||||
+ illusionerMaxHealth = getDouble("mobs.illusioner.max-health", illusionerMaxHealth);
|
||||
+ illusionerMovementSpeed = getDouble("mobs.illusioner.movement-speed", illusionerMovementSpeed);
|
||||
+ illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
}
|
||||
|
||||
public boolean ironGolemRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
From dadd35b34b2359649a188b21e7eebb9361a7c724 Mon Sep 17 00:00:00 2001
|
||||
From 7690280495c52898fc033dc61f31308dfbe6fb02 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] Add chance for zombie horse natural spawns
|
||||
Subject: [PATCH] Zombie horse naturally spawn
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/WorldServer.java | 18 ++++++++++++------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 17 insertions(+), 6 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 8526a3fda1..fbfe37ea0a 100644
|
||||
index c74b85917..874b8c129 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -549,12 +549,18 @@ public class WorldServer extends World {
|
||||
@@ -554,12 +554,18 @@ public class WorldServer extends World {
|
||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
|
||||
|
||||
if (flag1) {
|
||||
@@ -24,33 +24,35 @@ index 8526a3fda1..fbfe37ea0a 100644
|
||||
- this.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
+ // Purpur start
|
||||
+ EntityHorseAbstract horse;
|
||||
+ if (purpurConfig.zombieHorseSpawnChance > 0F && random.nextFloat() <= purpurConfig.zombieHorseSpawnChance) {
|
||||
+ horse = EntityTypes.ZOMBIE_HORSE.a(this);
|
||||
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
|
||||
+ horse = EntityTypes.ZOMBIE_HORSE.create(this);
|
||||
+ } else {
|
||||
+ horse = EntityTypes.SKELETON_HORSE.a(this);
|
||||
+ ((EntityHorseSkeleton) horse).r(true);
|
||||
+ horse = EntityTypes.SKELETON_HORSE.create(this);
|
||||
+ ((EntityHorseSkeleton) horse).setTrap(true);
|
||||
+ }
|
||||
+ horse.setAgeRaw(0);
|
||||
+ horse.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
+ this.addEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
+ horse.setPosition(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ addEntity(horse, CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
this.strikeLightning(new EntityLightning(this, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, flag1), org.bukkit.event.weather.LightningStrikeEvent.Cause.WEATHER); // CraftBukkit
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 968d32900a..64128359c1 100644
|
||||
index 8d6d25272..723776f95 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -115,4 +115,9 @@ public class PurpurWorldConfig {
|
||||
private void enderDragonSettings() {
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
@@ -640,9 +640,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean zombieHorseCanSwim = false;
|
||||
public boolean zombieHorseRidableInWater = false;
|
||||
+ public double zombieHorseSpawnChance = 0.0D;
|
||||
private void zombieHorseSettings() {
|
||||
zombieHorseCanSwim = getBoolean("mobs.zombie_horse.can-swim", zombieHorseCanSwim);
|
||||
zombieHorseRidableInWater = getBoolean("mobs.zombie_horse.ridable-in-water", zombieHorseRidableInWater);
|
||||
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
}
|
||||
+
|
||||
+ public float zombieHorseSpawnChance = 0F;
|
||||
+ private void zombieHorseSettings() {
|
||||
+ zombieHorseSpawnChance = (float) getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
+ }
|
||||
}
|
||||
|
||||
public boolean zombiePigmanRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
52
patches/server/0011-Charged-creeper-naturally-spawn.patch
Normal file
52
patches/server/0011-Charged-creeper-naturally-spawn.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From c95533f81d47bcc5299b59033211b8fc713be8bc 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
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityCreeper.java | 11 +++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
index 48fd8e716..d414b848e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
@@ -87,6 +87,17 @@ public class EntityCreeper extends EntityMonster {
|
||||
this.datawatcher.register(EntityCreeper.d, false);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, GroupDataEntity groupdataentity, NBTTagCompound nbttagcompound) {
|
||||
+ double chance = ((World) generatoraccess).purpurConfig.creeperChargedChance;
|
||||
+ if (chance > 0D && random.nextDouble() <= chance) {
|
||||
+ setPowered(true);
|
||||
+ }
|
||||
+ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 723776f95..c6dce70d0 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -141,10 +141,12 @@ public class PurpurWorldConfig {
|
||||
public boolean creeperRidable = false;
|
||||
public boolean creeperRidableInWater = false;
|
||||
public boolean creeperRequireShiftToMount = true;
|
||||
+ public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
||||
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
||||
creeperRequireShiftToMount = getBoolean("mobs.creeper.require-shift-to-mount", creeperRequireShiftToMount);
|
||||
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
public boolean dolphinRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
From ccb0e7ca64314cac34a3449b751c42efa5db935e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 01:14:46 -0500
|
||||
Subject: [PATCH] Pigs give saddle back
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityPig.java | 12 +++++++++++-
|
||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
|
||||
index 81ba9f240..036ec3ec2 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
||||
@@ -119,10 +119,20 @@ public class EntityPig extends EntityAnimal {
|
||||
return true;
|
||||
}
|
||||
if (hasSaddle() && !isVehicle()) {
|
||||
+ if (entityhuman.isSneaking()) {
|
||||
+ setSaddle(false);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
||||
+ if (!entityhuman.inventory.pickup(saddle)) {
|
||||
+ entityhuman.drop(saddle, false);
|
||||
+ }
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
entityhuman.startRiding(this);
|
||||
return true;
|
||||
}
|
||||
- if (itemstack.getItem() == Items.SADDLE) {
|
||||
+ if (itemstack.getItem() == Items.SADDLE && !entityhuman.isSneaking()) {
|
||||
itemstack.a(entityhuman, this, enumhand);
|
||||
return true;
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From eca31a254b26c52526071806df6ea50b9504ff34 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
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityRabbit.java | 14 ++++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
2 files changed, 18 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
index 9040ab1c5..7ffa90af8 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
@@ -364,6 +364,10 @@ public class EntityRabbit extends EntityAnimal {
|
||||
if (!this.hasCustomName()) {
|
||||
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bx), new Object[0]));
|
||||
}
|
||||
+ // Purpur start
|
||||
+ } else if (i == 98) {
|
||||
+ setCustomName(new ChatMessage("Toast"));
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
this.datawatcher.set(EntityRabbit.bw, i);
|
||||
@@ -385,6 +389,16 @@ public class EntityRabbit extends EntityAnimal {
|
||||
}
|
||||
|
||||
private int a(GeneratorAccess generatoraccess) {
|
||||
+ // Purpur start
|
||||
+ World world = (World) generatoraccess;
|
||||
+ if (world.purpurConfig.rabbitNaturalKiller > 0D && random.nextDouble() <= world.purpurConfig.rabbitNaturalKiller) {
|
||||
+ return 99;
|
||||
+ }
|
||||
+ if (world.purpurConfig.rabbitNaturalToast > 0D && random.nextDouble() <= world.purpurConfig.rabbitNaturalToast) {
|
||||
+ return 98;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
BiomeBase biomebase = generatoraccess.getBiome(new BlockPosition(this));
|
||||
int i = this.random.nextInt(100);
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index c6dce70d0..c51023d0c 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -423,10 +423,14 @@ public class PurpurWorldConfig {
|
||||
public boolean rabbitRidable = false;
|
||||
public boolean rabbitRidableInWater = false;
|
||||
public boolean rabbitRequireShiftToMount = true;
|
||||
+ 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);
|
||||
rabbitRequireShiftToMount = getBoolean("mobs.rabbit.require-shift-to-mount", rabbitRequireShiftToMount);
|
||||
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
||||
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
}
|
||||
|
||||
public boolean ravagerRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
From ebb0e6e3c822041d403a5dd9a3b6d620a4f88283 Mon Sep 17 00:00:00 2001
|
||||
From eea97d4fd77eaee050b7fe38ed52408416aa87ee Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Dec 2019 18:52:55 -0600
|
||||
Subject: [PATCH] Add natural cat spawning options
|
||||
Subject: [PATCH] Cat spawning options
|
||||
|
||||
---
|
||||
.../net/minecraft/server/MobSpawnerCat.java | 19 +++++++++++++------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 9 +++++++++
|
||||
2 files changed, 22 insertions(+), 6 deletions(-)
|
||||
.../net/minecraft/server/MobSpawnerCat.java | 23 +++++++++++++------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 6 +++++
|
||||
2 files changed, 22 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
index 6024478dc..034b97336 100644
|
||||
index 6024478dc..4b55c07d4 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
@@ -15,7 +15,7 @@ public class MobSpawnerCat {
|
||||
@@ -21,24 +21,26 @@ index 6024478dc..034b97336 100644
|
||||
EntityPlayer entityplayer = worldserver.k();
|
||||
|
||||
if (entityplayer == null) {
|
||||
@@ -49,10 +49,13 @@ public class MobSpawnerCat {
|
||||
@@ -49,10 +49,14 @@ public class MobSpawnerCat {
|
||||
}
|
||||
|
||||
private int a(WorldServer worldserver, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
+ // Purpur start
|
||||
+ int range = worldserver.purpurConfig.catSpawnVillageScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ // Purpur end
|
||||
|
||||
-
|
||||
- if (worldserver.B().a(VillagePlaceType.q.c(), blockposition, 48, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
- List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(48.0D, 8.0D, 48.0D));
|
||||
+ // Purpur start
|
||||
+ int range = worldserver.purpurConfig.catSpawnVillageScanRange;
|
||||
+ if (range <= 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (worldserver.B().a(VillagePlaceType.q.c(), blockposition, range, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
+ List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range)); // Purpur
|
||||
+ List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
|
||||
if (list.size() < 5) {
|
||||
return this.a(blockposition, (World) worldserver);
|
||||
@@ -63,8 +66,12 @@ public class MobSpawnerCat {
|
||||
@@ -63,8 +67,13 @@ public class MobSpawnerCat {
|
||||
}
|
||||
|
||||
private int a(World world, BlockPosition blockposition) {
|
||||
@@ -46,33 +48,35 @@ index 6024478dc..034b97336 100644
|
||||
- List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(16.0D, 8.0D, 16.0D));
|
||||
+ // Purpur start
|
||||
+ int range = world.purpurConfig.catSpawnSwampHutScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ if (range <= 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
+
|
||||
+ List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range)); // Purpur
|
||||
|
||||
return list.size() < 1 ? this.a(blockposition, world) : 0;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 69b3bef76..3bb968cfa 100644
|
||||
index c51023d0c..e5cd92e2d 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -185,6 +185,15 @@ public class PurpurWorldConfig {
|
||||
playerSleepCondition = getString("player.sleep.condition", playerSleepCondition);
|
||||
}
|
||||
|
||||
@@ -94,10 +94,16 @@ public class PurpurWorldConfig {
|
||||
public boolean catRidable = false;
|
||||
public boolean catRidableInWater = false;
|
||||
public boolean catRequireShiftToMount = true;
|
||||
+ public int catSpawnDelay = 1200;
|
||||
+ public int catSpawnSwampHutScanRange = 16;
|
||||
+ public int catSpawnVillageScanRange = 48;
|
||||
+ private void catSettings() {
|
||||
+ catSpawnDelay = getInt("mobs.cat.natural-spawns.delay", catSpawnDelay);
|
||||
+ catSpawnSwampHutScanRange = getInt("mobs.cat.natural-spawns.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
||||
+ catSpawnVillageScanRange = getInt("mobs.cat.natural-spawns.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
||||
+ }
|
||||
+
|
||||
public int chickenEggsHatchWhenDespawnedMax = 0;
|
||||
public int chickenEggsHatchWhenDespawnedRange = 10;
|
||||
private void chickenSettings() {
|
||||
private void catSettings() {
|
||||
catRidable = getBoolean("mobs.cat.ridable", catRidable);
|
||||
catRidableInWater = getBoolean("mobs.cat.ridable-in-water", catRidableInWater);
|
||||
catRequireShiftToMount = getBoolean("mobs.cat.require-shift-to-mount", catRequireShiftToMount);
|
||||
+ catSpawnDelay = getInt("mobs.cat.spawn-delay", catSpawnDelay);
|
||||
+ catSpawnSwampHutScanRange = getInt("mobs.cat.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
||||
+ catSpawnVillageScanRange = getInt("mobs.cat.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
||||
}
|
||||
|
||||
public boolean caveSpiderRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 615cb3372831f93095e6b0aa27ce12dc9db78634 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 18 May 2019 16:59:52 -0500
|
||||
Subject: [PATCH] Prevent phantoms spawning on creative players
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/MobSpawnerPhantom.java | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
index f488c22ed6..78ea16f010 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
@@ -31,7 +31,7 @@ public class MobSpawnerPhantom {
|
||||
while (iterator.hasNext()) {
|
||||
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
||||
|
||||
- if (!entityhuman.isSpectator()) {
|
||||
+ if (!entityhuman.isSpectator() && !entityhuman.isCreative()) { // Purpur
|
||||
BlockPosition blockposition = new BlockPosition(entityhuman);
|
||||
|
||||
if (!worldserver.worldProvider.f() || blockposition.getY() >= worldserver.getSeaLevel() && worldserver.f(blockposition)) {
|
||||
--
|
||||
2.24.0.rc1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 20872c850b40b30fe571c9b3e6133dafce84feb2 Mon Sep 17 00:00:00 2001
|
||||
From 10f6a4cbd7256d8257ba1fdf3117a943d1839a5a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 2 Jan 2020 01:23:22 -0600
|
||||
Subject: [PATCH] Fix non black cat types spawning in swamp huts
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] Fix non black cat types spawning in swamp huts
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
index 034b97336..cc2f37869 100644
|
||||
index 4b55c07d4..fa2222355 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
@@ -82,8 +82,9 @@ public class MobSpawnerCat {
|
||||
@@ -84,8 +84,9 @@ public class MobSpawnerCat {
|
||||
if (entitycat == null) {
|
||||
return 0;
|
||||
} else {
|
||||
@@ -1,88 +0,0 @@
|
||||
From 04c9f3e094bdb7afd444279a484a89df8c11fb04 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 23 May 2019 16:20:21 -0500
|
||||
Subject: [PATCH] Campfires should fall with gravity
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/Block.java | 1 +
|
||||
.../net/minecraft/server/BlockCampfire.java | 26 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 ++++
|
||||
3 files changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index 0afcbef2f3..2c464299a1 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -387,6 +387,7 @@ public class Block implements IMaterial {
|
||||
PacketDebug.a(world, blockposition);
|
||||
}
|
||||
|
||||
+ public int tickRate(IWorldReader world) { return this.a(world); } // Purpur - OBFHELPER
|
||||
public int a(IWorldReader iworldreader) {
|
||||
return 10;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 6303be944c..5d1312d2f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -74,8 +74,32 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockCampfire.d, flag)).set(BlockCampfire.c, this.h(world.getType(blockposition.down())))).set(BlockCampfire.b, !flag)).set(BlockCampfire.e, blockactioncontext.f());
|
||||
}
|
||||
|
||||
+ // Purpur start - Campfires should fall with gravity
|
||||
+ @Override
|
||||
+ public void onPlace(IBlockData iblockdata, World world, BlockPosition pos, IBlockData iblockdata1, boolean flag) {
|
||||
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void tick(IBlockData iblockdata, WorldServer world, BlockPosition pos, Random random) {
|
||||
+ if (world.purpurConfig.campfireObeysGravity && BlockFalling.canFallThrough(world.getType(pos.down())) && pos.getY() >= 0) {
|
||||
+ world.addEntity(new EntityFallingBlock(world, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, world.getType(pos)));
|
||||
+ }
|
||||
+ if (iblockdata.get(BlockCampfire.d) && iblockdata.get(BlockCampfire.b)) {
|
||||
+ world.setTypeAndData(pos, iblockdata.set(BlockCampfire.b, false), 3);
|
||||
+ }
|
||||
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int tickRate(IWorldReader world) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
+ generatoraccess.getBlockTickList().a(blockposition, this, tickRate(generatoraccess)); // Purpur - Campfires should fall with gravity
|
||||
if ((Boolean) iblockdata.get(BlockCampfire.d)) {
|
||||
generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess));
|
||||
}
|
||||
@@ -104,7 +128,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
|
||||
@Override
|
||||
public boolean place(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid) {
|
||||
- if (!(Boolean) iblockdata.get(BlockProperties.C) && fluid.getType() == FluidTypes.WATER) {
|
||||
+ if (!(Boolean) iblockdata.get(BlockCampfire.d) && fluid.getType() == FluidTypes.WATER) { // Purpur
|
||||
boolean flag = (Boolean) iblockdata.get(BlockCampfire.b);
|
||||
|
||||
if (flag) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f4811a1d7b..33840d0036 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -58,6 +58,11 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
|
||||
+ public boolean campfireObeysGravity = true;
|
||||
+ private void campfireObeysGravity() {
|
||||
+ campfireObeysGravity = getBoolean("campfire-obeys-gravity", campfireObeysGravity);
|
||||
+ }
|
||||
+
|
||||
public int campfireRegenInterval = 40;
|
||||
public int campfireRegenDuration = 80;
|
||||
public int campfireRegenRange = 5;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From 33dcc02e3f144c7a4fd1467b79477ecdddce520d Mon Sep 17 00:00:00 2001
|
||||
From 9a89bf6455593f02b131d6c073cdbec5177e7831 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 01:10:30 -0500
|
||||
Subject: [PATCH] cows to mooshroom when fed mushrooms
|
||||
Subject: [PATCH] Cows eat mushrooms
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/Entity.java | 2 +
|
||||
.../java/net/minecraft/server/EntityCow.java | 70 +++++++++++++++++++
|
||||
.../net/minecraft/server/EntityLiving.java | 7 ++
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 5 ++
|
||||
4 files changed, 84 insertions(+)
|
||||
.../net/minecraft/server/EntityLiving.java | 5 +-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 +
|
||||
4 files changed, 77 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index c1ffd6dc1..fefdd2b27 100644
|
||||
index 37c1c519b..b18e9ae50 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1037,6 +1037,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -22,7 +22,7 @@ index c1ffd6dc1..fefdd2b27 100644
|
||||
public void a(SoundEffect soundeffect, float f, float f1) {
|
||||
if (!this.isSilent()) {
|
||||
this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), soundeffect, this.getSoundCategory(), f, f1);
|
||||
@@ -2554,6 +2555,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -2568,6 +2569,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.invulnerable = flag;
|
||||
}
|
||||
|
||||
@@ -31,23 +31,23 @@ index c1ffd6dc1..fefdd2b27 100644
|
||||
this.setPositionRotation(entity.locX(), entity.locY(), entity.locZ(), entity.yaw, entity.pitch);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
index 2c8bbf20a..e1d0f0f38 100644
|
||||
index 723a9fa1e..f56fd7c01 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
@@ -16,6 +16,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
@@ -34,6 +34,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D));
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
+ if (net.pl3x.purpur.PurpurConfig.feedMushroomsToCows > 0) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT, Blocks.RED_MUSHROOM.getItem(), Blocks.BROWN_MUSHROOM.getItem()), false)); else // Purpur
|
||||
+ if (world.purpurConfig.cowFeedMushrooms > 0) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT, Blocks.RED_MUSHROOM.getItem(), Blocks.BROWN_MUSHROOM.getItem()), false)); else // Purpur
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT), false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
@@ -78,11 +79,80 @@ public class EntityCow extends EntityAnimal {
|
||||
@@ -96,11 +97,80 @@ public class EntityCow extends EntityAnimal {
|
||||
// CraftBukkit end
|
||||
|
||||
return true;
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ } else if (net.pl3x.purpur.PurpurConfig.feedMushroomsToCows > 0 && getEntityType() != EntityTypes.MOOSHROOM && isMushroom(itemstack)) {
|
||||
+ } else if (world.purpurConfig.cowFeedMushrooms > 0 && getEntityType() != EntityTypes.MOOSHROOM && isMushroom(itemstack)) {
|
||||
+ return feedMushroom(entityhuman, itemstack);
|
||||
+ // Purpur end
|
||||
} else {
|
||||
@@ -74,7 +74,7 @@ index 2c8bbf20a..e1d0f0f38 100644
|
||||
+ private boolean feedMushroom(EntityHuman entityhuman, ItemStack itemstack) {
|
||||
+ world.broadcastEntityEffect(this, (byte) 18); // hearts
|
||||
+ playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F);
|
||||
+ if (incrementFeedCount(itemstack) < net.pl3x.purpur.PurpurConfig.feedMushroomsToCows) {
|
||||
+ if (incrementFeedCount(itemstack) < world.purpurConfig.cowFeedMushrooms) {
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
@@ -100,10 +100,10 @@ index 2c8bbf20a..e1d0f0f38 100644
|
||||
+ if (this.hasCustomName()) {
|
||||
+ mooshroom.setCustomName(this.getCustomName());
|
||||
+ }
|
||||
+ if (CraftEventFactory.callEntityTransformEvent(this, mooshroom, org.bukkit.event.entity.EntityTransformEvent.TransformReason.SHROOMED).isCancelled()) {
|
||||
+ if (CraftEventFactory.callEntityTransformEvent(this, mooshroom, org.bukkit.event.entity.EntityTransformEvent.TransformReason.INFECTION).isCancelled()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), mooshroom.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.SHROOMED).callEvent()) {
|
||||
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), mooshroom.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.INFECTED).callEvent()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ this.world.addEntity(mooshroom);
|
||||
@@ -124,37 +124,38 @@ index 2c8bbf20a..e1d0f0f38 100644
|
||||
public EntityCow createChild(EntityAgeable entityageable) {
|
||||
return (EntityCow) EntityTypes.COW.a(this.world);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 6184cced7..ad6f96988 100644
|
||||
index 17ff8a9fc..6ca11091c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2809,6 +2809,13 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2812,8 +2812,9 @@ public abstract class EntityLiving extends Entity {
|
||||
this.aK = f;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public float getRenderYawOffset() {
|
||||
+ return this.aI;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
- @Override
|
||||
- public void l(float f) {
|
||||
+ public float getRenderYawOffset() { return this.aI; } // Purpur - OBFHELPER
|
||||
+ public void setRenderYawOffset(float f) { this.l(f); } // Purpur - OBFHELPER
|
||||
@Override
|
||||
public void l(float f) {
|
||||
+ @Override public void l(float f) {
|
||||
this.aI = f;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 6f378b5f6..26e95035b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -130,4 +130,9 @@ public class PurpurConfig {
|
||||
config.addDefault(path, def);
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
+
|
||||
+ public static int feedMushroomsToCows = 0;
|
||||
+ private static void cowsSettings() {
|
||||
+ feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||
+ }
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index e5cd92e2d..88aa21fe4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -138,10 +138,12 @@ public class PurpurWorldConfig {
|
||||
public boolean cowRidable = false;
|
||||
public boolean cowRidableInWater = false;
|
||||
public boolean cowRequireShiftToMount = true;
|
||||
+ public int cowFeedMushrooms = 0;
|
||||
private void cowSettings() {
|
||||
cowRidable = getBoolean("mobs.cow.ridable", cowRidable);
|
||||
cowRidableInWater = getBoolean("mobs.cow.ridable-in-water", cowRidableInWater);
|
||||
cowRequireShiftToMount = getBoolean("mobs.cow.require-shift-to-mount", cowRequireShiftToMount);
|
||||
+ cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
}
|
||||
|
||||
public boolean creeperRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
From 003c0a4b0f11853467a5bf473748caa966b12206 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 21:30:49 -0500
|
||||
Subject: [PATCH] Campfires burn out in rain
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/BlockCampfire.java | 3 +++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 5d1312d2f1..7cb4ce95e7 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -88,6 +88,9 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
if (iblockdata.get(BlockCampfire.d) && iblockdata.get(BlockCampfire.b)) {
|
||||
world.setTypeAndData(pos, iblockdata.set(BlockCampfire.b, false), 3);
|
||||
}
|
||||
+ if (world.purpurConfig.campfiresGoOutInRain && world.getTime() % 20 == 0L && iblockdata.get(BlockCampfire.b) && world.isRainingAt(pos.shift(EnumDirection.UP))) {
|
||||
+ world.setTypeAndData(pos, iblockdata.set(BlockCampfire.b, false), 3);
|
||||
+ }
|
||||
world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 33840d0036..6a9647367f 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -85,4 +85,9 @@ public class PurpurWorldConfig {
|
||||
campfireRegenBoostRequireLineOfSight = getBoolean("campfire-regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
campfireRequireRegenPotion = getBoolean("campfire-regen.requires-regen-potion-to-activate", campfireRequireRegenPotion);
|
||||
}
|
||||
+
|
||||
+ public boolean campfiresGoOutInRain = true;
|
||||
+ private void campfiresGoOutInRain() {
|
||||
+ campfiresGoOutInRain = getBoolean("campfires-go-out-in-rain", campfiresGoOutInRain);
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From bd8ee39f3fd15c4997907ad92367318138b08998 Mon Sep 17 00:00:00 2001
|
||||
From 7a067dfcb4cd96ad04f3c05d3b332a7508f19624 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:53:16 -0500
|
||||
Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
index efde7bd1d7..ce5bac35db 100644
|
||||
index b20f4afd3..02d76a6c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
@@ -101,7 +101,13 @@ public class EntityMushroomCow extends EntityCow {
|
||||
@@ -118,7 +118,13 @@ public class EntityMushroomCow extends EntityCow {
|
||||
|
||||
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
|
||||
entitycow.setHealth(this.getHealth());
|
||||
@@ -27,5 +27,5 @@ index efde7bd1d7..ce5bac35db 100644
|
||||
entitycow.setCustomName(this.getCustomName());
|
||||
entitycow.setCustomNameVisible(this.getCustomNameVisible());
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
From c25c25d42f7a1f4b98c803061e5ad521a039452e 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] Packed Barrels
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/TileEntityBarrel.java | 5 +++--
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 7 +++++++
|
||||
.../org/bukkit/craftbukkit/inventory/CraftContainer.java | 6 +++++-
|
||||
3 files changed, 15 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityBarrel.java b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
index 1e27abbea..08dee7518 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
@@ -54,7 +54,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
private TileEntityBarrel(TileEntityTypes<?> tileentitytypes) {
|
||||
super(tileentitytypes);
|
||||
- this.items = NonNullList.a(27, ItemStack.a);
|
||||
+ this.items = NonNullList.a(net.pl3x.purpur.PurpurConfig.packedBarrels ? 54 : 27, ItemStack.a); // Purpur
|
||||
}
|
||||
|
||||
public TileEntityBarrel() {
|
||||
@@ -83,7 +83,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
- return 27;
|
||||
+ return net.pl3x.purpur.PurpurConfig.packedBarrels ? 54 : 27; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,6 +103,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
@Override
|
||||
protected Container createContainer(int i, PlayerInventory playerinventory) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.packedBarrels) return ContainerChest.b(i, playerinventory, this); // Purpur
|
||||
return ContainerChest.a(i, playerinventory, this);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index d7da38bf5..2179acffe 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -6,6 +6,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+import org.bukkit.event.inventory.InventoryType;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -164,6 +165,12 @@ public class PurpurConfig {
|
||||
snowmanPumpkinPutBack = getBoolean("settings.mobs.snow_golem.pumpkin-can-be-added-back", snowmanPumpkinPutBack);
|
||||
}
|
||||
|
||||
+ public static boolean packedBarrels = true;
|
||||
+ private static void packedBarrels() {
|
||||
+ packedBarrels = getBoolean("settings.packed-barrels", packedBarrels);
|
||||
+ InventoryType.BARREL.setDefaultSize(packedBarrels ? 54 : 27);
|
||||
+ }
|
||||
+
|
||||
public static boolean ridableBat = true;
|
||||
public static boolean ridableBee = true;
|
||||
public static boolean ridableBlaze = true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
index b4a7d982e..49cc721f5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
@@ -155,6 +155,8 @@ public class CraftContainer extends Container {
|
||||
return Containers.GRINDSTONE;
|
||||
case STONECUTTER:
|
||||
return Containers.STONECUTTER;
|
||||
+ case BARREL:
|
||||
+ return net.pl3x.purpur.PurpurConfig.packedBarrels ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3;
|
||||
default:
|
||||
return Containers.GENERIC_9X3;
|
||||
}
|
||||
@@ -168,8 +170,10 @@ public class CraftContainer extends Container {
|
||||
case PLAYER:
|
||||
case CHEST:
|
||||
case ENDER_CHEST:
|
||||
+ delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
+ break;
|
||||
case BARREL:
|
||||
- delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9);
|
||||
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.packedBarrels ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
break;
|
||||
case DISPENSER:
|
||||
case DROPPER:
|
||||
--
|
||||
2.24.0.rc1
|
||||
|
||||
52
patches/server/0017-Pigs-give-saddle-back.patch
Normal file
52
patches/server/0017-Pigs-give-saddle-back.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 78953ea9b97497921abe3037d7435d0b6c9fbd9b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 01:14:46 -0500
|
||||
Subject: [PATCH] Pigs give saddle back
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityPig.java | 12 ++++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
|
||||
index e6a7f8ef3..d78666dbb 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
||||
@@ -135,6 +135,18 @@ public class EntityPig extends EntityAnimal {
|
||||
return true;
|
||||
}
|
||||
if (hasSaddle() && !isVehicle()) {
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.pigGiveSaddleBack && entityhuman.isSneaking()) {
|
||||
+ setSaddle(false);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
||||
+ if (!entityhuman.inventory.pickup(saddle)) {
|
||||
+ entityhuman.drop(saddle, false);
|
||||
+ }
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
entityhuman.startRiding(this);
|
||||
return true;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 88aa21fe4..cd3b29ef1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -396,9 +396,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean pigRidable = false;
|
||||
public boolean pigRidableInWater = false;
|
||||
+ public boolean pigGiveSaddleBack = false;
|
||||
private void pigSettings() {
|
||||
pigRidable = getBoolean("mobs.pig.ridable", pigRidable);
|
||||
pigRidableInWater = getBoolean("mobs.pig.ridable-in-water", pigRidableInWater);
|
||||
+ pigGiveSaddleBack = getBoolean("mobs.pig.give-saddle-back", pigGiveSaddleBack);
|
||||
}
|
||||
|
||||
public boolean pillagerRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 2d93ecf31a99b2ed16069baaa2a665076e8884cd Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 18 May 2019 16:59:52 -0500
|
||||
Subject: [PATCH] Phantoms do not spawn on creative players
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/MobSpawnerPhantom.java | 2 +-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
index f488c22ed..748983da2 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
||||
@@ -31,7 +31,7 @@ public class MobSpawnerPhantom {
|
||||
while (iterator.hasNext()) {
|
||||
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
||||
|
||||
- if (!entityhuman.isSpectator()) {
|
||||
+ if (!entityhuman.isSpectator() && (!worldserver.purpurConfig.phantomIgnoreCreative || !entityhuman.isCreative())) { // Purpur
|
||||
BlockPosition blockposition = new BlockPosition(entityhuman);
|
||||
|
||||
if (!worldserver.worldProvider.f() || blockposition.getY() >= worldserver.getSeaLevel() && worldserver.f(blockposition)) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index cd3b29ef1..9e89eafb8 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -387,11 +387,13 @@ public class PurpurWorldConfig {
|
||||
public boolean phantomRidableInWater = false;
|
||||
public boolean phantomRequireShiftToMount = true;
|
||||
public double phantomMaxY = 256D;
|
||||
+ public boolean phantomIgnoreCreative = false;
|
||||
private void phantomSettings() {
|
||||
phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable);
|
||||
phantomRidableInWater = getBoolean("mobs.phantom.ridable-in-water", phantomRidableInWater);
|
||||
phantomRequireShiftToMount = getBoolean("mobs.phantom.require-shift-to-mount", phantomRequireShiftToMount);
|
||||
phantomMaxY = getDouble("mobs.phantom.ridable-max-y", phantomMaxY);
|
||||
+ phantomIgnoreCreative = getBoolean("mobs.phantom.do-not-spawn-on-creative-players", phantomIgnoreCreative);
|
||||
}
|
||||
|
||||
public boolean pigRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
57
patches/server/0019-Phantoms-only-attack-insomniacs.patch
Normal file
57
patches/server/0019-Phantoms-only-attack-insomniacs.patch
Normal file
@@ -0,0 +1,57 @@
|
||||
From 0446f5d9a8d89ffc3cfe2c0f4df57e7a4ef05167 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 29 Nov 2019 20:33:41 -0600
|
||||
Subject: [PATCH] Phantoms only attack insomniacs
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityPhantom.java | 1 +
|
||||
src/main/java/net/minecraft/server/IEntitySelector.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
3 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
index 954edf73f..4bd9ea63b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
@@ -257,6 +257,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
||||
|
||||
if (EntityPhantom.this.a((EntityLiving) entityhuman, PathfinderTargetCondition.a)) {
|
||||
+ if (!world.purpurConfig.phantomOnlyAttackInsomniacs || IEntitySelector.isInsomniac.test(entityhuman)) // Purpur
|
||||
EntityPhantom.this.setGoalTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit - reason
|
||||
return true;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
index a2d1ef360..e1fdee279 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
@@ -23,6 +23,7 @@ public final class IEntitySelector {
|
||||
public static final Predicate<Entity> f = (entity) -> {
|
||||
return !entity.isSpectator();
|
||||
};
|
||||
+ public static Predicate<EntityHuman> isInsomniac = (player) -> MathHelper.clamp(((EntityPlayer) player).getStatisticManager().getStatisticValue(StatisticList.CUSTOM.b(StatisticList.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Purpur
|
||||
|
||||
public static Predicate<Entity> a(double d0, double d1, double d2, double d3) {
|
||||
double d4 = d3 * d3;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9e89eafb8..90aa470c2 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -388,12 +388,14 @@ public class PurpurWorldConfig {
|
||||
public boolean phantomRequireShiftToMount = true;
|
||||
public double phantomMaxY = 256D;
|
||||
public boolean phantomIgnoreCreative = false;
|
||||
+ public boolean phantomOnlyAttackInsomniacs = false;
|
||||
private void phantomSettings() {
|
||||
phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable);
|
||||
phantomRidableInWater = getBoolean("mobs.phantom.ridable-in-water", phantomRidableInWater);
|
||||
phantomRequireShiftToMount = getBoolean("mobs.phantom.require-shift-to-mount", phantomRequireShiftToMount);
|
||||
phantomMaxY = getDouble("mobs.phantom.ridable-max-y", phantomMaxY);
|
||||
phantomIgnoreCreative = getBoolean("mobs.phantom.do-not-spawn-on-creative-players", phantomIgnoreCreative);
|
||||
+ phantomOnlyAttackInsomniacs = getBoolean("mobs.phantom.only-attack-insomniacs", phantomOnlyAttackInsomniacs);
|
||||
}
|
||||
|
||||
public boolean pigRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From c71a2b36871ed2f457ffd56b745e72148efabb7e Mon Sep 17 00:00:00 2001
|
||||
From a341be6ed4dab4a60a860326bd324add34e99534 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 9 May 2019 18:26:06 -0500
|
||||
Subject: [PATCH] Phantoms attracted to crystals and crystals shoot phantoms
|
||||
@@ -7,10 +7,10 @@ Subject: [PATCH] Phantoms attracted to crystals and crystals shoot phantoms
|
||||
.../net/minecraft/server/DamageSource.java | 1 +
|
||||
.../java/net/minecraft/server/Entity.java | 8 +-
|
||||
.../minecraft/server/EntityEnderCrystal.java | 49 +++++
|
||||
.../net/minecraft/server/EntityPhantom.java | 181 +++++++++++++++++-
|
||||
.../net/minecraft/server/EntityPhantom.java | 176 +++++++++++++++++-
|
||||
.../net/minecraft/server/IEntityAccess.java | 1 +
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 9 +
|
||||
6 files changed, 235 insertions(+), 14 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 6 +
|
||||
6 files changed, 228 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DamageSource.java b/src/main/java/net/minecraft/server/DamageSource.java
|
||||
index 816d301f1..0971f25b5 100644
|
||||
@@ -25,10 +25,10 @@ index 816d301f1..0971f25b5 100644
|
||||
return (new EntityDamageSourceIndirect("indirectMagic", entity, entity1)).setIgnoreArmor().setMagic();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index fefdd2b27..863ff08fd 100644
|
||||
index b18e9ae50..c6a97d6b5 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1379,6 +1379,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1380,6 +1380,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return d3 * d3 + d4 * d4 + d5 * d5;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ index fefdd2b27..863ff08fd 100644
|
||||
public double h(Entity entity) {
|
||||
return this.c(entity.getPositionVector());
|
||||
}
|
||||
@@ -1898,14 +1899,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1899,14 +1900,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return this.a(new ItemStack(imaterial), (float) i);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ index fefdd2b27..863ff08fd 100644
|
||||
return null;
|
||||
} else if (this.world.isClientSide) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderCrystal.java b/src/main/java/net/minecraft/server/EntityEnderCrystal.java
|
||||
index a57d0089d..2d46c250e 100644
|
||||
index a57d0089d..02952c3af 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderCrystal.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderCrystal.java
|
||||
@@ -13,6 +13,12 @@ public class EntityEnderCrystal extends Entity {
|
||||
@@ -76,12 +76,12 @@ index a57d0089d..2d46c250e 100644
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.crystalsAttackPhantomsRadius <= 0 || --idleCooldown > 0) {
|
||||
+ if (world.purpurConfig.phantomAttackedByCrystalRadius <= 0 || --idleCooldown > 0) {
|
||||
+ return; // on cooldown
|
||||
+ }
|
||||
+
|
||||
+ if (targetPhantom == null) {
|
||||
+ for (EntityPhantom phantom : world.getEntitiesByClass(EntityPhantom.class, getBoundingBox().grow(net.pl3x.purpur.PurpurConfig.crystalsAttackPhantomsRadius))) {
|
||||
+ for (EntityPhantom phantom : world.getEntitiesByClass(EntityPhantom.class, getBoundingBox().grow(world.purpurConfig.phantomAttackedByCrystalRadius))) {
|
||||
+ if (phantom.hasLineOfSight(this)) {
|
||||
+ attackPhantom(phantom);
|
||||
+ break;
|
||||
@@ -94,7 +94,7 @@ index a57d0089d..2d46c250e 100644
|
||||
+ if (targetPhantom.hasLineOfSight(this)) {
|
||||
+ if (phantomDamageCooldown <= 0) {
|
||||
+ phantomDamageCooldown = 20;
|
||||
+ targetPhantom.damageEntity(DamageSource.indirectMagic(this, this), net.pl3x.purpur.PurpurConfig.crystalsAttackPhantomDamage);
|
||||
+ targetPhantom.damageEntity(DamageSource.indirectMagic(this, this), world.purpurConfig.phantomAttackedByCrystalDamage);
|
||||
+ }
|
||||
+ } else {
|
||||
+ forgetPhantom(); // no longer in sight
|
||||
@@ -123,7 +123,7 @@ index a57d0089d..2d46c250e 100644
|
||||
@Override
|
||||
protected void b(NBTTagCompound nbttagcompound) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
index 82323bf4a..052a741c0 100644
|
||||
index 4bd9ea63b..9cae8885d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
@@ -8,9 +8,10 @@ import javax.annotation.Nullable;
|
||||
@@ -140,28 +140,30 @@ index 82323bf4a..052a741c0 100644
|
||||
|
||||
public EntityPhantom(EntityTypes<? extends EntityPhantom> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -29,10 +30,16 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -51,12 +52,18 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
+ // Purpur start
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
- this.goalSelector.a(1, new EntityPhantom.c());
|
||||
- this.goalSelector.a(2, new EntityPhantom.i());
|
||||
- this.goalSelector.a(3, new EntityPhantom.e());
|
||||
- this.targetSelector.a(1, new EntityPhantom.b());
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.phantomsOrbitCrystalsRadius > 0) {
|
||||
+ if (world.purpurConfig.phantomOrbitCrystalRadius > 0) {
|
||||
+ this.goalSelector.a(1, new FindCrystalGoal(this));
|
||||
+ this.goalSelector.a(2, new OrbitCrystalGoal(this));
|
||||
+ }
|
||||
+ this.goalSelector.a(3, new EntityPhantom.c()); // PickAttackGoal
|
||||
+ this.goalSelector.a(4, new EntityPhantom.i()); // SweepAttackGoal
|
||||
+ this.goalSelector.a(5, new EntityPhantom.e()); // OrbitPointGoal
|
||||
this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
- this.targetSelector.a(1, new EntityPhantom.b());
|
||||
+ this.targetSelector.a(1, new EntityPhantom.b()); // AttackPlayerGoal
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,6 +122,26 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -140,6 +147,26 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
super.mobTick();
|
||||
}
|
||||
|
||||
@@ -188,7 +190,7 @@ index 82323bf4a..052a741c0 100644
|
||||
@Override
|
||||
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
||||
this.d = (new BlockPosition(this)).up(5);
|
||||
@@ -203,6 +230,135 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -228,6 +255,136 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -201,6 +203,7 @@ index 82323bf4a..052a741c0 100644
|
||||
+ FindCrystalGoal(EntityPhantom phantom) {
|
||||
+ this.phantom = phantom;
|
||||
+ comparator = java.util.Comparator.comparingDouble(phantom::h);
|
||||
+ this.a(EnumSet.of(PathfinderGoal.Type.LOOK));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -241,7 +244,7 @@ index 82323bf4a..052a741c0 100644
|
||||
+ }
|
||||
+
|
||||
+ private double maxTargetRange() {
|
||||
+ return net.pl3x.purpur.PurpurConfig.phantomsOrbitCrystalsRadius;
|
||||
+ return phantom.world.purpurConfig.phantomOrbitCrystalRadius;
|
||||
+ }
|
||||
+
|
||||
+ class DistanceComparator implements java.util.Comparator<Entity> {
|
||||
@@ -298,14 +301,14 @@ index 82323bf4a..052a741c0 100644
|
||||
+ this.offset = phantom.random.nextFloat() * 2.0F * 3.1415927F;
|
||||
+ updateOffset();
|
||||
+ }
|
||||
+ if (phantom.getHomeOffset().c(phantom.locX, phantom.locY, phantom.locZ) < 4.0D) {
|
||||
+ if (phantom.getHomeOffset().c(phantom.locX(), phantom.locY(), phantom.locZ()) < 4.0D) {
|
||||
+ updateOffset();
|
||||
+ }
|
||||
+ if (phantom.getHomeOffset().y < phantom.locY && !phantom.world.isEmpty((new BlockPosition(phantom)).down(1))) {
|
||||
+ if (phantom.getHomeOffset().y < phantom.locY() && !phantom.world.isEmpty((new BlockPosition(phantom)).down(1))) {
|
||||
+ this.verticalChange = Math.max(1.0F, this.verticalChange);
|
||||
+ updateOffset();
|
||||
+ }
|
||||
+ if (phantom.getHomeOffset().y > phantom.locY && !phantom.world.isEmpty((new BlockPosition(phantom)).up(1))) {
|
||||
+ if (phantom.getHomeOffset().y > phantom.locY() && !phantom.world.isEmpty((new BlockPosition(phantom)).up(1))) {
|
||||
+ this.verticalChange = Math.min(-1.0F, this.verticalChange);
|
||||
+ updateOffset();
|
||||
+ }
|
||||
@@ -324,42 +327,32 @@ index 82323bf4a..052a741c0 100644
|
||||
class b extends PathfinderGoal {
|
||||
|
||||
private final PathfinderTargetCondition b;
|
||||
@@ -260,7 +416,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
public boolean a() {
|
||||
EntityLiving entityliving = EntityPhantom.this.getGoalTarget();
|
||||
|
||||
- return entityliving != null ? EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a) : false;
|
||||
+ return !isCirclingCrystal() && entityliving != null && EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a); // Purpur
|
||||
@@ -236,6 +393,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
private b() {
|
||||
this.b = (new PathfinderTargetCondition()).a(64.0D);
|
||||
this.c = 20;
|
||||
+ this.a(EnumSet.of(PathfinderGoal.Type.TARGET)); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -306,11 +462,16 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -280,7 +438,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
private int b;
|
||||
|
||||
- private c() {}
|
||||
+ private c() { this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK)); } // Purpur
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- return EntityPhantom.this.getGoalTarget() != null && EntityPhantom.this.bw == EntityPhantom.AttackPhase.SWOOP;
|
||||
+ return !isCirclingCrystal() && EntityPhantom.this.getGoalTarget() != null && EntityPhantom.this.getAttackPhase() == EntityPhantom.AttackPhase.SWOOP; // Purpur
|
||||
@@ -465,7 +623,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
abstract class h extends PathfinderGoal {
|
||||
|
||||
public h() {
|
||||
- this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||
+ this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean b() {
|
||||
+ // Purpur start
|
||||
+ if (isCirclingCrystal()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
EntityLiving entityliving = EntityPhantom.this.getGoalTarget();
|
||||
|
||||
if (entityliving == null) {
|
||||
@@ -380,7 +541,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- return EntityPhantom.this.getGoalTarget() == null || EntityPhantom.this.bw == EntityPhantom.AttackPhase.CIRCLE;
|
||||
+ return !isCirclingCrystal() && EntityPhantom.this.getGoalTarget() == null || EntityPhantom.this.getAttackPhase() == EntityPhantom.AttackPhase.CIRCLE; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean g() {
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
index 4157e50e4..774ec96f0 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
@@ -372,26 +365,30 @@ index 4157e50e4..774ec96f0 100644
|
||||
default <T extends Entity> List<T> a(Class<? extends T> oclass, AxisAlignedBB axisalignedbb) {
|
||||
return this.a(oclass, axisalignedbb, IEntitySelector.f);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 0c408a10c..960361ff7 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -136,6 +136,15 @@ public class PurpurConfig {
|
||||
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 90aa470c2..8fdc6feb6 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -389,6 +389,9 @@ public class PurpurWorldConfig {
|
||||
public double phantomMaxY = 256D;
|
||||
public boolean phantomIgnoreCreative = false;
|
||||
public boolean phantomOnlyAttackInsomniacs = false;
|
||||
+ public double phantomAttackedByCrystalRadius = 0.0D;
|
||||
+ public float phantomAttackedByCrystalDamage = 1.0F;
|
||||
+ public double phantomOrbitCrystalRadius = 0.0D;
|
||||
private void phantomSettings() {
|
||||
phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable);
|
||||
phantomRidableInWater = getBoolean("mobs.phantom.ridable-in-water", phantomRidableInWater);
|
||||
@@ -396,6 +399,9 @@ public class PurpurWorldConfig {
|
||||
phantomMaxY = getDouble("mobs.phantom.ridable-max-y", phantomMaxY);
|
||||
phantomIgnoreCreative = getBoolean("mobs.phantom.do-not-spawn-on-creative-players", phantomIgnoreCreative);
|
||||
phantomOnlyAttackInsomniacs = getBoolean("mobs.phantom.only-attack-insomniacs", phantomOnlyAttackInsomniacs);
|
||||
+ phantomAttackedByCrystalRadius = getDouble("mobs.phantom.attacked-by-crystal-range", phantomAttackedByCrystalRadius);
|
||||
+ phantomAttackedByCrystalDamage = (float) getDouble("mobs.phantom.attacked-by-crystal-damage", phantomAttackedByCrystalDamage);
|
||||
+ phantomOrbitCrystalRadius = getDouble("mobs.phantom.orbit-crystal-radius", phantomOrbitCrystalRadius);
|
||||
}
|
||||
|
||||
+ public static double crystalsAttackPhantomsRadius = 0.0D;
|
||||
+ public static float crystalsAttackPhantomDamage = 1.0F;
|
||||
+ public static double phantomsOrbitCrystalsRadius = 0.0D;
|
||||
+ private static void phantomSettings() {
|
||||
+ crystalsAttackPhantomsRadius = getDouble("settings.mobs.phantom.crystals-attack-range", crystalsAttackPhantomsRadius);
|
||||
+ crystalsAttackPhantomDamage = (float) getDouble("settings.mobs.phantom.crystals-attack-damage", crystalsAttackPhantomDamage);
|
||||
+ phantomsOrbitCrystalsRadius = getDouble("settings.mobs.phantom.orbit-crystal-radius", phantomsOrbitCrystalsRadius);
|
||||
+ }
|
||||
+
|
||||
public static boolean snowmanDropsPumpkin = false;
|
||||
public static boolean snowmanPumpkinPutBack = false;
|
||||
private static void snowmansSettings() {
|
||||
public boolean pigRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
71
patches/server/0021-Snowman-drop-and-put-back-pumpkin.patch
Normal file
71
patches/server/0021-Snowman-drop-and-put-back-pumpkin.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
From f2b33d12cf5351e7325eabec875d10ecc2eae366 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:58:44 -0500
|
||||
Subject: [PATCH] Snowman drop and put back pumpkin
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntitySnowman.java | 17 +++++++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
2 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
index 941873513..efc2205f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
@@ -8,6 +8,7 @@ import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
|
||||
public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
||||
|
||||
+ private static final RecipeItemStack PUMPKIN = RecipeItemStack.a(Blocks.PUMPKIN.getItem(), Blocks.CARVED_PUMPKIN.getItem(), Blocks.JACK_O_LANTERN.getItem()); // Purpur
|
||||
private static final DataWatcherObject<Byte> b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a);
|
||||
|
||||
public EntitySnowman(EntityTypes<? extends EntitySnowman> entitytypes, World world) {
|
||||
@@ -146,9 +147,25 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
||||
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
||||
entityhuman1.broadcastItemBreak(enumhand);
|
||||
});
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.snowGolemDropsPumpkin) {
|
||||
+ EntityItem pumpkin = new EntityItem(world, locX(), locY(), locZ(), new ItemStack(Blocks.CARVED_PUMPKIN.getItem()));
|
||||
+ pumpkin.pickupDelay = 10;
|
||||
+ world.addEntity(pumpkin);
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
return true;
|
||||
+ // Purpur start
|
||||
+ } else if (world.purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && PUMPKIN.test(itemstack)) {
|
||||
+ setHasPumpkin(true);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ // Purpur end
|
||||
} else {
|
||||
return tryRide(entityhuman, enumhand); // Purpur
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 8fdc6feb6..501544b67 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -527,11 +527,15 @@ public class PurpurWorldConfig {
|
||||
public boolean snowGolemRidableInWater = false;
|
||||
public boolean snowGolemRequireShiftToMount = true;
|
||||
public boolean snowGolemLeaveTrailWhenRidden = false;
|
||||
+ public boolean snowGolemDropsPumpkin = false;
|
||||
+ public boolean snowGolemPutPumpkinBack = false;
|
||||
private void snowGolemSettings() {
|
||||
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
|
||||
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
|
||||
snowGolemRequireShiftToMount = getBoolean("mobs.snow_golem.require-shift-to-mount", snowGolemRequireShiftToMount);
|
||||
snowGolemLeaveTrailWhenRidden = getBoolean("mobs.snow_golem.leave-trail-when-ridden", snowGolemLeaveTrailWhenRidden);
|
||||
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
|
||||
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
||||
}
|
||||
|
||||
public boolean spiderRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
From 306aa7d682962a0ec6bf1b304d839f07481420f2 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 1 Jun 2019 01:16:35 -0500
|
||||
Subject: [PATCH] Always place dragon egg when dragon is killed
|
||||
From 10df2782f37524de4bbbc19fa205049fe4476a9a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 7 Feb 2020 04:42:57 -0600
|
||||
Subject: [PATCH] Ender dragon always drop egg
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EnderDragonBattle.java | 4 ++--
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 7 insertions(+), 2 deletions(-)
|
||||
src/main/java/net/minecraft/server/EnderDragonBattle.java | 5 +++--
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
index 218c04245b..a2dfdc23f1 100644
|
||||
index 218c04245..48398aa9f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
@@ -21,7 +21,7 @@ public class EnderDragonBattle {
|
||||
@@ -26,24 +26,36 @@ index 218c04245b..a2dfdc23f1 100644
|
||||
this.a(true);
|
||||
this.n();
|
||||
- if (!this.l) {
|
||||
+ if (getWorld().purpurConfig.enderDragonAlwaysDropsEggBlock || !this.l) { // Purpur - always place dragon egg
|
||||
+ if (getWorld().purpurConfig.enderDragonAlwaysDropsEggBlock || !wasPreviouslyKilled()) { // Purpur - always place dragon egg
|
||||
this.d.setTypeUpdate(this.d.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, WorldGenEndTrophy.a), Blocks.DRAGON_EGG.getBlockData());
|
||||
}
|
||||
|
||||
@@ -439,6 +439,7 @@ public class EnderDragonBattle {
|
||||
|
||||
}
|
||||
|
||||
+ public boolean wasPreviouslyKilled() { return d(); } // Purpur - OBFHELPER;
|
||||
public boolean d() {
|
||||
return this.l;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 061b02e45a..ea5c898966 100644
|
||||
index 501544b67..b763c1144 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -100,4 +100,9 @@ public class PurpurWorldConfig {
|
||||
private void allowSignColors() {
|
||||
allowSignColors = getBoolean("allow-sign-colors", allowSignColors);
|
||||
}
|
||||
+
|
||||
@@ -193,11 +193,13 @@ public class PurpurWorldConfig {
|
||||
public boolean enderDragonRidableInWater = false;
|
||||
public boolean enderDragonRequireShiftToMount = true;
|
||||
public double enderDragonMaxY = 256D;
|
||||
+ public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
+ private void enderDragonSettings() {
|
||||
+ enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
+ }
|
||||
}
|
||||
private void enderDragonSettings() {
|
||||
enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable);
|
||||
enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater);
|
||||
enderDragonRequireShiftToMount = getBoolean("mobs.ender_dragon.require-shift-to-mount", enderDragonRequireShiftToMount);
|
||||
enderDragonMaxY = getDouble("mobs.ender_dragon.ridable-max-y", enderDragonMaxY);
|
||||
+ enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender_dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
}
|
||||
|
||||
public boolean endermanRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From e0633c984825e440db28131ccbb54dbbe0509b56 Mon Sep 17 00:00:00 2001
|
||||
From c060bea28492eb0d1f241b19d86c6179f3515913 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 24 Aug 2019 14:42:54 -0500
|
||||
Subject: [PATCH] Ender Dragon always drops full exp
|
||||
Subject: [PATCH] Ender dragon always drop full exp
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityEnderDragon.java | 2 +-
|
||||
@@ -9,33 +9,37 @@ Subject: [PATCH] Ender Dragon always drops full exp
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
index 5935ecb529..19395a9349 100644
|
||||
index 9cba1b6c8..5aea40279 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
@@ -567,7 +567,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
@@ -588,7 +588,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
boolean flag = this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT);
|
||||
short short0 = 500;
|
||||
|
||||
- if (this.bN != null && !this.bN.d()) {
|
||||
+ if (world.purpurConfig.enderDragonAlwaysDropsFullExp || (this.bN != null && !this.bN.d())) { // Purpur
|
||||
+ if (getEnderDragonBattle() != null && (world.purpurConfig.enderDragonAlwaysDropsFullExp || !getEnderDragonBattle().wasPreviouslyKilled())) { // Purpur
|
||||
short0 = 12000;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index c6ff074b14..0eb8f8bfa5 100644
|
||||
index b763c1144..c8ab99876 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -152,8 +152,10 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
@@ -194,12 +194,14 @@ public class PurpurWorldConfig {
|
||||
public boolean enderDragonRequireShiftToMount = true;
|
||||
public double enderDragonMaxY = 256D;
|
||||
public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
+ public boolean enderDragonAlwaysDropsFullExp = false;
|
||||
private void enderDragonSettings() {
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
+ enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender-dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
|
||||
enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable);
|
||||
enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater);
|
||||
enderDragonRequireShiftToMount = getBoolean("mobs.ender_dragon.require-shift-to-mount", enderDragonRequireShiftToMount);
|
||||
enderDragonMaxY = getDouble("mobs.ender_dragon.ridable-max-y", enderDragonMaxY);
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender_dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
+ enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
|
||||
}
|
||||
|
||||
public boolean foxTypeChangesWithTulips = true;
|
||||
public boolean endermanRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
From 8c3f3ab3cbe85b4c194aae321aa9123e31f034f3 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 config for items breaking turtle eggs
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BlockTurtleEgg.java | 13 ++++++++++++-
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
index cb36334e41..238d260b5f 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
@@ -157,6 +157,17 @@ public class BlockTurtleEgg extends Block {
|
||||
}
|
||||
|
||||
private boolean a(World world, Entity entity) {
|
||||
- return entity instanceof EntityTurtle ? false : (entity instanceof EntityLiving && !(entity instanceof EntityHuman) ? world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) : true);
|
||||
+ // Purpur start
|
||||
+ if (entity instanceof EntityTurtle) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (!world.purpurConfig.itemsCanBreakTurtleEggs && entity instanceof EntityItem) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (entity instanceof EntityLiving && !(entity instanceof EntityHuman)) {
|
||||
+ return world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
|
||||
+ }
|
||||
+ return true;
|
||||
+ // Purpur end
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index ea5c898966..7544b6a2af 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -101,6 +101,11 @@ public class PurpurWorldConfig {
|
||||
allowSignColors = getBoolean("allow-sign-colors", allowSignColors);
|
||||
}
|
||||
|
||||
+ public boolean itemsCanBreakTurtleEggs = false;
|
||||
+ private void itemsCanBreakTurtleEggs() {
|
||||
+ itemsCanBreakTurtleEggs = getBoolean("items-can-break-turtle-eggs", itemsCanBreakTurtleEggs);
|
||||
+ }
|
||||
+
|
||||
public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
private void enderDragonSettings() {
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
From 781d16718818af366e999bbc01453d18ee3d820f Mon Sep 17 00:00:00 2001
|
||||
From b2b381adee2dad546990d557c08ce8a0f24b3a35 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 24 May 2019 02:39:25 -0500
|
||||
Subject: [PATCH] Right click to open sign editor
|
||||
Subject: [PATCH] Signs editable on right click
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/BlockSign.java | 11 +++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 16 insertions(+)
|
||||
src/main/java/net/minecraft/server/BlockSign.java | 11 +++++++++++
|
||||
.../java/net/minecraft/server/TileEntitySign.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
3 files changed, 17 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockSign.java b/src/main/java/net/minecraft/server/BlockSign.java
|
||||
index 8a31054a1d..503090e38a 100644
|
||||
index 8a31054a1..d20849ce2 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockSign.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockSign.java
|
||||
@@ -56,6 +56,17 @@ public abstract class BlockSign extends BlockTileEntity implements IBlockWaterlo
|
||||
@@ -17,9 +18,9 @@ index 8a31054a1d..503090e38a 100644
|
||||
}
|
||||
|
||||
+ // Purpur start - right click to open sign editor
|
||||
+ if (world.purpurConfig.editableSigns && itemstack.getItem() instanceof ItemSign &&
|
||||
+ if (world.purpurConfig.signRightClickEdit && itemstack.getItem() instanceof ItemSign &&
|
||||
+ !entityhuman.isSneaking() && entityhuman.abilities.mayBuild &&
|
||||
+ entityhuman.getBukkitEntity().hasPermission("purpur.sign.click.opens.editor")) {
|
||||
+ entityhuman.getBukkitEntity().hasPermission("purpur.sign.edit")) {
|
||||
+ tileentitysign.isEditable = true;
|
||||
+ tileentitysign.a(entityhuman);
|
||||
+ entityhuman.openSign(tileentitysign);
|
||||
@@ -30,22 +31,34 @@ index 8a31054a1d..503090e38a 100644
|
||||
return tileentitysign.b(entityhuman) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS;
|
||||
} else {
|
||||
return EnumInteractionResult.PASS;
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
index 0e9a90b70..099d98e04 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
@@ -109,6 +109,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
return this.isEditable;
|
||||
}
|
||||
|
||||
+ public void setEditor(EntityHuman entityhuman) { a(entityhuman); } // Purpur - OBFHELPER
|
||||
public void a(EntityHuman entityhuman) {
|
||||
// Paper start
|
||||
//this.c = entityhuman;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 6a9647367f..6cb887ca8b 100644
|
||||
index c8ab99876..ad689ce64 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -58,6 +58,11 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
|
||||
+ public boolean editableSigns = false;
|
||||
+ private void editableSigns() {
|
||||
+ editableSigns = getBoolean("editable-signs", editableSigns);
|
||||
+ public boolean signRightClickEdit = false;
|
||||
+ private void signSettings() {
|
||||
+ signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
+ }
|
||||
+
|
||||
public boolean campfireObeysGravity = true;
|
||||
private void campfireObeysGravity() {
|
||||
campfireObeysGravity = getBoolean("campfire-obeys-gravity", campfireObeysGravity);
|
||||
public boolean batRidable = false;
|
||||
public boolean batRidableInWater = false;
|
||||
public boolean batRequireShiftToMount = true;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From e8610bacd36a293a676ef5c17a290093d0d10f98 Mon Sep 17 00:00:00 2001
|
||||
From 61a33a09d61e1e9585651382352ca544f33f5d21 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
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] Fix 'outdated server' showing in ping before server fully
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
index 295c9ac22..981ded17a 100644
|
||||
index 4bb21c48b..30f16db02 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
@@ -135,6 +135,7 @@ public class PacketStatusListener implements PacketStatusInListener {
|
||||
@@ -21,5 +21,5 @@ index 295c9ac22..981ded17a 100644
|
||||
// Paper end
|
||||
}
|
||||
--
|
||||
2.23.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
From cba4d0db3f9bee98b1149a3c1a680ba66bf56070 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 15 Jun 2019 03:12:15 -0500
|
||||
Subject: [PATCH] Make Iron Golems Swim
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityIronGolem.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
index 63b88f454b..dbdc200ec3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
@@ -20,6 +20,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.ironGolemSwims) this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true));
|
||||
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 19fe36b0ba..26c855b1cc 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -149,6 +149,11 @@ public class PurpurConfig {
|
||||
giantsHaveAI = getBoolean("settings.mobs.giant.have-ai", giantsHaveAI);
|
||||
}
|
||||
|
||||
+ public static boolean ironGolemSwims = true;
|
||||
+ private static void ironGolemSettings() {
|
||||
+ ironGolemSwims = getBoolean("settings.mobs.iron_golem.swims", ironGolemSwims);
|
||||
+ }
|
||||
+
|
||||
public static double crystalsAttackPhantomsRadius = 0.0D;
|
||||
public static float crystalsAttackPhantomDamage = 1.0F;
|
||||
public static double phantomsOrbitCrystalsRadius = 0.0D;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
From 48f1cec737b154364f4208bf7d38eae157aa0b7a 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 - fixes MC-168772
|
||||
|
||||
---
|
||||
.../net/minecraft/server/BlockTurtleEgg.java | 19 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 9 +++++++++
|
||||
2 files changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
index cb36334e4..aa83ef169 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
@@ -157,6 +157,23 @@ public class BlockTurtleEgg extends Block {
|
||||
}
|
||||
|
||||
private boolean a(World world, Entity entity) {
|
||||
- return entity instanceof EntityTurtle ? false : (entity instanceof EntityLiving && !(entity instanceof EntityHuman) ? world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) : true);
|
||||
+ // Purpur start - fix MC-168772
|
||||
+ if (entity instanceof EntityTurtle) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (!world.purpurConfig.turtleEggsBreakFromExpOrbs && entity instanceof EntityExperienceOrb) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (!world.purpurConfig.turtleEggsBreakFromItems && entity instanceof EntityItem) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (!world.purpurConfig.turtleEggsBreakFromMinecarts && entity instanceof EntityMinecartAbstract) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (entity instanceof EntityLiving && !(entity instanceof EntityHuman)) {
|
||||
+ return world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
|
||||
+ }
|
||||
+ return true;
|
||||
+ // Purpur end
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index ad689ce64..737eecb34 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -63,6 +63,15 @@ public class PurpurWorldConfig {
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
}
|
||||
|
||||
+ 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 batRidable = false;
|
||||
public boolean batRidableInWater = false;
|
||||
public boolean batRequireShiftToMount = true;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
42
patches/server/0027-Make-Iron-Golems-Swim.patch
Normal file
42
patches/server/0027-Make-Iron-Golems-Swim.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 7ca5c1da4ff3f87675377993d9051bc7f81299e2 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 15 Jun 2019 03:12:15 -0500
|
||||
Subject: [PATCH] Make Iron Golems Swim
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityIronGolem.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
index 46e4574e5..5414d6975 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
@@ -36,6 +36,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
+ if (world.purpurConfig.ironGolemCanSwim) this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true));
|
||||
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 737eecb34..2d51bbab2 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -333,10 +333,12 @@ public class PurpurWorldConfig {
|
||||
public boolean ironGolemRidable = false;
|
||||
public boolean ironGolemRidableInWater = false;
|
||||
public boolean ironGolemRequireShiftToMount = true;
|
||||
+ public boolean ironGolemCanSwim = false;
|
||||
private void ironGolemSettings() {
|
||||
ironGolemRidable = getBoolean("mobs.iron_golem.ridable", ironGolemRidable);
|
||||
ironGolemRidableInWater = getBoolean("mobs.iron_golem.ridable-in-water", ironGolemRidableInWater);
|
||||
ironGolemRequireShiftToMount = getBoolean("mobs.iron_golem.require-shift-to-mount", ironGolemRequireShiftToMount);
|
||||
+ ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
}
|
||||
|
||||
public boolean llamaRidableInWater = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
From 9e94791f4f71f4927a305d6337ab0f81689fffbd Mon Sep 17 00:00:00 2001
|
||||
From ad1e1785cf2030005ea52d37819ee00489ffaf05 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 21 Jun 2019 14:37:10 -0500
|
||||
Subject: [PATCH] Allow soil to moisten from water directly under it
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BlockSoil.java | 19 +++++++------------
|
||||
.../java/net/minecraft/server/BlockSoil.java | 20 +++++++------------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 12 insertions(+), 12 deletions(-)
|
||||
2 files changed, 12 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java
|
||||
index b6561f2c79..e3814b6270 100644
|
||||
index b6561f2c7..f2ab3ee01 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockSoil.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockSoil.java
|
||||
@@ -112,19 +112,14 @@ public class BlockSoil extends Block {
|
||||
@@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
-import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -112,19 +111,14 @@ public class BlockSoil extends Block {
|
||||
}
|
||||
|
||||
private static boolean a(IWorldReader iworldreader, BlockPosition blockposition) {
|
||||
@@ -34,27 +41,27 @@ index b6561f2c79..e3814b6270 100644
|
||||
-
|
||||
- return true;
|
||||
+ }
|
||||
+ return ((WorldServer)iworldreader).purpurConfig.allowMoistSoilFromWaterBelow && iworldreader.getFluid(blockposition.shift(EnumDirection.DOWN)).a(TagsFluid.WATER);
|
||||
+ return ((WorldServer) iworldreader).purpurConfig.farmlandGetsMoistFromBelow && iworldreader.getFluid(blockposition.shift(EnumDirection.DOWN)).a(TagsFluid.WATER);
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 7544b6a2af..968d32900a 100644
|
||||
index 2d51bbab2..07c3952df 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -96,6 +96,11 @@ public class PurpurWorldConfig {
|
||||
campfiresGoOutInRain = getBoolean("campfires-go-out-in-rain", campfiresGoOutInRain);
|
||||
@@ -58,6 +58,11 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
|
||||
+ public boolean allowMoistSoilFromWaterBelow = true;
|
||||
+ private void allowMoistSoilFromWaterBelow() {
|
||||
+ allowMoistSoilFromWaterBelow = getBoolean("allow-moist-soil-from-water-below", allowMoistSoilFromWaterBelow);
|
||||
+ public boolean farmlandGetsMoistFromBelow = false;
|
||||
+ private void farmlandSettings() {
|
||||
+ farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
+ }
|
||||
+
|
||||
public boolean allowSignColors = false;
|
||||
private void allowSignColors() {
|
||||
allowSignColors = getBoolean("allow-sign-colors", allowSignColors);
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
From 3972fecf35718134bfc2b204d0ea27c9ea9249e3 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 3 Jul 2019 23:58:31 -0500
|
||||
Subject: [PATCH] Disable loot drops on death by cramming
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityLiving.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 5af703bd1..38948133e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -1383,8 +1383,10 @@ public abstract class EntityLiving extends Entity {
|
||||
this.dropInventory(); // CraftBukkit - from below
|
||||
org.bukkit.event.entity.EntityDeathEvent deathEvent; // Paper
|
||||
if (this.isDropExperience() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
||||
+ if (!(damagesource == DamageSource.CRAMMING && net.pl3x.purpur.PurpurConfig.disableDropsOnCrammingDeath)) { // Purpur - do not drop loot if crammed to death
|
||||
this.a(damagesource, flag);
|
||||
this.dropDeathLoot(damagesource, i, flag);
|
||||
+ } // Purpur - do not drop loot if crammed to death
|
||||
// CraftBukkit start - Call death event
|
||||
deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
|
||||
} else {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index fce20c66e..d6af36146 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -136,6 +136,11 @@ public class PurpurConfig {
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
|
||||
+ public static boolean disableDropsOnCrammingDeath = true;
|
||||
+ private static void disableDropsOnCrammingDeath() {
|
||||
+ disableDropsOnCrammingDeath = getBoolean("settings.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
+ }
|
||||
+
|
||||
public static boolean requireShiftToMount = true;
|
||||
private static void requireShiftToMount() {
|
||||
requireShiftToMount = getBoolean("settings.mobs.require-shift-to-mount", requireShiftToMount);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
From 9b406ca83d65b05cdc393d3e267b0c09837bc877 Mon Sep 17 00:00:00 2001
|
||||
From f7d4291b5564a17d4fa7fe1f13c506f60d643e9e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 29 Jun 2019 02:32:40 -0500
|
||||
Subject: [PATCH] Controllable Minecarts
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/Entity.java | 1 +
|
||||
.../server/EntityMinecartAbstract.java | 39 +++++++++++++++++++
|
||||
.../server/EntityMinecartAbstract.java | 38 +++++++++++++++++++
|
||||
.../net/minecraft/server/ItemMinecart.java | 8 ++--
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 30 ++++++++++++++
|
||||
4 files changed, 75 insertions(+), 3 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 38 +++++++++++++++++++
|
||||
4 files changed, 82 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index f5b4c7e3c..6ea10fb56 100644
|
||||
index c6a97d6b5..dbd7236d8 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1284,6 +1284,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1282,6 +1282,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.inLava = true;
|
||||
}
|
||||
|
||||
@@ -23,18 +23,10 @@ index f5b4c7e3c..6ea10fb56 100644
|
||||
return this.inLava;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
||||
index 665bbe07f..1b982a510 100644
|
||||
index 665bbe07f..57288aa73 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
||||
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+import net.pl3x.purpur.PurpurConfig; // Purpur
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
@@ -357,12 +358,50 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
@@ -357,12 +357,50 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
public void a(int i, int j, int k, boolean flag) {}
|
||||
|
||||
@@ -45,9 +37,9 @@ index 665bbe07f..1b982a510 100644
|
||||
+ if (!block.material.isSolid()) {
|
||||
+ block = world.getType(position.shift(EnumDirection.DOWN)).getBlock();
|
||||
+ }
|
||||
+ Double speed = PurpurConfig.controllableMinecartsBlockSpeeds.get(block);
|
||||
+ Double speed = world.purpurConfig.controllableMinecartsBlockSpeeds.get(block);
|
||||
+ if (speed == null) {
|
||||
+ speed = PurpurConfig.controllableMinecartsBaseSpeed;
|
||||
+ speed = world.purpurConfig.controllableMinecartsBaseSpeed;
|
||||
+ }
|
||||
+ return speed;
|
||||
+ }
|
||||
@@ -60,13 +52,13 @@ index 665bbe07f..1b982a510 100644
|
||||
this.setMot(MathHelper.a(vec3d.x, -d0, d0), vec3d.y, MathHelper.a(vec3d.z, -d0, d0));
|
||||
if (this.onGround) {
|
||||
+ // Purpur start
|
||||
+ if (PurpurConfig.controllableMinecarts && !isInWater() && !isInLava() && !passengers.isEmpty()) {
|
||||
+ if (world.purpurConfig.controllableMinecarts && !isInWater() && !isInLava() && !passengers.isEmpty()) {
|
||||
+ Entity passenger = passengers.get(0);
|
||||
+ if (passenger instanceof EntityHuman) {
|
||||
+ EntityHuman entityhuman = (EntityHuman) passenger;
|
||||
+ if (entityhuman.isJumping()) {
|
||||
+ Vec3D mot = getMot();
|
||||
+ setMot(mot.x, PurpurConfig.controllableMinecartsHopBoost, mot.z);
|
||||
+ setMot(mot.x, world.purpurConfig.controllableMinecartsHopBoost, mot.z);
|
||||
+ }
|
||||
+ if (entityhuman.getForward() != 0.0F) {
|
||||
+ Vector dir = entityhuman.getBukkitEntity().getEyeLocation().getDirection().normalize().multiply(getControllableSpeed());
|
||||
@@ -74,7 +66,7 @@ index 665bbe07f..1b982a510 100644
|
||||
+ dir.multiply(-0.5);
|
||||
+ }
|
||||
+ setMot(new Vec3D(dir.getX(), getMot().y, dir.getZ()));
|
||||
+ setStepHeight(PurpurConfig.controllableMinecartsStepHeight);
|
||||
+ setStepHeight(world.purpurConfig.controllableMinecartsStepHeight);
|
||||
+ } else {
|
||||
+ setStepHeight(0.0F);
|
||||
+ }
|
||||
@@ -86,7 +78,7 @@ index 665bbe07f..1b982a510 100644
|
||||
this.setMot(new Vec3D(this.getMot().x * this.derailedX, this.getMot().y * this.derailedY, this.getMot().z * this.derailedZ));
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMinecart.java b/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
index b73e317fb..aa2186add 100644
|
||||
index b73e317fb..e1337a9c0 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
@@ -103,8 +103,10 @@ public class ItemMinecart extends Item {
|
||||
@@ -96,7 +88,7 @@ index b73e317fb..aa2186add 100644
|
||||
- return EnumInteractionResult.FAIL;
|
||||
- } else {
|
||||
+ // Purpur start - place minecarts anywhere
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.controllableMinecartsPlaceAnywhere) return EnumInteractionResult.FAIL;
|
||||
+ if (!world.purpurConfig.controllableMinecartsPlaceAnywhere) return EnumInteractionResult.FAIL;
|
||||
+ if (iblockdata.getMaterial().isSolid()) blockposition = blockposition.shift(itemactioncontext.getClickedFace());
|
||||
+ } //else { // Purpur end - place minecarts anywhere
|
||||
ItemStack itemstack = itemactioncontext.getItemStack();
|
||||
@@ -110,55 +102,72 @@ index b73e317fb..aa2186add 100644
|
||||
+ //} // Purpur - place minecarts anywhere
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 26c855b1c..fce20c66e 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -1,9 +1,13 @@
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 07c3952df..7add97225 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1,9 +1,16 @@
|
||||
package net.pl3x.purpur;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import com.destroystokyo.paper.PaperWorldConfig;
|
||||
+import net.minecraft.server.Block;
|
||||
+import net.minecraft.server.Blocks;
|
||||
+import net.minecraft.server.IRegistry;
|
||||
+import net.minecraft.server.MinecraftKey;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
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.bukkit.event.inventory.InventoryType;
|
||||
@@ -300,4 +304,30 @@ public class PurpurConfig {
|
||||
ridableZombiePigman = getBoolean("settings.ridable.zombie_pigman", ridableZombiePigman);
|
||||
ridableZombieVillager = getBoolean("settings.ridable.zombie_villager", ridableZombieVillager);
|
||||
import org.spigotmc.SpigotWorldConfig;
|
||||
|
||||
+import java.util.HashMap;
|
||||
import java.util.List;
|
||||
+import java.util.Map;
|
||||
|
||||
import static net.pl3x.purpur.PurpurConfig.log;
|
||||
|
||||
@@ -33,6 +40,11 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ 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);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean controllableMinecarts = true;
|
||||
+ public static boolean controllableMinecartsPlaceAnywhere = true;
|
||||
+ public static float controllableMinecartsStepHeight = 1.0F;
|
||||
+ public static double controllableMinecartsHopBoost = 0.5D;
|
||||
+ public static double controllableMinecartsBaseSpeed = 0.1D;
|
||||
+ public static Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
+ private static void controllableMinecarts() {
|
||||
+ controllableMinecarts = getBoolean("settings.controllable-minecarts.enabled", controllableMinecarts);
|
||||
+ controllableMinecartsPlaceAnywhere = getBoolean("settings.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
+ controllableMinecartsStepHeight = (float) getDouble("settings.controllable-minecarts.step-height", controllableMinecartsStepHeight);
|
||||
+ controllableMinecartsHopBoost = getDouble("settings.controllable-minecarts.hop-boost", controllableMinecartsHopBoost);
|
||||
+ controllableMinecartsBaseSpeed = getDouble("settings.controllable-minecarts.base-speed", controllableMinecartsBaseSpeed);
|
||||
+ if (!config.contains("settings.controllable-minecarts.block-speed")) {
|
||||
+ config.createSection("settings.controllable-minecarts.block-speed");
|
||||
+ }
|
||||
+ if (controllableMinecarts) {
|
||||
+ ConfigurationSection section = config.getConfigurationSection("settings.controllable-minecarts.block-speed");
|
||||
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));
|
||||
@@ -77,6 +89,32 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public boolean controllableMinecarts = false;
|
||||
+ public boolean controllableMinecartsPlaceAnywhere = false;
|
||||
+ public float controllableMinecartsStepHeight = 1.0F;
|
||||
+ public double controllableMinecartsHopBoost = 0.5D;
|
||||
+ public double controllableMinecartsBaseSpeed = 0.1D;
|
||||
+ public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
+ private void gameplayMechanicsSettings() {
|
||||
+ controllableMinecarts = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", controllableMinecarts);
|
||||
+ controllableMinecartsPlaceAnywhere = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
+ controllableMinecartsStepHeight = (float) getDouble("gameplay-mechanics.controllable-minecarts.step-height", controllableMinecartsStepHeight);
|
||||
+ controllableMinecartsHopBoost = getDouble("gameplay-mechanics.controllable-minecarts.hop-boost", controllableMinecartsHopBoost);
|
||||
+ controllableMinecartsBaseSpeed = getDouble("gameplay-mechanics.controllable-minecarts.base-speed", controllableMinecartsBaseSpeed);
|
||||
+ ConfigurationSection section = getConfigurationSection("gameplay-mechanics.controllable-minecarts.block-speed");
|
||||
+ if (section != null) {
|
||||
+ for (String key : section.getKeys(false)) {
|
||||
+ Block block = IRegistry.BLOCK.get(new MinecraftKey(key));
|
||||
+ if (block != null) {
|
||||
+ if (block != Blocks.AIR) {
|
||||
+ controllableMinecartsBlockSpeeds.put(block, section.getDouble(key, controllableMinecartsBaseSpeed));
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ set("gameplay-mechanics.controllable-minecarts.block-speed.grass-block", 0.3D);
|
||||
+ set("gameplay-mechanics.controllable-minecarts.block-speed.stone", 0.5D);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+
|
||||
public boolean batRidable = false;
|
||||
public boolean batRidableInWater = false;
|
||||
public boolean batRequireShiftToMount = true;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
From cee8d638411f39049d6764ee0de64eb8c852c496 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 11:09:25 -0500
|
||||
Subject: [PATCH] Make illusioners naturally spawn
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/Biomes.java | 18 ++++++++++++++++++
|
||||
.../net/minecraft/server/SpawnerCreature.java | 4 ++++
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
3 files changed, 27 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Biomes.java b/src/main/java/net/minecraft/server/Biomes.java
|
||||
index d1f8695fee..27e82af009 100644
|
||||
--- a/src/main/java/net/minecraft/server/Biomes.java
|
||||
+++ b/src/main/java/net/minecraft/server/Biomes.java
|
||||
@@ -112,6 +112,24 @@ public abstract class Biomes {
|
||||
addSpawn("eroded_badlands", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
addSpawn("modified_badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.GIANT, 10, 1, 1);
|
||||
}
|
||||
+ if (net.pl3x.purpur.PurpurConfig.illusionersNaturallySpawn) {
|
||||
+ addSpawn("plains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("sunflower_plains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("desert", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("desert_hills", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("desert_lakes", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("mountains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("modified_gravelly_mountains", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("savanna", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("shattered_savanna", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("shattered_savanna_plateau", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 5, 1, 1);
|
||||
+ addSpawn("badlands", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 10, 1, 1);
|
||||
+ addSpawn("badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 10, 1, 1);
|
||||
+ addSpawn("eroded_badlands", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 10, 1, 1);
|
||||
+ addSpawn("modified_badlands_plateau", EnumCreatureType.MONSTER, EntityTypes.ILLUSIONER, 10, 1, 1);
|
||||
+ }
|
||||
}
|
||||
|
||||
private static void addSpawn(String biome, EnumCreatureType ct, EntityTypes et, int weight, int min_group, int max_group) {
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index 53d5900411..8576a7d97a 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -82,6 +82,10 @@ public final class SpawnerCreature {
|
||||
if (!net.pl3x.purpur.PurpurConfig.giantsNaturallySpawn) {
|
||||
return i;
|
||||
}
|
||||
+ } else if (entitytypes == EntityTypes.ILLUSIONER) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.illusionersNaturallySpawn) {
|
||||
+ return i;
|
||||
+ }
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index d6af361467..b14a4a57cc 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -158,6 +158,11 @@ public class PurpurConfig {
|
||||
giantsHaveAI = getBoolean("settings.mobs.giant.have-ai", giantsHaveAI);
|
||||
}
|
||||
|
||||
+ public static boolean illusionersNaturallySpawn = true;
|
||||
+ private static void illusionersSettings() {
|
||||
+ illusionersNaturallySpawn = getBoolean("settings.mobs.illusioner.naturally-spawn", illusionersNaturallySpawn);
|
||||
+ }
|
||||
+
|
||||
public static boolean ironGolemSwims = true;
|
||||
private static void ironGolemSettings() {
|
||||
ironGolemSwims = getBoolean("settings.mobs.iron_golem.swims", ironGolemSwims);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
From 47688a093b08a48bbfa21412812646fcd333f4dd Mon Sep 17 00:00:00 2001
|
||||
From 4bed950206f3e5b08010614e08bd576562b2e825 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 17:40:30 -0500
|
||||
Subject: [PATCH] Allow color codes on signs
|
||||
Subject: [PATCH] Signs allow color codes
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityPlayer.java | 1 +
|
||||
.../net/minecraft/server/PlayerConnection.java | 8 ++++++++
|
||||
.../java/net/minecraft/server/TileEntitySign.java | 14 ++++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
4 files changed, 28 insertions(+)
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
4 files changed, 25 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 15230a834..5e56e0e3e 100644
|
||||
index 15230a834..415cdb1c3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1124,6 +1124,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@Override
|
||||
public void openSign(TileEntitySign tileentitysign) {
|
||||
tileentitysign.a((EntityHuman) this);
|
||||
+ if (world.purpurConfig.allowSignColors) this.playerConnection.sendPacket(tileentitysign.getTranslatedUpdatePacket()); // Purpur
|
||||
+ if (world.purpurConfig.signAllowColors) this.playerConnection.sendPacket(tileentitysign.getTranslatedUpdatePacket()); // Purpur
|
||||
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 108377d76..f7ee28913 100644
|
||||
index 108377d76..fee512a47 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -2576,6 +2576,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -31,7 +31,7 @@ index 108377d76..f7ee28913 100644
|
||||
}
|
||||
// Paper end
|
||||
+ // Purpur start
|
||||
+ if (worldserver.purpurConfig.allowSignColors) {
|
||||
+ if (worldserver.purpurConfig.signAllowColors) {
|
||||
+ lines[i] = astring[i];
|
||||
+ if (player.hasPermission("purpur.sign.color")) lines[i] = lines[i].replaceAll("(?i)&([0-9a-fr])", "\u00a7$1");
|
||||
+ if (player.hasPermission("purpur.sign.style")) lines[i] = lines[i].replaceAll("(?i)&([l-or])", "\u00a7$1");
|
||||
@@ -42,22 +42,22 @@ index 108377d76..f7ee28913 100644
|
||||
}
|
||||
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
index 5eb86c434..8810a1120 100644
|
||||
index 099d98e04..19d76c8cc 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
@@ -119,6 +119,20 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
@@ -89,6 +89,20 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
this.g[i] = null;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public PacketPlayOutTileEntityData getTranslatedUpdatePacket() {
|
||||
+ NBTTagCompound nbt = this.b();
|
||||
+ NBTTagCompound nbt = save(new NBTTagCompound());
|
||||
+ for (int i = 0; i < 4; ++i) {
|
||||
+ String line = lines[i].getLegacyString().replace("\u00a7", "&");
|
||||
+ if (line.endsWith("&r")) {
|
||||
+ line = line.substring(0, line.length() - 2);
|
||||
+ }
|
||||
+ nbt.setString("Text" + (i + 1), IChatBaseComponent.ChatSerializer.a(new ChatMessage(line)));
|
||||
+ nbt.setString("Text" + (i + 1), IChatBaseComponent.ChatSerializer.toJson(new ChatMessage(line)));
|
||||
+ }
|
||||
+ return new PacketPlayOutTileEntityData(position, 9, nbt);
|
||||
+ }
|
||||
@@ -67,19 +67,20 @@ index 5eb86c434..8810a1120 100644
|
||||
@Override
|
||||
public PacketPlayOutTileEntityData getUpdatePacket() {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 6cb887ca8..061b02e45 100644
|
||||
index 7add97225..5faeb7757 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -95,4 +95,9 @@ public class PurpurWorldConfig {
|
||||
private void campfiresGoOutInRain() {
|
||||
campfiresGoOutInRain = getBoolean("campfires-go-out-in-rain", campfiresGoOutInRain);
|
||||
@@ -75,8 +75,10 @@ public class PurpurWorldConfig {
|
||||
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
}
|
||||
+
|
||||
+ public boolean allowSignColors = false;
|
||||
+ private void allowSignColors() {
|
||||
+ allowSignColors = getBoolean("allow-sign-colors", allowSignColors);
|
||||
+ }
|
||||
}
|
||||
|
||||
+ public boolean signAllowColors = false;
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
+ signAllowColors = getBoolean("blocks.sign.allow-colors", signAllowColors);
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
}
|
||||
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,20 +1,34 @@
|
||||
From 476d9a9f88033cc88be192b638cc1cfa025ce90c Mon Sep 17 00:00:00 2001
|
||||
From d7824473dfa29224ca93f1b642bbe9f89f29dc41 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 19 May 2019 18:11:53 -0500
|
||||
Subject: [PATCH] Add regen effect to campfires
|
||||
Subject: [PATCH] Campfires have regen effect
|
||||
|
||||
---
|
||||
.../net/minecraft/server/BlockCampfire.java | 2 +-
|
||||
.../net/minecraft/server/EntityLiving.java | 15 ++++++++--
|
||||
.../net/minecraft/server/EntityPotion.java | 26 ++++++++++++++++
|
||||
.../minecraft/server/TileEntityCampfire.java | 30 +++++++++++++++++++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 23 ++++++++++++++
|
||||
4 files changed, 91 insertions(+), 3 deletions(-)
|
||||
5 files changed, 92 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 6303be944..65f8d803b 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -8,7 +8,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
|
||||
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
public static final BlockStateBoolean b = BlockProperties.r;
|
||||
- public static final BlockStateBoolean c = BlockProperties.y;
|
||||
+ public static final BlockStateBoolean c = BlockProperties.y; public static BlockStateBoolean signalFire() { return c; } // Purpur - OBFHELPER
|
||||
public static final BlockStateBoolean d = BlockProperties.C;
|
||||
public static final BlockStateDirection e = BlockProperties.N;
|
||||
private static final VoxelShape f = Block.a(6.0D, 0.0D, 6.0D, 10.0D, 16.0D, 10.0D);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index b28c0de9a..5af703bd1 100644
|
||||
index 6ca11091c..2128e968a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2781,10 +2781,19 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2772,10 +2772,19 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
public boolean hasLineOfSight(Entity entity) {
|
||||
@@ -25,20 +39,20 @@ index b28c0de9a..5af703bd1 100644
|
||||
+ }
|
||||
+
|
||||
+ public boolean hasLineOfSight(TileEntity te) {
|
||||
+ return hasLineOfSight(te.position.x + 0.5, te.position.y + 0.5, te.position.z + 0.5);
|
||||
+ return hasLineOfSight(te.position.getX() + 0.5, te.position.getY() + 0.5, te.position.getZ() + 0.5);
|
||||
+ }
|
||||
|
||||
- return this.world.rayTrace(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, this)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
|
||||
+ public boolean hasLineOfSight(double x, double y, double z) {
|
||||
+ Vec3D start = new Vec3D(locX(), getHeadY(), locZ());
|
||||
+ Vec3D end = new Vec3D(x, y, z);
|
||||
+ return this.world.rayTrace(new RayTrace(start, end, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, this)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
|
||||
+ return world.rayTrace(new RayTrace(start, end, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, this)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
index 2f9a73ea3..9c9131d8d 100644
|
||||
index 2f9a73ea3..2398499bc 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
@@ -91,6 +91,7 @@ public class EntityPotion extends EntityProjectile {
|
||||
@@ -65,7 +79,7 @@ index 2f9a73ea3..9c9131d8d 100644
|
||||
+ for (MobEffect effect : list) {
|
||||
+ if (effect.getMobEffect() == MobEffects.REGENERATION) {
|
||||
+ for (int i = 0; i < 6 ; i++) {
|
||||
+ ((WorldServer) world).sendParticles(((WorldServer) world).players, null, Particles.HEART, te.position.x, te.position.y + 1, te.position.z, 1, 0.5, 0.5, 0.5, 0, true);
|
||||
+ ((WorldServer) world).sendParticles(((WorldServer) world).players, null, Particles.HEART, te.position.getX(), te.position.getY() + 1, te.position.getZ(), 1, 0.5, 0.5, 0.5, 0, true);
|
||||
+ }
|
||||
+ ((TileEntityCampfire) te).splashed = true;
|
||||
+ break;
|
||||
@@ -82,7 +96,7 @@ index 2f9a73ea3..9c9131d8d 100644
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D);
|
||||
List<EntityLiving> list = this.world.a(EntityLiving.class, axisalignedbb, EntityPotion.e);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityCampfire.java b/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
index a1580b8c6..3a44454ed 100644
|
||||
index a1580b8c6..618ca2d76 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
@@ -14,6 +14,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
@@ -99,12 +113,12 @@ index a1580b8c6..3a44454ed 100644
|
||||
if (flag) {
|
||||
+ // Purpur start
|
||||
+ if ((splashed || !world.purpurConfig.campfireRequireRegenPotion) && world.purpurConfig.campfireRegenInterval > 0 && world.getTime() % world.purpurConfig.campfireRegenInterval == 0L) {
|
||||
+ boolean signalBoost = getBlock().get(BlockCampfire.c);
|
||||
+ boolean signalBoost = getBlock().get(BlockCampfire.signalFire());
|
||||
+ int duration = signalBoost ? world.purpurConfig.campfireRegenBoostDuration : world.purpurConfig.campfireRegenDuration;
|
||||
+ byte amp = (byte) (signalBoost ? world.purpurConfig.campfireRegenBoostAmp : world.purpurConfig.campfireRegenAmp);
|
||||
+ int range = signalBoost ? world.purpurConfig.campfireRegenBoostRange : world.purpurConfig.campfireRegenRange;
|
||||
+ MobEffect regeneration = new MobEffect(MobEffects.REGENERATION, duration, amp, true, true);
|
||||
+ world.a(EntityHuman.class, new AxisAlignedBB(position).g(range)).forEach(entityhuman -> {
|
||||
+ world.getEntitiesByClass(EntityHuman.class, new AxisAlignedBB(position).grow(range)).forEach(entityhuman -> {
|
||||
+ boolean noLineOfSign = true;
|
||||
+ if (!signalBoost && world.purpurConfig.campfireRegenRequireLineOfSight) {
|
||||
+ noLineOfSign = false;
|
||||
@@ -151,37 +165,39 @@ index a1580b8c6..3a44454ed 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 4985f2173..f4811a1d7 100644
|
||||
index 5faeb7757..05c615bc7 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -57,4 +57,27 @@ public class PurpurWorldConfig {
|
||||
PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
@@ -70,6 +70,29 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
+
|
||||
+ public int campfireRegenInterval = 40;
|
||||
|
||||
+ public int campfireRegenInterval = 0;
|
||||
+ public int campfireRegenDuration = 80;
|
||||
+ public int campfireRegenRange = 5;
|
||||
+ public int campfireRegenAmp = 0;
|
||||
+ public boolean campfireRegenRequireLineOfSight = true;
|
||||
+ public int campfireRegenBoostDuration = 80;
|
||||
+ public int campfireRegenBoostDuration = 0;
|
||||
+ public int campfireRegenBoostRange = 10;
|
||||
+ public int campfireRegenBoostAmp = 1;
|
||||
+ public boolean campfireRegenBoostRequireLineOfSight = false;
|
||||
+ public boolean campfireRequireRegenPotion = true;
|
||||
+ private void campfireRegenSettings() {
|
||||
+ campfireRegenInterval = getInt("campfire-regen.interval", campfireRegenInterval);
|
||||
+ campfireRegenDuration = getInt("campfire-regen.duration", campfireRegenDuration);
|
||||
+ campfireRegenRange = getInt("campfire-regen.range", campfireRegenRange);
|
||||
+ campfireRegenAmp = getInt("campfire-regen.amplifier", campfireRegenAmp);
|
||||
+ campfireRegenRequireLineOfSight = getBoolean("campfire-regen.require-line-of-sight", campfireRegenRequireLineOfSight);
|
||||
+ campfireRegenBoostDuration = getInt("campfire-regen.boost-duration", campfireRegenBoostDuration);
|
||||
+ campfireRegenBoostRange = getInt("campfire-regen.boost-range", campfireRegenBoostRange);
|
||||
+ campfireRegenBoostAmp = getInt("campfire-regen.boost-amplifier", campfireRegenBoostAmp);
|
||||
+ campfireRegenBoostRequireLineOfSight = getBoolean("campfire-regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
+ campfireRequireRegenPotion = getBoolean("campfire-regen.requires-regen-potion-to-activate", campfireRequireRegenPotion);
|
||||
+ private void campfireSettings() {
|
||||
+ campfireRegenInterval = getInt("blocks.campfire.regen.interval", campfireRegenInterval);
|
||||
+ campfireRegenDuration = getInt("blocks.campfire.regen.duration", campfireRegenDuration);
|
||||
+ campfireRegenRange = getInt("blocks.campfire.regen.range", campfireRegenRange);
|
||||
+ campfireRegenAmp = getInt("blocks.campfire.regen.amplifier", campfireRegenAmp);
|
||||
+ campfireRegenRequireLineOfSight = getBoolean("blocks.campfire.regen.require-line-of-sight", campfireRegenRequireLineOfSight);
|
||||
+ campfireRegenBoostDuration = getInt("blocks.campfire.regen.boost-duration", campfireRegenBoostDuration);
|
||||
+ campfireRegenBoostRange = getInt("blocks.campfire.regen.boost-range", campfireRegenBoostRange);
|
||||
+ campfireRegenBoostAmp = getInt("blocks.campfire.regen.boost-amplifier", campfireRegenBoostAmp);
|
||||
+ campfireRegenBoostRequireLineOfSight = getBoolean("blocks.campfire.regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
+ campfireRequireRegenPotion = getBoolean("blocks.campfire.regen.requires-potion-to-activate", campfireRequireRegenPotion);
|
||||
+ }
|
||||
}
|
||||
+
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
private void farmlandSettings() {
|
||||
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From e5c6caea930d47af87afbcd73f7150f6672b7a03 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 3 Jul 2019 23:58:31 -0500
|
||||
Subject: [PATCH] Disable loot drops on death by cramming
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityLiving.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 2128e968a..76a925f7a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -1374,8 +1374,10 @@ public abstract class EntityLiving extends Entity {
|
||||
this.dropInventory(); // CraftBukkit - from below
|
||||
org.bukkit.event.entity.EntityDeathEvent deathEvent; // Paper
|
||||
if (this.isDropExperience() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
||||
+ if (!(damagesource == DamageSource.CRAMMING && world.purpurConfig.disableDropsOnCrammingDeath)) { // Purpur
|
||||
this.a(damagesource, flag);
|
||||
this.dropDeathLoot(damagesource, i, flag);
|
||||
+ } // Purpur
|
||||
// CraftBukkit start - Call death event
|
||||
deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
|
||||
} else {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 05c615bc7..1941339d9 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -120,6 +120,7 @@ public class PurpurWorldConfig {
|
||||
public double controllableMinecartsHopBoost = 0.5D;
|
||||
public double controllableMinecartsBaseSpeed = 0.1D;
|
||||
public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
+ public boolean disableDropsOnCrammingDeath = false;
|
||||
private void gameplayMechanicsSettings() {
|
||||
controllableMinecarts = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", controllableMinecarts);
|
||||
controllableMinecartsPlaceAnywhere = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
@@ -138,6 +139,7 @@ public class PurpurWorldConfig {
|
||||
set("gameplay-mechanics.controllable-minecarts.block-speed.grass-block", 0.3D);
|
||||
set("gameplay-mechanics.controllable-minecarts.block-speed.stone", 0.5D);
|
||||
}
|
||||
+ disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
}
|
||||
|
||||
public boolean batRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
82
patches/server/0033-Campfires-burn-out-in-rain.patch
Normal file
82
patches/server/0033-Campfires-burn-out-in-rain.patch
Normal file
@@ -0,0 +1,82 @@
|
||||
From 612b855163ca33e13f5b717fc4b9fdd6c633287b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 21:30:49 -0500
|
||||
Subject: [PATCH] Campfires burn out in rain
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/Block.java | 2 +-
|
||||
.../net/minecraft/server/BlockCampfire.java | 17 ++++++++++++++++-
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
3 files changed, 19 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index b29ed1cfa..d7911c342 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -387,7 +387,7 @@ public class Block implements IMaterial {
|
||||
PacketDebug.a(world, blockposition);
|
||||
}
|
||||
|
||||
- public int a(IWorldReader iworldreader) {
|
||||
+ public int a(IWorldReader world) { return tickRate(world); } public int tickRate(IWorldReader world) { // Purpur - OBFHELPER
|
||||
return 10;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 65f8d803b..3b95dfaaa 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -7,7 +7,7 @@ import javax.annotation.Nullable;
|
||||
public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged {
|
||||
|
||||
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
- public static final BlockStateBoolean b = BlockProperties.r;
|
||||
+ public static final BlockStateBoolean b = BlockProperties.r; public static BlockStateBoolean lit() { return b; } // Purpur - OBFHELPER
|
||||
public static final BlockStateBoolean c = BlockProperties.y; public static BlockStateBoolean signalFire() { return c; } // Purpur - OBFHELPER
|
||||
public static final BlockStateBoolean d = BlockProperties.C;
|
||||
public static final BlockStateDirection e = BlockProperties.N;
|
||||
@@ -74,6 +74,21 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockCampfire.d, flag)).set(BlockCampfire.c, this.h(world.getType(blockposition.down())))).set(BlockCampfire.b, !flag)).set(BlockCampfire.e, blockactioncontext.f());
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public void tick(IBlockData iblockdata, WorldServer world, BlockPosition pos, Random random) {
|
||||
+ if (world.purpurConfig.campfireBurnOutInRain && world.getTime() % 20 == 0L && iblockdata.get(lit()) && world.isRainingAt(pos.shift(EnumDirection.UP))) {
|
||||
+ world.setTypeAndData(pos, iblockdata.set(lit(), false), 3);
|
||||
+ }
|
||||
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int tickRate(IWorldReader world) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
if ((Boolean) iblockdata.get(BlockCampfire.d)) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 1941339d9..9472d66ae 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -80,6 +80,7 @@ public class PurpurWorldConfig {
|
||||
public int campfireRegenBoostAmp = 1;
|
||||
public boolean campfireRegenBoostRequireLineOfSight = false;
|
||||
public boolean campfireRequireRegenPotion = true;
|
||||
+ public boolean campfireBurnOutInRain = false;
|
||||
private void campfireSettings() {
|
||||
campfireRegenInterval = getInt("blocks.campfire.regen.interval", campfireRegenInterval);
|
||||
campfireRegenDuration = getInt("blocks.campfire.regen.duration", campfireRegenDuration);
|
||||
@@ -91,6 +92,7 @@ public class PurpurWorldConfig {
|
||||
campfireRegenBoostAmp = getInt("blocks.campfire.regen.boost-amplifier", campfireRegenBoostAmp);
|
||||
campfireRegenBoostRequireLineOfSight = getBoolean("blocks.campfire.regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
campfireRequireRegenPotion = getBoolean("blocks.campfire.regen.requires-potion-to-activate", campfireRequireRegenPotion);
|
||||
+ campfireBurnOutInRain = getBoolean("blocks.campfire.burn-out-in-rain", campfireBurnOutInRain);
|
||||
}
|
||||
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
83
patches/server/0034-Campfires-should-fall-with-gravity.patch
Normal file
83
patches/server/0034-Campfires-should-fall-with-gravity.patch
Normal file
@@ -0,0 +1,83 @@
|
||||
From 65db3f148c97525d427513cc6e89b21cb378965d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 23 May 2019 16:20:21 -0500
|
||||
Subject: [PATCH] Campfires should fall with gravity
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BlockCampfire.java | 16 ++++++++++++++--
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 16 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 3b95dfaaa..418fa6d1f 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -9,7 +9,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
public static final BlockStateBoolean b = BlockProperties.r; public static BlockStateBoolean lit() { return b; } // Purpur - OBFHELPER
|
||||
public static final BlockStateBoolean c = BlockProperties.y; public static BlockStateBoolean signalFire() { return c; } // Purpur - OBFHELPER
|
||||
- public static final BlockStateBoolean d = BlockProperties.C;
|
||||
+ public static final BlockStateBoolean d = BlockProperties.C; public static BlockStateBoolean waterlogged() { return d; } // Purpur - OBFHELPER
|
||||
public static final BlockStateDirection e = BlockProperties.N;
|
||||
private static final VoxelShape f = Block.a(6.0D, 0.0D, 6.0D, 10.0D, 16.0D, 10.0D);
|
||||
|
||||
@@ -75,8 +75,19 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
+ @Override
|
||||
+ public void onPlace(IBlockData iblockdata, World world, BlockPosition pos, IBlockData iblockdata1, boolean flag) {
|
||||
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer world, BlockPosition pos, Random random) {
|
||||
+ if (world.purpurConfig.campfireFallWithGravity && BlockFalling.canFallThrough(world.getType(pos.down())) && pos.getY() >= 0) {
|
||||
+ world.addEntity(new EntityFallingBlock(world, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, world.getType(pos)));
|
||||
+ }
|
||||
+ if (iblockdata.get(waterlogged()) && iblockdata.get(lit())) {
|
||||
+ world.setTypeAndData(pos, iblockdata.set(lit(), false), 3);
|
||||
+ }
|
||||
if (world.purpurConfig.campfireBurnOutInRain && world.getTime() % 20 == 0L && iblockdata.get(lit()) && world.isRainingAt(pos.shift(EnumDirection.UP))) {
|
||||
world.setTypeAndData(pos, iblockdata.set(lit(), false), 3);
|
||||
}
|
||||
@@ -91,6 +102,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
+ generatoraccess.getBlockTickList().a(blockposition, this, tickRate(generatoraccess)); // Purpur - Campfires should fall with gravity
|
||||
if ((Boolean) iblockdata.get(BlockCampfire.d)) {
|
||||
generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess));
|
||||
}
|
||||
@@ -119,7 +131,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
|
||||
@Override
|
||||
public boolean place(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid) {
|
||||
- if (!(Boolean) iblockdata.get(BlockProperties.C) && fluid.getType() == FluidTypes.WATER) {
|
||||
+ if (!(Boolean) iblockdata.get(BlockCampfire.d) && fluid.getType() == FluidTypes.WATER) { // Purpur
|
||||
boolean flag = (Boolean) iblockdata.get(BlockCampfire.b);
|
||||
|
||||
if (flag) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9472d66ae..be2f6bac1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -81,6 +81,7 @@ public class PurpurWorldConfig {
|
||||
public boolean campfireRegenBoostRequireLineOfSight = false;
|
||||
public boolean campfireRequireRegenPotion = true;
|
||||
public boolean campfireBurnOutInRain = false;
|
||||
+ public boolean campfireFallWithGravity = false;
|
||||
private void campfireSettings() {
|
||||
campfireRegenInterval = getInt("blocks.campfire.regen.interval", campfireRegenInterval);
|
||||
campfireRegenDuration = getInt("blocks.campfire.regen.duration", campfireRegenDuration);
|
||||
@@ -93,6 +94,7 @@ public class PurpurWorldConfig {
|
||||
campfireRegenBoostRequireLineOfSight = getBoolean("blocks.campfire.regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
campfireRequireRegenPotion = getBoolean("blocks.campfire.regen.requires-potion-to-activate", campfireRequireRegenPotion);
|
||||
campfireBurnOutInRain = getBoolean("blocks.campfire.burn-out-in-rain", campfireBurnOutInRain);
|
||||
+ campfireFallWithGravity = getBoolean("blocks.campfire.fall-with-gravity", campfireFallWithGravity);
|
||||
}
|
||||
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From f22ff4979a67ab0064e528c5b068e09e72cf00dc Mon Sep 17 00:00:00 2001
|
||||
From 14c50671c727d7922acaa1a5ea398972feb49cc9 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 6 Jul 2019 17:00:04 -0500
|
||||
Subject: [PATCH] Dont send useless entity packets
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Dont send useless entity packets
|
||||
3 files changed, 27 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index 3a88c9a670..1f7c8f7da0 100644
|
||||
index 3a88c9a67..1f7c8f7da 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -162,6 +162,7 @@ public class EntityTrackerEntry {
|
||||
@@ -45,7 +45,7 @@ index 3a88c9a670..1f7c8f7da0 100644
|
||||
this.tracker.c(entityplayer);
|
||||
entityplayer.c(this.tracker);
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
index e5da2b19c1..5b1d959354 100644
|
||||
index e5da2b19c..5b1d95935 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
@@ -5,11 +5,11 @@ import java.io.IOException;
|
||||
@@ -66,21 +66,19 @@ index e5da2b19c1..5b1d959354 100644
|
||||
protected boolean h;
|
||||
protected boolean i;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index aa68cc366d..5ce6afde79 100644
|
||||
index 15458be9d..9b2ec85b1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -141,6 +141,11 @@ public class PurpurConfig {
|
||||
disableDropsOnCrammingDeath = getBoolean("settings.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
@@ -139,4 +139,9 @@ public class PurpurConfig {
|
||||
loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
loggerSuppressWorldGenFeatureDeserializationError = getBoolean("settings.logger.suppress-world-gen-feature-deserialization-errors", loggerSuppressWorldGenFeatureDeserializationError);
|
||||
}
|
||||
|
||||
+
|
||||
+ public static boolean dontSendUselessEntityPackets = false;
|
||||
+ private static void dontSendUselessEntityPackets() {
|
||||
+ dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
+ }
|
||||
+
|
||||
public static boolean requireShiftToMount = true;
|
||||
private static void requireShiftToMount() {
|
||||
requireShiftToMount = getBoolean("settings.mobs.require-shift-to-mount", requireShiftToMount);
|
||||
}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From 25737109224f0f03d2b5b05312c0a31b3952c424 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 9 Jul 2019 20:56:47 -0500
|
||||
Subject: [PATCH] Fix pig zombies (MC-56653)
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityPigZombie.java | 9 ++++++++-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
index 3321e2257..9938e8a5f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
@@ -140,6 +140,7 @@ public class EntityPigZombie extends EntityZombie {
|
||||
boolean result = super.damageEntity(damagesource, f);
|
||||
|
||||
if (result && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative() && this.hasLineOfSight(entity)) {
|
||||
+ if (world.purpurConfig.pigmenDontTargetUnlessHit) this.setLastDamager((EntityHuman) entity); // Purpur - fix MC-56653
|
||||
this.i((EntityLiving) entity);
|
||||
}
|
||||
|
||||
@@ -158,7 +159,7 @@ public class EntityPigZombie extends EntityZombie {
|
||||
this.angerLevel = event.getNewAnger();
|
||||
// CraftBukkit end
|
||||
this.soundDelay = this.random.nextInt(40);
|
||||
- this.setLastDamager(entityliving);
|
||||
+ if (!world.purpurConfig.pigmenDontTargetUnlessHit) this.setLastDamager(entityliving); // Purpur - fix MC-56653
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -205,6 +206,12 @@ public class EntityPigZombie extends EntityZombie {
|
||||
return this.eA();
|
||||
}
|
||||
|
||||
+ // Purpur start - fix MC-56653
|
||||
+ protected boolean isDropExperience() {
|
||||
+ return super.isDropExperience() && (!world.purpurConfig.pigmenDontTargetUnlessHit || getLastDamager() instanceof EntityHuman);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
static class PathfinderGoalAnger extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
||||
|
||||
public PathfinderGoalAnger(EntityPigZombie entitypigzombie) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 64128359c..f8755060f 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -116,6 +116,11 @@ public class PurpurWorldConfig {
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
}
|
||||
|
||||
+ public boolean pigmenDontTargetUnlessHit = false;
|
||||
+ private void pigmenSettings() {
|
||||
+ pigmenDontTargetUnlessHit = getBoolean("mobs.pigmen.dont-target-unless-hit", pigmenDontTargetUnlessHit);
|
||||
+ }
|
||||
+
|
||||
public float zombieHorseSpawnChance = 0F;
|
||||
private void zombieHorseSettings() {
|
||||
zombieHorseSpawnChance = (float) getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 50fdf55beec37563faed1fa6dc40fa2ccece22c5 Mon Sep 17 00:00:00 2001
|
||||
From 2f83256859aecf5a51cfc362b12e672aa18c12ca Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 6 Jul 2019 21:12:58 -0500
|
||||
Subject: [PATCH] Fix item position desync (MC-4)
|
||||
@@ -6,11 +6,11 @@ Subject: [PATCH] Fix item position desync (MC-4)
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityTrackerEntry.java | 6 ++++++
|
||||
src/main/java/net/minecraft/server/PacketPlayOutEntity.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
3 files changed, 13 insertions(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 2 ++
|
||||
3 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index 1f7c8f7da0..5dd4d392a6 100644
|
||||
index 1f7c8f7da..5dd4d392a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -124,6 +124,12 @@ public class EntityTrackerEntry {
|
||||
@@ -27,7 +27,7 @@ index 1f7c8f7da0..5dd4d392a6 100644
|
||||
boolean flag1 = vec3d.g() >= 7.62939453125E-6D;
|
||||
Packet<?> packet1 = null;
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
index 5b1d959354..0010448e3a 100644
|
||||
index 5b1d95935..0010448e3 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
@@ -14,10 +14,12 @@ public class PacketPlayOutEntity implements Packet<PacketListenerPlayOut> {
|
||||
@@ -44,21 +44,19 @@ index 5b1d959354..0010448e3a 100644
|
||||
return (new Vec3D((double) i, (double) j, (double) k)).a(2.44140625E-4D);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 5ce6afde79..882f7711c7 100644
|
||||
index 9b2ec85b1..3f9913582 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -146,6 +146,11 @@ public class PurpurConfig {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
@@ -141,7 +141,9 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
+ public static boolean fixItemPositionDesync = false;
|
||||
+ private static void fixItemPositionDesync() {
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
+ fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
+ }
|
||||
+
|
||||
public static boolean requireShiftToMount = true;
|
||||
private static void requireShiftToMount() {
|
||||
requireShiftToMount = getBoolean("settings.mobs.require-shift-to-mount", requireShiftToMount);
|
||||
}
|
||||
}
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
From 7f41b1ff626fe428ddef47f024791aa18cef65dd Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 10 Jul 2019 20:43:05 -0500
|
||||
Subject: [PATCH] Option to toggle milk curing bad omen
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/ItemMilkBucket.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMilkBucket.java b/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
index b7dd5e3c07..93131de75c 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
@@ -20,7 +20,9 @@ public class ItemMilkBucket extends Item {
|
||||
}
|
||||
|
||||
if (!world.isClientSide) {
|
||||
+ MobEffect badOmen = entityliving.getEffect(MobEffects.BAD_OMEN); // Purpur
|
||||
entityliving.removeAllEffects(org.bukkit.event.entity.EntityPotionEffectEvent.Cause.MILK); // CraftBukkit
|
||||
+ if (!world.purpurConfig.milkCuresBadOmen && badOmen != null) entityliving.addEffect(badOmen); // Purpur
|
||||
}
|
||||
|
||||
return itemstack.isEmpty() ? new ItemStack(Items.BUCKET) : itemstack;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f8755060f1..81ece70d38 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -111,6 +111,11 @@ public class PurpurWorldConfig {
|
||||
itemsCanBreakTurtleEggs = getBoolean("items-can-break-turtle-eggs", itemsCanBreakTurtleEggs);
|
||||
}
|
||||
|
||||
+ public boolean milkCuresBadOmen = false;
|
||||
+ private void milkCuresBadOmen() {
|
||||
+ milkCuresBadOmen = getBoolean("milk-cures-bad-omen", milkCuresBadOmen);
|
||||
+ }
|
||||
+
|
||||
public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
private void enderDragonSettings() {
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,52 +1,139 @@
|
||||
From e800b70ec7a2080ccc46d4231bc22743d9ee871f Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Mon, 11 Mar 2019 12:18:29 -0700
|
||||
Subject: [PATCH] Rate limit packets incoming from players
|
||||
From fa88fe64b87377035d3f7376e69e39514b8f55e0 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 7 Feb 2020 09:45:09 -0600
|
||||
Subject: [PATCH] Rate limit incoming packets from players
|
||||
|
||||
---
|
||||
.../com/destroystokyo/paper/PaperConfig.java | 12 ++
|
||||
.../paper/network/PacketLimiter.java | 135 ++++++++++++++++++
|
||||
.../net/minecraft/server/NetworkManager.java | 7 +
|
||||
.../minecraft/server/PlayerConnection.java | 54 +++++++
|
||||
4 files changed, 208 insertions(+)
|
||||
create mode 100644 src/main/java/com/destroystokyo/paper/network/PacketLimiter.java
|
||||
.../minecraft/server/PlayerConnection.java | 56 +++++++
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 12 ++
|
||||
.../pl3x/purpur/network/PacketLimiter.java | 147 ++++++++++++++++++
|
||||
4 files changed, 222 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/network/PacketLimiter.java
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index d886f1d145..a60b825a0a 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -368,6 +368,18 @@ public class PaperConfig {
|
||||
maxBookTotalSizeMultiplier = getDouble("settings.book-size.total-multiplier", maxBookTotalSizeMultiplier);
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index 96a785af2..803ede8e3 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -150,6 +150,13 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
|
||||
private static <T extends PacketListener> void a(Packet<T> packet, PacketListener packetlistener) {
|
||||
+ // Purpur start - Ratelimit packets
|
||||
+ if (packetlistener instanceof PlayerConnection) {
|
||||
+ if (((PlayerConnection)packetlistener).rateLimitPacket(packet)) {
|
||||
+ return; // we've been killed as a result of rate limiting
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
packet.a((T) packetlistener); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index fee512a47..e8851ffde 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -140,6 +140,62 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
+ // Purpur start - ratelimit packets
|
||||
+ /*
|
||||
+ * We cannot rely on tick() being called. If a server lags we could end up kicking everyone!
|
||||
+ * So we must rely on our own timer.
|
||||
+ */
|
||||
+ private final net.pl3x.purpur.network.PacketLimiter packetLimiter = net.pl3x.purpur.PurpurConfig.packetRateLimit < 0 ?
|
||||
+ null : new net.pl3x.purpur.network.PacketLimiter(net.pl3x.purpur.PurpurConfig.packetRateLimitInterval * 1000.0, 100);
|
||||
+ private boolean kickedForPacketSpam;
|
||||
+
|
||||
+ private static final java.text.DecimalFormat ONE_DECIMAL_PLACE = new java.text.DecimalFormat("0.0");
|
||||
+
|
||||
+ /**
|
||||
+ * @return {@code true} if the client has been killed as a result of rate limiting, {@code false} if not
|
||||
+ */
|
||||
+ boolean rateLimitPacket(final Packet<?> packet) {
|
||||
+ final net.pl3x.purpur.network.PacketLimiter limiter = this.packetLimiter;
|
||||
+ if (limiter == null) {
|
||||
+ // not configured
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // avoid contending the lock if we've been kicked already
|
||||
+ if (this.kickedForPacketSpam) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ final int limit = net.pl3x.purpur.PurpurConfig.packetRateLimit;
|
||||
+
|
||||
+ synchronized (limiter) {
|
||||
+ // we need to re-check this, as it could have changed during the lock hold
|
||||
+ if (this.kickedForPacketSpam) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ final int packets = limiter.incrementPackets(1);
|
||||
+
|
||||
+ if (packets / (limiter.intervalTime / 1000.0) <= limit) {
|
||||
+ // below limit
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ this.kickedForPacketSpam = true;
|
||||
+ this.minecraftServer.postToMainThread(() -> {
|
||||
+ if (PlayerConnection.this.processedDisconnect) {
|
||||
+ return; // no point, we've disconnected already
|
||||
+ }
|
||||
+ PlayerConnection.this.disconnect(net.pl3x.purpur.PurpurConfig.packetRateLimitKickMessage);
|
||||
+ PlayerConnection.LOGGER.warn("{} was kicked for sending too many packets! {} in the last {} seconds",
|
||||
+ PlayerConnection.this.player.getDisplayName().getString(), packets,
|
||||
+ ONE_DECIMAL_PLACE.format(limiter.intervalTime / 1000.0));
|
||||
+ });
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
public void tick() {
|
||||
this.syncPosition();
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 3f9913582..e791c52a4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -140,6 +140,18 @@ public class PurpurConfig {
|
||||
loggerSuppressWorldGenFeatureDeserializationError = getBoolean("settings.logger.suppress-world-gen-feature-deserialization-errors", loggerSuppressWorldGenFeatureDeserializationError);
|
||||
}
|
||||
|
||||
+ public static int packetRateLimit = 250; // per second
|
||||
+ public static double packetRateLimitInterval = 10.0; // seconds
|
||||
+ public static String packetRateLimitKickMessage = "Sent too many packets";
|
||||
+ private static void packetRateLimit() {
|
||||
+ packetRateLimit = Math.max(-1, getInt("settings.spam-limiter.packets-per-second", packetRateLimit));
|
||||
+ packetRateLimitInterval = getDouble("settings.spam-limiter.packet-spam-interval", packetRateLimitInterval);
|
||||
+ private static void packetLimiterSettings() {
|
||||
+ packetRateLimit = Math.max(-1, getInt("settings.packet-limiter.packets-per-second", packetRateLimit));
|
||||
+ packetRateLimitInterval = getDouble("settings.packet-limiter.packet-spam-interval", packetRateLimitInterval);
|
||||
+ if (packetRateLimitInterval <= 0.0 && packetRateLimit >= 0) {
|
||||
+ fatal("If packet rate limiting is enabled, the rate limit interval must be greater-than 0!");
|
||||
+ log(Level.SEVERE, "If packet rate limiting is enabled, the rate limit interval must be greater than 0!");
|
||||
+ }
|
||||
+ packetRateLimitKickMessage = getString("messages.kick.packet-spam", packetRateLimitKickMessage);
|
||||
+ packetRateLimitKickMessage = getString("settings.packet-limiter.kick-message", packetRateLimitKickMessage);
|
||||
+ }
|
||||
+
|
||||
public static boolean asyncChunks = false;
|
||||
//public static boolean asyncChunkGeneration = true; // Leave out for now until we can control this
|
||||
//public static boolean asyncChunkGenThreadPerWorld = true; // Leave out for now until we can control this
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/network/PacketLimiter.java b/src/main/java/com/destroystokyo/paper/network/PacketLimiter.java
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
public static boolean fixItemPositionDesync = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/network/PacketLimiter.java b/src/main/java/net/pl3x/purpur/network/PacketLimiter.java
|
||||
new file mode 100644
|
||||
index 0000000000..91c8c5f53a
|
||||
index 000000000..e51e7eb9d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/network/PacketLimiter.java
|
||||
@@ -0,0 +1,135 @@
|
||||
+package com.destroystokyo.paper.network;
|
||||
+++ b/src/main/java/net/pl3x/purpur/network/PacketLimiter.java
|
||||
@@ -0,0 +1,147 @@
|
||||
+package net.pl3x.purpur.network;
|
||||
+
|
||||
+import java.util.Arrays;
|
||||
+
|
||||
+public class PacketLimiter {
|
||||
+
|
||||
+ /** multiplier to convert ns to ms */
|
||||
+ /**
|
||||
+ * multiplier to convert ns to ms
|
||||
+ */
|
||||
+ private static final double NANOSECONDS_TO_MILLISECONDS = 1.0e-6; // 1e3 / 1e9
|
||||
+
|
||||
+ /**
|
||||
@@ -64,27 +151,36 @@ index 0000000000..91c8c5f53a
|
||||
+ */
|
||||
+ public final int totalBuckets;
|
||||
+
|
||||
+ /**contains all packet data, note that indices of buckets will wrap around the array */
|
||||
+ /**
|
||||
+ * contains all packet data, note that indices of buckets will wrap around the array
|
||||
+ */
|
||||
+ private final int[] data;
|
||||
+
|
||||
+ /** pointer which represents the bucket containing the newest data */
|
||||
+ /**
|
||||
+ * pointer which represents the bucket containing the newest data
|
||||
+ */
|
||||
+ private int newestData;
|
||||
+
|
||||
+ /** the time attached to the bucket at newestData */
|
||||
+ /**
|
||||
+ * the time attached to the bucket at newestData
|
||||
+ */
|
||||
+ private double lastBucketTime;
|
||||
+
|
||||
+ /** cached sum of all data */
|
||||
+ /**
|
||||
+ * cached sum of all data
|
||||
+ */
|
||||
+ private int sum;
|
||||
+
|
||||
+ /**
|
||||
+ * Constructs a packetlimiter which will record total packets sent over the specified
|
||||
+ * interval time (in ms) with the specified number of buckets
|
||||
+ *
|
||||
+ * @param intervalTime The specified interval time, in ms
|
||||
+ * @param totalBuckets The total number of buckets
|
||||
+ */
|
||||
+ public PacketLimiter(final double intervalTime, final int totalBuckets) {
|
||||
+ this.intervalTime = intervalTime;
|
||||
+ this.intervalResolution = intervalTime/(double)totalBuckets;
|
||||
+ this.intervalResolution = intervalTime / (double) totalBuckets;
|
||||
+ this.totalBuckets = totalBuckets;
|
||||
+ this.data = new int[totalBuckets];
|
||||
+ }
|
||||
@@ -111,6 +207,7 @@ index 0000000000..91c8c5f53a
|
||||
+ /**
|
||||
+ * Adds to this limiter's packet count. Old data is automatically purged, and the current time from {@link System#nanoTime()}
|
||||
+ * is used to record this data. Returns the new packet count.
|
||||
+ *
|
||||
+ * @param packets The number of packets to attach to the current time
|
||||
+ * @return The new packet count
|
||||
+ */
|
||||
@@ -175,89 +272,6 @@ index 0000000000..91c8c5f53a
|
||||
+ return this.sum;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index 96a785af27..ff8b5e76f3 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -150,6 +150,13 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
|
||||
private static <T extends PacketListener> void a(Packet<T> packet, PacketListener packetlistener) {
|
||||
+ // Paper start - Ratelimit packets
|
||||
+ if (packetlistener instanceof PlayerConnection) {
|
||||
+ if (((PlayerConnection)packetlistener).rateLimitPacket(packet)) {
|
||||
+ return; // we've been killed as a result of rate limiting
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
packet.a((T) packetlistener); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 925824c349..cdc81ff1e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -140,6 +140,60 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
+ // Paper start - ratelimit packets
|
||||
+ /*
|
||||
+ * We cannot rely on tick() being called. If a server lags we could end up kicking everyone!
|
||||
+ * So we must rely on our own timer.
|
||||
+ */
|
||||
+ private final com.destroystokyo.paper.network.PacketLimiter packetLimiter = com.destroystokyo.paper.PaperConfig.packetRateLimit < 0 ?
|
||||
+ null : new com.destroystokyo.paper.network.PacketLimiter(com.destroystokyo.paper.PaperConfig.packetRateLimitInterval * 1000.0, 100);
|
||||
+ private boolean kickedForPacketSpam;
|
||||
+
|
||||
+ private static final java.text.DecimalFormat ONE_DECIMAL_PLACE = new java.text.DecimalFormat("0.0");
|
||||
+
|
||||
+ /** @return {@code true} if the client has been killed as a result of rate limiting, {@code false} if not */
|
||||
+ boolean rateLimitPacket(final Packet<?> packet) {
|
||||
+ final com.destroystokyo.paper.network.PacketLimiter limiter = this.packetLimiter;
|
||||
+ if (limiter == null) {
|
||||
+ // not configured
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // avoid contending the lock if we've been kicked already
|
||||
+ if (this.kickedForPacketSpam) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ final int limit = com.destroystokyo.paper.PaperConfig.packetRateLimit;
|
||||
+
|
||||
+ synchronized (limiter) {
|
||||
+ // we need to re-check this, as it could have changed during the lock hold
|
||||
+ if (this.kickedForPacketSpam) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ final int packets = limiter.incrementPackets(1);
|
||||
+
|
||||
+ if (packets / (limiter.intervalTime / 1000.0) <= limit) {
|
||||
+ // below limit
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ this.kickedForPacketSpam = true;
|
||||
+ this.minecraftServer.postToMainThread(() -> {
|
||||
+ if (PlayerConnection.this.processedDisconnect) {
|
||||
+ return; // no point, we've disconnected already
|
||||
+ }
|
||||
+ PlayerConnection.this.disconnect(com.destroystokyo.paper.PaperConfig.packetRateLimitKickMessage);
|
||||
+ PlayerConnection.LOGGER.warn("{} was kicked for sending too many packets! {} in the last {} seconds",
|
||||
+ PlayerConnection.this.player.getDisplayName().getString(), packets,
|
||||
+ ONE_DECIMAL_PLACE.format(limiter.intervalTime / 1000.0));
|
||||
+ });
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
public void tick() {
|
||||
this.syncPosition();
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
64
patches/server/0038-Fix-pig-zombies-MC-56653.patch
Normal file
64
patches/server/0038-Fix-pig-zombies-MC-56653.patch
Normal file
@@ -0,0 +1,64 @@
|
||||
From 66b0d01874ce9969852d99bd8b92376f035b5447 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 9 Jul 2019 20:56:47 -0500
|
||||
Subject: [PATCH] Fix pig zombies (MC-56653)
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityPigZombie.java | 9 ++++++++-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
index fb9ef88ea..227fff3f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
@@ -155,6 +155,7 @@ public class EntityPigZombie extends EntityZombie {
|
||||
boolean result = super.damageEntity(damagesource, f);
|
||||
|
||||
if (result && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative() && this.hasLineOfSight(entity)) {
|
||||
+ if (world.purpurConfig.zombiePigmanDontTargetUnlessHit) this.setLastDamager((EntityHuman) entity); // Purpur - fix MC-56653
|
||||
this.i((EntityLiving) entity);
|
||||
}
|
||||
|
||||
@@ -173,7 +174,7 @@ public class EntityPigZombie extends EntityZombie {
|
||||
this.angerLevel = event.getNewAnger();
|
||||
// CraftBukkit end
|
||||
this.soundDelay = this.random.nextInt(40);
|
||||
- this.setLastDamager(entityliving);
|
||||
+ if (!world.purpurConfig.zombiePigmanDontTargetUnlessHit) this.setLastDamager(entityliving); // Purpur - fix MC-56653
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -215,6 +216,12 @@ public class EntityPigZombie extends EntityZombie {
|
||||
return this.eA();
|
||||
}
|
||||
|
||||
+ // Purpur start - fix MC-56653
|
||||
+ protected boolean isDropExperience() {
|
||||
+ return super.isDropExperience() && (!world.purpurConfig.zombiePigmanDontTargetUnlessHit || getLastDamager() instanceof EntityHuman);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
static class PathfinderGoalAnger extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
||||
|
||||
public PathfinderGoalAnger(EntityPigZombie entitypigzombie) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index be2f6bac1..e660121df 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -774,10 +774,12 @@ public class PurpurWorldConfig {
|
||||
public boolean zombiePigmanRidable = false;
|
||||
public boolean zombiePigmanRidableInWater = false;
|
||||
public boolean zombiePigmanRequireShiftToMount = true;
|
||||
+ public boolean zombiePigmanDontTargetUnlessHit = false;
|
||||
private void zombiePigmanSettings() {
|
||||
zombiePigmanRidable = getBoolean("mobs.zombie_pigman.ridable", zombiePigmanRidable);
|
||||
zombiePigmanRidableInWater = getBoolean("mobs.zombie_pigman.ridable-in-water", zombiePigmanRidableInWater);
|
||||
zombiePigmanRequireShiftToMount = getBoolean("mobs.zombie_pigman.require-shift-to-mount", zombiePigmanRequireShiftToMount);
|
||||
+ zombiePigmanDontTargetUnlessHit = getBoolean("mobs.zombie_pigman.dont-target-unless-hit", zombiePigmanDontTargetUnlessHit);
|
||||
}
|
||||
|
||||
public boolean zombieVillagerRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 4337b1d75f67fd41da02eda525fac381840a33de Mon Sep 17 00:00:00 2001
|
||||
From 50380a3f922e7c37c0840a1ee205c5b76cea0fd7 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] Implement AFK API
|
||||
@@ -17,10 +17,10 @@ Subject: [PATCH] Implement AFK API
|
||||
10 files changed, 112 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 3be37a1008..9904b78c6c 100644
|
||||
index dbd7236d8..a2fe1a424 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1375,6 +1375,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1373,6 +1373,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return MathHelper.c(f * f + f1 * f1 + f2 * f2);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ index 3be37a1008..9904b78c6c 100644
|
||||
double d3 = this.locX() - d0;
|
||||
double d4 = this.locY() - d1;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index de22cad764..9d26bd1e4c 100644
|
||||
index de22cad76..9d26bd1e4 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -86,6 +86,15 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@@ -49,7 +49,7 @@ index de22cad764..9d26bd1e4c 100644
|
||||
super(EntityTypes.PLAYER, world);
|
||||
this.bV = ItemStack.a;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index d72b45119d..6022079a9d 100644
|
||||
index 415cdb1c3..670dcf282 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1615,8 +1615,51 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -105,7 +105,7 @@ index d72b45119d..6022079a9d 100644
|
||||
return this.serverStatisticManager;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
index 774ec96f0a..5ef8816340 100644
|
||||
index 774ec96f0..5ef881634 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
@@ -116,28 +116,18 @@ public interface IEntityAccess {
|
||||
@@ -150,7 +150,7 @@ index 774ec96f0a..5ef8816340 100644
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
index 8d7273a38b..71c61dc45e 100644
|
||||
index e1fdee279..4665671ef 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
@@ -7,6 +7,7 @@ import javax.annotation.Nullable;
|
||||
@@ -161,19 +161,19 @@ index 8d7273a38b..71c61dc45e 100644
|
||||
public static final Predicate<EntityLiving> b = EntityLiving::isAlive;
|
||||
public static final Predicate<Entity> c = (entity) -> {
|
||||
return entity.isAlive() && !entity.isVehicle() && !entity.isPassenger();
|
||||
@@ -23,6 +24,7 @@ public final class IEntitySelector {
|
||||
public static final Predicate<Entity> f = (entity) -> {
|
||||
@@ -24,6 +25,7 @@ public final class IEntitySelector {
|
||||
return !entity.isSpectator();
|
||||
};
|
||||
public static Predicate<EntityHuman> isInsomniac = (player) -> MathHelper.clamp(((EntityPlayer) player).getStatisticManager().getStatisticValue(StatisticList.CUSTOM.b(StatisticList.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Purpur
|
||||
+ public static Predicate<EntityHuman> notAfk = (player) -> !player.isAfk(); // Purpur
|
||||
|
||||
public static Predicate<Entity> a(double d0, double d1, double d2, double d3) {
|
||||
double d4 = d3 * d3;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index a4af019bc6..2db59c55ca 100644
|
||||
index e8851ffde..d897c7fd4 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -277,6 +277,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -279,6 +279,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
}
|
||||
|
||||
if (this.player.F() > 0L && this.minecraftServer.getIdleTimeout() > 0 && SystemUtils.getMonotonicMillis() - this.player.F() > (long) (this.minecraftServer.getIdleTimeout() * 1000 * 60)) {
|
||||
@@ -186,7 +186,7 @@ index a4af019bc6..2db59c55ca 100644
|
||||
this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
|
||||
}
|
||||
@@ -493,6 +499,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -495,6 +501,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -195,7 +195,7 @@ index a4af019bc6..2db59c55ca 100644
|
||||
// Skip the first time we do this
|
||||
if (true) { // Spigot - don't skip any move events
|
||||
Location oldTo = to.clone();
|
||||
@@ -1162,6 +1170,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -1164,6 +1172,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -205,7 +205,7 @@ index a4af019bc6..2db59c55ca 100644
|
||||
if (from.getX() != Double.MAX_VALUE) {
|
||||
Location oldTo = to.clone();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 2d0db3e05f..04685efc52 100644
|
||||
index 874b8c129..567b297e0 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -376,7 +376,7 @@ public class WorldServer extends World {
|
||||
@@ -217,7 +217,7 @@ index 2d0db3e05f..04685efc52 100644
|
||||
})) {
|
||||
// CraftBukkit start
|
||||
long l = this.worldData.getDayTime() + 24000L;
|
||||
@@ -657,7 +657,7 @@ public class WorldServer extends World {
|
||||
@@ -682,7 +682,7 @@ public class WorldServer extends World {
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -227,33 +227,33 @@ index 2d0db3e05f..04685efc52 100644
|
||||
} else if (entityplayer.isSleeping()) {
|
||||
++j;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 6d875b78b9..7422f361e4 100644
|
||||
index e660121df..6fb0d94a8 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -106,6 +106,21 @@ public class PurpurWorldConfig {
|
||||
allowSignColors = getBoolean("allow-sign-colors", allowSignColors);
|
||||
@@ -146,6 +146,21 @@ public class PurpurWorldConfig {
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
}
|
||||
|
||||
+ public boolean idleTimeoutKick = true;
|
||||
+ public boolean idleTimeoutTickNearbyEntities = false;
|
||||
+ public boolean idleTimeoutTickNearbyEntities = true;
|
||||
+ public boolean idleTimeoutCountAsSleeping = false;
|
||||
+ public boolean idleTimeoutUpdateTabList = true;
|
||||
+ public boolean idleTimeoutUpdateTabList = false;
|
||||
+ public String idleTimeoutBroadcastAway = "&e&o{player} is now AFK";
|
||||
+ public String idleTimeoutBroadcastBack = "&e&o{player} is no longer AFK";
|
||||
+ private void playerIdleTimeoutSettings() {
|
||||
+ idleTimeoutKick = getBoolean("idle-timeout.kick-if-idle", idleTimeoutKick);
|
||||
+ idleTimeoutTickNearbyEntities = getBoolean("idle-timeout.tick-nearby-entities", idleTimeoutTickNearbyEntities);
|
||||
+ idleTimeoutCountAsSleeping = getBoolean("idle-timeout.count-as-sleeping", idleTimeoutCountAsSleeping);
|
||||
+ idleTimeoutUpdateTabList = getBoolean("idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
|
||||
+ idleTimeoutBroadcastAway = org.bukkit.ChatColor.translateAlternateColorCodes('&', getString("idle-timeout.broadcast.away", idleTimeoutBroadcastAway));
|
||||
+ idleTimeoutBroadcastBack = org.bukkit.ChatColor.translateAlternateColorCodes('&', getString("idle-timeout.broadcast.back", idleTimeoutBroadcastBack));
|
||||
+ private void idleTimeoutSettings() {
|
||||
+ idleTimeoutKick = getBoolean("gameplay-mechanics.player.idle-timeout.kick-if-idle", idleTimeoutKick);
|
||||
+ 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);
|
||||
+ idleTimeoutBroadcastAway = org.bukkit.ChatColor.translateAlternateColorCodes('&', getString("gameplay-mechanics.player.idle-timeout.broadcast.away", idleTimeoutBroadcastAway));
|
||||
+ idleTimeoutBroadcastBack = org.bukkit.ChatColor.translateAlternateColorCodes('&', getString("gameplay-mechanics.player.idle-timeout.broadcast.back", idleTimeoutBroadcastBack));
|
||||
+ }
|
||||
+
|
||||
public boolean itemsCanBreakTurtleEggs = false;
|
||||
private void itemsCanBreakTurtleEggs() {
|
||||
itemsCanBreakTurtleEggs = getBoolean("items-can-break-turtle-eggs", itemsCanBreakTurtleEggs);
|
||||
public boolean batRidable = false;
|
||||
public boolean batRidableInWater = false;
|
||||
public boolean batRequireShiftToMount = true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index c1acec87f9..8c5d7bd2b3 100644
|
||||
index c1acec87f..8c5d7bd2b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2089,4 +2089,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -279,7 +279,7 @@ index c1acec87f9..8c5d7bd2b3 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 6e165a1649..da5fef091a 100644
|
||||
index 6e165a164..da5fef091 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -137,6 +137,7 @@ public class ActivationRange
|
||||
@@ -0,0 +1,48 @@
|
||||
From f32212737ecbc1ebcd603e0099cd50ad3afb330d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 10 Jul 2019 20:43:05 -0500
|
||||
Subject: [PATCH] Option to toggle milk curing bad omen
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/ItemMilkBucket.java | 3 +++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMilkBucket.java b/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
index 6b255e09a..e1d3894ab 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
@@ -20,7 +20,10 @@ public class ItemMilkBucket extends Item {
|
||||
}
|
||||
|
||||
if (!world.isClientSide) {
|
||||
+ MobEffect badOmen = entityliving.getEffect(MobEffects.BAD_OMEN); // Purpur
|
||||
entityliving.removeAllEffects(org.bukkit.event.entity.EntityPotionEffectEvent.Cause.MILK); // CraftBukkit
|
||||
+ if (!world.purpurConfig.milkCuresBadOmen && badOmen != null) entityliving.addEffect(badOmen); // Purpur
|
||||
+
|
||||
}
|
||||
|
||||
return itemstack.isEmpty() ? new ItemStack(Items.BUCKET) : itemstack;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 6fb0d94a8..fabe7d8e0 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -125,6 +125,7 @@ public class PurpurWorldConfig {
|
||||
public double controllableMinecartsBaseSpeed = 0.1D;
|
||||
public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
public boolean disableDropsOnCrammingDeath = false;
|
||||
+ public boolean milkCuresBadOmen = true;
|
||||
private void gameplayMechanicsSettings() {
|
||||
controllableMinecarts = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", controllableMinecarts);
|
||||
controllableMinecartsPlaceAnywhere = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
@@ -144,6 +145,7 @@ public class PurpurWorldConfig {
|
||||
set("gameplay-mechanics.controllable-minecarts.block-speed.stone", 0.5D);
|
||||
}
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
+ milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
}
|
||||
|
||||
public boolean idleTimeoutKick = true;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 66f5145a4f2f12ad8346fcc523eecdbb4ef1e3f8 Mon Sep 17 00:00:00 2001
|
||||
From 0af23b306c8cc1c31a9741805c530da56b6ea951 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 14 Jul 2019 19:52:47 -0500
|
||||
Subject: [PATCH] Mending mends most damages equipment first
|
||||
@@ -7,11 +7,11 @@ Subject: [PATCH] Mending mends most damages equipment first
|
||||
.../minecraft/server/EnchantmentManager.java | 25 ++++++++++++++++++-
|
||||
.../minecraft/server/EntityExperienceOrb.java | 2 +-
|
||||
.../java/net/minecraft/server/ItemStack.java | 9 +++++++
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 5 ++++
|
||||
4 files changed, 39 insertions(+), 2 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
4 files changed, 36 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||
index d96c03a1a1..79f9a8776f 100644
|
||||
index d96c03a1a..da1cfc1d3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||
@@ -246,9 +246,32 @@ public class EnchantmentManager {
|
||||
@@ -44,12 +44,12 @@ index d96c03a1a1..79f9a8776f 100644
|
||||
// Paper - OBFHELPER
|
||||
public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) {
|
||||
- Entry<EnumItemSlot, ItemStack> entry = b(enchantment, entityliving);
|
||||
+ Entry<EnumItemSlot, ItemStack> entry = enchantment == Enchantments.MENDING && net.pl3x.purpur.PurpurConfig.useBetterMending ? getMostDamagedEquipment(enchantment, entityliving) : b(enchantment, entityliving); // Purpur
|
||||
+ Entry<EnumItemSlot, ItemStack> entry = enchantment == Enchantments.MENDING && entityliving.world.purpurConfig.useBetterMending ? getMostDamagedEquipment(enchantment, entityliving) : b(enchantment, entityliving); // Purpur
|
||||
return entry != null ? entry.getValue() : ItemStack.NULL_ITEM;
|
||||
}
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
index 53c6c33892..462e0976a4 100644
|
||||
index 53c6c3389..0fae3693c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
@@ -225,7 +225,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
@@ -57,12 +57,12 @@ index 53c6c33892..462e0976a4 100644
|
||||
entityhuman.bC = 2;
|
||||
entityhuman.receive(this, 1);
|
||||
- Entry<EnumItemSlot, ItemStack> entry = EnchantmentManager.b(Enchantments.MENDING, (EntityLiving) entityhuman);
|
||||
+ Entry<EnumItemSlot, ItemStack> entry = net.pl3x.purpur.PurpurConfig.useBetterMending ? EnchantmentManager.getMostDamagedEquipment(Enchantments.MENDING, entityhuman) : EnchantmentManager.b(Enchantments.MENDING, entityhuman); // Purpur
|
||||
+ Entry<EnumItemSlot, ItemStack> entry = world.purpurConfig.useBetterMending ? EnchantmentManager.getMostDamagedEquipment(Enchantments.MENDING, entityhuman) : EnchantmentManager.b(Enchantments.MENDING, entityhuman); // Purpur
|
||||
|
||||
if (entry != null) {
|
||||
ItemStack itemstack = (ItemStack) entry.getValue();
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index d6e43313bf..72ce83a2d9 100644
|
||||
index 4730c2beb..4fe503808 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -369,10 +369,19 @@ public final class ItemStack {
|
||||
@@ -85,22 +85,26 @@ index d6e43313bf..72ce83a2d9 100644
|
||||
public int getDamage() {
|
||||
return this.tag == null ? 0 : this.tag.getInt("Damage");
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 8396509c88..83112e6ec0 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -151,6 +151,11 @@ public class PurpurConfig {
|
||||
fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index fabe7d8e0..61a04c4f8 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -126,6 +126,7 @@ public class PurpurWorldConfig {
|
||||
public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
public boolean disableDropsOnCrammingDeath = false;
|
||||
public boolean milkCuresBadOmen = true;
|
||||
+ public boolean useBetterMending = false;
|
||||
private void gameplayMechanicsSettings() {
|
||||
controllableMinecarts = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", controllableMinecarts);
|
||||
controllableMinecartsPlaceAnywhere = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
@@ -146,6 +147,7 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
+ useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
}
|
||||
|
||||
+ public static boolean useBetterMending = true;
|
||||
+ private static void useBetterMending() {
|
||||
+ useBetterMending = getBoolean("settings.use-better-mending", useBetterMending);
|
||||
+ }
|
||||
+
|
||||
public static boolean requireShiftToMount = true;
|
||||
private static void requireShiftToMount() {
|
||||
requireShiftToMount = getBoolean("settings.mobs.require-shift-to-mount", requireShiftToMount);
|
||||
public boolean idleTimeoutKick = true;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From 52098952462100f7b41d327425281338603608e1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 22 Jul 2019 17:32:17 -0500
|
||||
Subject: [PATCH] Implement configurable search radius for villagers to spawn
|
||||
iron golems
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityVillager.java | 5 +----
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
|
||||
2 files changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index 7e7818903..d7f7a0b48 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -12,18 +12,14 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
-import java.util.Map.Entry;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Bukkit;
|
||||
-import org.bukkit.craftbukkit.entity.CraftVillager;
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
-import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe;
|
||||
import org.bukkit.entity.Villager;
|
||||
import org.bukkit.event.entity.EntityTransformEvent;
|
||||
-import org.bukkit.event.entity.VillagerAcquireTradeEvent;
|
||||
import org.bukkit.event.entity.VillagerReplenishTradeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -881,6 +877,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
|
||||
@Nullable
|
||||
private EntityIronGolem fb() {
|
||||
+ if (world.purpurConfig.villagerSpawnIronGolemRadius > 0 && world.a(EntityIronGolem.class, getBoundingBox().grow(world.purpurConfig.villagerSpawnIronGolemRadius)).size() > world.purpurConfig.villagerSpawnIronGolemLimit) return null; // Purpur
|
||||
BlockPosition blockposition = new BlockPosition(this);
|
||||
int i = 0;
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 66dd66f06..6cc6d8015 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -136,6 +136,13 @@ public class PurpurWorldConfig {
|
||||
pillagerLimitOutpostSpawns = getInt("mobs.pillager.limit-outpost-spawns", pillagerLimitOutpostSpawns);
|
||||
}
|
||||
|
||||
+ public int villagerSpawnIronGolemRadius = 0;
|
||||
+ public int villagerSpawnIronGolemLimit = 5;
|
||||
+ private void villagerSettings() {
|
||||
+ villagerSpawnIronGolemRadius = getInt("mobs.villager.spawn-iron-golem.radius", villagerSpawnIronGolemRadius);
|
||||
+ villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit);
|
||||
+ }
|
||||
+
|
||||
public float zombieHorseSpawnChance = 0F;
|
||||
private void zombieHorseSettings() {
|
||||
zombieHorseSpawnChance = (float) getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,31 +1,44 @@
|
||||
From 803c0cf62b101817c67792d4794ee4120070f1cf Mon Sep 17 00:00:00 2001
|
||||
From 74e205e486a55d635df5dfbc6b9af664cb7322ba 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
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityFox.java | 27 +++++++++++++++++++
|
||||
.../java/net/minecraft/server/EntityFox.java | 33 +++++++++++++++++--
|
||||
src/main/java/net/minecraft/server/Items.java | 4 +--
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 ++++
|
||||
3 files changed, 34 insertions(+), 2 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
3 files changed, 34 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
index 738e6cb8f7..744640450a 100644
|
||||
index 4f53090d3..13afd7bcd 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFox.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
@@ -228,6 +228,11 @@ public class EntityFox extends EntityAnimal {
|
||||
@@ -37,9 +37,9 @@ public class EntityFox extends EntityAnimal {
|
||||
private static final Predicate<Entity> bD = (entity) -> {
|
||||
return !entity.bm() && IEntitySelector.e.test(entity);
|
||||
};
|
||||
- private PathfinderGoal bE;
|
||||
- private PathfinderGoal bF;
|
||||
- private PathfinderGoal bG;
|
||||
+ private PathfinderGoal bE; private PathfinderGoal attackAnimalGoal() { return bE; } // Purpur - OBFHELPER
|
||||
+ private PathfinderGoal bF; private PathfinderGoal attackTurtleGoal() { return bF; } // Purpur - OBFHELPER
|
||||
+ private PathfinderGoal bG; private PathfinderGoal attackFishGoal() { return bG; } // Purpur - OBFHELPER
|
||||
private float bH;
|
||||
private float bI;
|
||||
private float bJ;
|
||||
@@ -245,6 +245,11 @@ public class EntityFox extends EntityAnimal {
|
||||
}
|
||||
|
||||
private void initializePathFinderGoals() {
|
||||
+ // Purpur start - do not add duplicate goals
|
||||
+ this.targetSelector.a(this.bE);
|
||||
+ this.targetSelector.a(this.bF);
|
||||
+ this.targetSelector.a(this.bG);
|
||||
+ this.targetSelector.a(attackAnimalGoal());
|
||||
+ this.targetSelector.a(attackTurtleGoal());
|
||||
+ this.targetSelector.a(attackFishGoal());
|
||||
+ // Purpur end
|
||||
if (this.getFoxType() == EntityFox.Type.RED) {
|
||||
this.targetSelector.a(4, this.bE);
|
||||
this.targetSelector.a(4, this.bF);
|
||||
@@ -260,6 +265,7 @@ public class EntityFox extends EntityAnimal {
|
||||
@@ -277,6 +282,7 @@ public class EntityFox extends EntityAnimal {
|
||||
|
||||
public void setFoxType(EntityFox.Type entityfox_type) {
|
||||
this.datawatcher.set(EntityFox.bw, entityfox_type.c());
|
||||
@@ -33,21 +46,21 @@ index 738e6cb8f7..744640450a 100644
|
||||
}
|
||||
|
||||
private List<UUID> eE() {
|
||||
@@ -605,6 +611,27 @@ public class EntityFox extends EntityAnimal {
|
||||
return getRider() == null ? super.dp() : 0.5F;
|
||||
@@ -620,6 +626,27 @@ public class EntityFox extends EntityAnimal {
|
||||
return !hasRider() ? super.getJumpHeight() : 0.5F;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
+ if (world.purpurConfig.foxTypeChangesWithTulips) {
|
||||
+ ItemStack itemstack = entityhuman.b(enumhand);
|
||||
+ if (getFoxType() == Type.RED && itemstack.getItem() == Items.WHITE_TULIP) {
|
||||
+ if (getFoxType() == Type.RED && itemstack.getItem() == Items.whiteTulip()) {
|
||||
+ setFoxType(Type.SNOW);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ } else if (getFoxType() == Type.SNOW && itemstack.getItem() == Items.ORANGE_TULIP) {
|
||||
+ } else if (getFoxType() == Type.SNOW && itemstack.getItem() == Items.orangeTulip()) {
|
||||
+ setFoxType(Type.RED);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
@@ -62,7 +75,7 @@ index 738e6cb8f7..744640450a 100644
|
||||
public void onMount(EntityHuman entityhuman) {
|
||||
super.onMount(entityhuman);
|
||||
diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java
|
||||
index 282fbca4fc..b261da87b7 100644
|
||||
index 54670f64c..9c9b93f28 100644
|
||||
--- a/src/main/java/net/minecraft/server/Items.java
|
||||
+++ b/src/main/java/net/minecraft/server/Items.java
|
||||
@@ -106,8 +106,8 @@ public class Items {
|
||||
@@ -71,27 +84,28 @@ index 282fbca4fc..b261da87b7 100644
|
||||
public static final Item aZ = a(Blocks.RED_TULIP, CreativeModeTab.c);
|
||||
- public static final Item ba = a(Blocks.ORANGE_TULIP, CreativeModeTab.c);
|
||||
- public static final Item bb = a(Blocks.WHITE_TULIP, CreativeModeTab.c);
|
||||
+ public static final Item ba = a(Blocks.ORANGE_TULIP, CreativeModeTab.c); public static final Item ORANGE_TULIP = ba; // Purpur - OBFHELPER
|
||||
+ public static final Item bb = a(Blocks.WHITE_TULIP, CreativeModeTab.c); public static final Item WHITE_TULIP = bb; // Purpur - OBFHELPER
|
||||
+ public static final Item ba = a(Blocks.ORANGE_TULIP, CreativeModeTab.c); public static Item orangeTulip() { return ba; } // Purpur - OBFHELPER
|
||||
+ public static final Item bb = a(Blocks.WHITE_TULIP, CreativeModeTab.c); public static Item whiteTulip() { return bb; } // Purpur - OBFHELPER
|
||||
public static final Item bc = a(Blocks.PINK_TULIP, CreativeModeTab.c);
|
||||
public static final Item bd = a(Blocks.OXEYE_DAISY, CreativeModeTab.c);
|
||||
public static final Item be = a(Blocks.CORNFLOWER, CreativeModeTab.c);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 81ece70d38..e5ea54a206 100644
|
||||
index 61a04c4f8..eac751fcb 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -121,6 +121,11 @@ public class PurpurWorldConfig {
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
@@ -341,10 +341,12 @@ public class PurpurWorldConfig {
|
||||
public boolean foxRidable = false;
|
||||
public boolean foxRidableInWater = false;
|
||||
public boolean foxRequireShiftToMount = true;
|
||||
+ public boolean foxTypeChangesWithTulips = false;
|
||||
private void foxSettings() {
|
||||
foxRidable = getBoolean("mobs.fox.ridable", foxRidable);
|
||||
foxRidableInWater = getBoolean("mobs.fox.ridable-in-water", foxRidableInWater);
|
||||
foxRequireShiftToMount = getBoolean("mobs.fox.require-shift-to-mount", foxRequireShiftToMount);
|
||||
+ foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
}
|
||||
|
||||
+ public boolean foxTypeChangesWithTulips = true;
|
||||
+ private void foxSettings() {
|
||||
+ foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
+ }
|
||||
+
|
||||
public boolean pigmenDontTargetUnlessHit = false;
|
||||
private void pigmenSettings() {
|
||||
pigmenDontTargetUnlessHit = getBoolean("mobs.pigmen.dont-target-unless-hit", pigmenDontTargetUnlessHit);
|
||||
public boolean ghastRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
From 8c9db74b61fed29c35db8183f770e892eeac8eeb Mon Sep 17 00:00:00 2001
|
||||
From e62a29aa185eb7475b0cd9ad9625fb05afa52bb6 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 22 Jul 2019 14:24:26 -0500
|
||||
Subject: [PATCH] Implement a hard limit for pillager outpost spawns
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/ChunkProviderGenerate.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 6 insertions(+)
|
||||
src/main/java/net/minecraft/server/ChunkProviderGenerate.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||
index 70f43c5159..baca8f7054 100644
|
||||
index 70f43c515..baca8f705 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||
@@ -143,6 +143,7 @@ public class ChunkProviderGenerate extends ChunkGeneratorAbstract<GeneratorSetti
|
||||
@@ -21,21 +21,22 @@ index 70f43c5159..baca8f7054 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index e5ea54a206..66dd66f062 100644
|
||||
index eac751fcb..246bb5128 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -131,6 +131,11 @@ public class PurpurWorldConfig {
|
||||
pigmenDontTargetUnlessHit = getBoolean("mobs.pigmen.dont-target-unless-hit", pigmenDontTargetUnlessHit);
|
||||
@@ -531,10 +531,12 @@ public class PurpurWorldConfig {
|
||||
public boolean pillagerRidable = false;
|
||||
public boolean pillagerRidableInWater = false;
|
||||
public boolean pillagerRequireShiftToMount = true;
|
||||
+ public int pillagerLimitOutpostSpawns = 0;
|
||||
private void pillagerSettings() {
|
||||
pillagerRidable = getBoolean("mobs.pillager.ridable", pillagerRidable);
|
||||
pillagerRidableInWater = getBoolean("mobs.pillager.ridable-in-water", pillagerRidableInWater);
|
||||
pillagerRequireShiftToMount = getBoolean("mobs.pillager.require-shift-to-mount", pillagerRequireShiftToMount);
|
||||
+ pillagerLimitOutpostSpawns = getInt("mobs.pillager.limit-outpost-spawns", pillagerLimitOutpostSpawns);
|
||||
}
|
||||
|
||||
+ public int pillagerLimitOutpostSpawns = 10;
|
||||
+ private void pillagerSettings() {
|
||||
+ pillagerLimitOutpostSpawns = getInt("mobs.pillager.limit-outpost-spawns", pillagerLimitOutpostSpawns);
|
||||
+ }
|
||||
+
|
||||
public float zombieHorseSpawnChance = 0F;
|
||||
private void zombieHorseSettings() {
|
||||
zombieHorseSpawnChance = (float) getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
public boolean polarBearRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
From d499ebe19055966a7138a8070538698b7b31397e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 23 Jul 2019 08:28:21 -0500
|
||||
Subject: [PATCH] Implement configurable villager brain ticks
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityVillager.java | 6 ++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 7 +++++++
|
||||
2 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index d7f7a0b48..a0137c7af 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -49,6 +49,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
}, MemoryModuleType.MEETING_POINT, (entityvillager, villageplacetype) -> {
|
||||
return villageplacetype == VillagePlaceType.r;
|
||||
});
|
||||
+ private final int brainTickOffset; // Purpur
|
||||
|
||||
public EntityVillager(EntityTypes<? extends EntityVillager> entitytypes, World world) {
|
||||
this(entitytypes, world, VillagerType.PLAINS);
|
||||
@@ -62,6 +63,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
this.setCanPickupLoot(true);
|
||||
this.setVillagerData(this.getVillagerData().withType(villagertype).withProfession(VillagerProfession.NONE));
|
||||
this.bo = this.a(new Dynamic(DynamicOpsNBT.a, new NBTTagCompound()));
|
||||
+ brainTickOffset = getRandom().nextInt(100); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -148,6 +150,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
this.world.getMethodProfiler().enter("brain");
|
||||
+ // Purpur start
|
||||
+ boolean tick = (world.getTime() + brainTickOffset) % net.pl3x.purpur.PurpurConfig.villagerBrainTicks == 0;
|
||||
+ if (((WorldServer) world).getMinecraftServer().lagging ? tick : net.pl3x.purpur.PurpurConfig.useVillagerBrainTicksOnlyWhenLagging || tick)
|
||||
+ // Purpur end
|
||||
this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error
|
||||
this.world.getMethodProfiler().exit();
|
||||
if (!this.et() && this.bB > 0) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index de0cf5c55..c35d19f66 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -209,6 +209,13 @@ public class PurpurConfig {
|
||||
snowmanPumpkinPutBack = getBoolean("settings.mobs.snow_golem.pumpkin-can-be-added-back", snowmanPumpkinPutBack);
|
||||
}
|
||||
|
||||
+ public static boolean useVillagerBrainTicksOnlyWhenLagging = true;
|
||||
+ public static int villagerBrainTicks = 20;
|
||||
+ private static void villagerSettings() {
|
||||
+ useVillagerBrainTicksOnlyWhenLagging = getBoolean("settings.mobs.villager.use-brain-ticks-only-when-lagging", useVillagerBrainTicksOnlyWhenLagging);
|
||||
+ villagerBrainTicks = getInt("settings.mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
+ }
|
||||
+
|
||||
public static boolean largeEnderChests = true;
|
||||
private static void largeEnderChests() {
|
||||
largeEnderChests = getBoolean("settings.large-ender-chests", largeEnderChests);
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 95f806d67a4295c6baa09d577b61c0b03d088a8f Mon Sep 17 00:00:00 2001
|
||||
From a7f2d99791c0ee874e0af584f2f5057110113b0e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 16 Jan 2020 14:59:16 -0600
|
||||
Subject: [PATCH] Make the GUI better
|
||||
@@ -40,7 +40,7 @@ Subject: [PATCH] Make the GUI better
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/util/HighlightErrorConverter.java
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index d70c8cab2b..61ccb6079e 100644
|
||||
index d70c8cab2..61ccb6079 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -51,7 +51,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -71,7 +71,7 @@ index d70c8cab2b..61ccb6079e 100644
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 9d5ef40a03..105ac8a040 100644
|
||||
index ac45dbf59..cfe3157f0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -105,7 +105,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -83,7 +83,7 @@ index 9d5ef40a03..105ac8a040 100644
|
||||
@Nullable
|
||||
private KeyPair I;
|
||||
@Nullable
|
||||
@@ -1298,6 +1298,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1291,6 +1291,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ index 9d5ef40a03..105ac8a040 100644
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/ServerGUI.java b/src/main/java/net/pl3x/purpur/gui/ServerGUI.java
|
||||
new file mode 100644
|
||||
index 0000000000..973b5efef5
|
||||
index 000000000..973b5efef
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/ServerGUI.java
|
||||
@@ -0,0 +1,123 @@
|
||||
@@ -222,7 +222,7 @@ index 0000000000..973b5efef5
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/console/JColorTextPane.java b/src/main/java/net/pl3x/purpur/gui/console/JColorTextPane.java
|
||||
new file mode 100644
|
||||
index 0000000000..55feec811f
|
||||
index 000000000..55feec811
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/console/JColorTextPane.java
|
||||
@@ -0,0 +1,81 @@
|
||||
@@ -309,7 +309,7 @@ index 0000000000..55feec811f
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/console/JConsolePanel.java b/src/main/java/net/pl3x/purpur/gui/console/JConsolePanel.java
|
||||
new file mode 100644
|
||||
index 0000000000..fb017a0708
|
||||
index 000000000..fb017a070
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/console/JConsolePanel.java
|
||||
@@ -0,0 +1,128 @@
|
||||
@@ -443,7 +443,7 @@ index 0000000000..fb017a0708
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/info/DetailsListSelectionModel.java b/src/main/java/net/pl3x/purpur/gui/info/DetailsListSelectionModel.java
|
||||
new file mode 100644
|
||||
index 0000000000..4e0b80fddb
|
||||
index 000000000..4e0b80fdd
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/info/DetailsListSelectionModel.java
|
||||
@@ -0,0 +1,21 @@
|
||||
@@ -470,7 +470,7 @@ index 0000000000..4e0b80fddb
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/info/JInfoPanel.java b/src/main/java/net/pl3x/purpur/gui/info/JInfoPanel.java
|
||||
new file mode 100644
|
||||
index 0000000000..a4983863cb
|
||||
index 000000000..a4983863c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/info/JInfoPanel.java
|
||||
@@ -0,0 +1,42 @@
|
||||
@@ -518,7 +518,7 @@ index 0000000000..a4983863cb
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/info/RAMDetails.java b/src/main/java/net/pl3x/purpur/gui/info/RAMDetails.java
|
||||
new file mode 100644
|
||||
index 0000000000..00f79e4336
|
||||
index 000000000..00f79e433
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/info/RAMDetails.java
|
||||
@@ -0,0 +1,54 @@
|
||||
@@ -578,7 +578,7 @@ index 0000000000..00f79e4336
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/info/graph/GraphColor.java b/src/main/java/net/pl3x/purpur/gui/info/graph/GraphColor.java
|
||||
new file mode 100644
|
||||
index 0000000000..2fdb9bdd0d
|
||||
index 000000000..2fdb9bdd0
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/info/graph/GraphColor.java
|
||||
@@ -0,0 +1,44 @@
|
||||
@@ -628,7 +628,7 @@ index 0000000000..2fdb9bdd0d
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/info/graph/GraphData.java b/src/main/java/net/pl3x/purpur/gui/info/graph/GraphData.java
|
||||
new file mode 100644
|
||||
index 0000000000..85babad9cd
|
||||
index 000000000..85babad9c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/info/graph/GraphData.java
|
||||
@@ -0,0 +1,47 @@
|
||||
@@ -681,7 +681,7 @@ index 0000000000..85babad9cd
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/info/graph/RAMGraph.java b/src/main/java/net/pl3x/purpur/gui/info/graph/RAMGraph.java
|
||||
new file mode 100644
|
||||
index 0000000000..f2f3dd2c16
|
||||
index 000000000..f2f3dd2c1
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/info/graph/RAMGraph.java
|
||||
@@ -0,0 +1,138 @@
|
||||
@@ -825,7 +825,7 @@ index 0000000000..f2f3dd2c16
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/playerlist/JPlayerList.java b/src/main/java/net/pl3x/purpur/gui/playerlist/JPlayerList.java
|
||||
new file mode 100644
|
||||
index 0000000000..17e75a2070
|
||||
index 000000000..17e75a207
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/playerlist/JPlayerList.java
|
||||
@@ -0,0 +1,57 @@
|
||||
@@ -888,7 +888,7 @@ index 0000000000..17e75a2070
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListCellRenderer.java b/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListCellRenderer.java
|
||||
new file mode 100644
|
||||
index 0000000000..2f02e9adc7
|
||||
index 000000000..2f02e9adc
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListCellRenderer.java
|
||||
@@ -0,0 +1,22 @@
|
||||
@@ -916,7 +916,7 @@ index 0000000000..2f02e9adc7
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListModel.java b/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListModel.java
|
||||
new file mode 100644
|
||||
index 0000000000..edbf454163
|
||||
index 000000000..edbf45416
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListModel.java
|
||||
@@ -0,0 +1,47 @@
|
||||
@@ -969,7 +969,7 @@ index 0000000000..edbf454163
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListMouseAdapter.java b/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListMouseAdapter.java
|
||||
new file mode 100644
|
||||
index 0000000000..13a5eb3ad3
|
||||
index 000000000..13a5eb3ad
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/playerlist/PlayerListMouseAdapter.java
|
||||
@@ -0,0 +1,32 @@
|
||||
@@ -1007,7 +1007,7 @@ index 0000000000..13a5eb3ad3
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/util/GUIColor.java b/src/main/java/net/pl3x/purpur/gui/util/GUIColor.java
|
||||
new file mode 100644
|
||||
index 0000000000..973c8ddf93
|
||||
index 000000000..973c8ddf9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/util/GUIColor.java
|
||||
@@ -0,0 +1,54 @@
|
||||
@@ -1067,7 +1067,7 @@ index 0000000000..973c8ddf93
|
||||
+}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/util/HighlightErrorConverter.java b/src/main/java/net/pl3x/purpur/util/HighlightErrorConverter.java
|
||||
new file mode 100644
|
||||
index 0000000000..4b340b88a2
|
||||
index 000000000..4b340b88a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/util/HighlightErrorConverter.java
|
||||
@@ -0,0 +1,86 @@
|
||||
@@ -1158,7 +1158,7 @@ index 0000000000..4b340b88a2
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index a9bb987652..4be7613d0f 100644
|
||||
index a9bb98765..4be7613d0 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
+++ b/src/main/resources/log4j2.xml
|
||||
@@ -1,8 +1,17 @@
|
||||
@@ -1,4 +1,4 @@
|
||||
From 3a716b3f4749b7a960c083219e070a3cfdaf0c2b Mon Sep 17 00:00:00 2001
|
||||
From 48669d3223c83beb97b1f5320c2a90a55af22d0c Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 21 Jul 2019 18:01:46 -0500
|
||||
Subject: [PATCH] Players should not cram to death
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Players should not cram to death
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 5e56e0e3e8..d72b45119d 100644
|
||||
index 670dcf282..b2dbeb0b0 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1098,7 +1098,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -1,4 +1,4 @@
|
||||
From 9285ac973fec6e1944d6d751e08ae6c364bb6ba5 Mon Sep 17 00:00:00 2001
|
||||
From 92f64802ef183824cb3232e402b9744e080915aa Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 11 Jan 2020 23:12:52 -0600
|
||||
Subject: [PATCH] Add EntityPortalReadyEvent
|
||||
@@ -86,10 +86,10 @@ index 2dc3ab4cf..1c0df77c2 100644
|
||||
break;
|
||||
// CraftBukkit start - add the block to our list
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index d9963d1e4..1ea2120f0 100644
|
||||
index a2fe1a424..fc9d288de 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -171,9 +171,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -168,9 +168,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
protected boolean af; public final boolean inPortal() { return this.af; } // Paper - OBFHELPER
|
||||
protected int ag;
|
||||
public DimensionManager dimension;
|
||||
@@ -102,7 +102,7 @@ index d9963d1e4..1ea2120f0 100644
|
||||
private boolean invulnerable;
|
||||
protected UUID uniqueID;
|
||||
protected String am;
|
||||
@@ -2216,6 +2216,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -2210,6 +2210,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.world.getMethodProfiler().enter("portal");
|
||||
this.ag = i;
|
||||
this.portalCooldown = this.ba();
|
||||
@@ -141,7 +141,7 @@ index f84dd6d9b..f50e9670b 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 00343a9fb..4ca4bd259 100644
|
||||
index 567b297e0..456c835c8 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -65,7 +65,7 @@ public class WorldServer extends World {
|
||||
@@ -1,4 +1,4 @@
|
||||
From a52816cca0ca3cb8aa341675d4a23a4287b2bd3a Mon Sep 17 00:00:00 2001
|
||||
From 16be2ba8a75c8ab53bde44fe9ddbbc6149922e74 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 25 Jul 2019 18:07:37 -0500
|
||||
Subject: [PATCH] Implement elytra settings
|
||||
@@ -13,10 +13,10 @@ Subject: [PATCH] Implement elytra settings
|
||||
6 files changed, 49 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 31cfac0c8..d4fb8e4a6 100644
|
||||
index 76a925f7a..d64e02628 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2654,9 +2654,16 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2645,9 +2645,16 @@ public abstract class EntityLiving extends Entity {
|
||||
if (itemstack.getItem() == Items.ELYTRA && ItemElytra.e(itemstack)) {
|
||||
flag = true;
|
||||
if (!this.world.isClientSide && (this.bm + 1) % 20 == 0) {
|
||||
@@ -56,7 +56,7 @@ index bd524a35b..c0e8cd0cd 100644
|
||||
itemstack.subtract(1);
|
||||
} else ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 1108aa085..2b39d5ca2 100644
|
||||
index 4fe503808..7b7a0a7cb 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -401,7 +401,7 @@ public final class ItemStack {
|
||||
@@ -115,11 +115,11 @@ index 212af252b..fbc30e6ec 100644
|
||||
return this.x * this.x + this.y * this.y + this.z * this.z;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 6cc6d8015..6d875b78b 100644
|
||||
index 246bb5128..272a5ae41 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -116,6 +116,19 @@ public class PurpurWorldConfig {
|
||||
milkCuresBadOmen = getBoolean("milk-cures-bad-omen", milkCuresBadOmen);
|
||||
@@ -150,6 +150,19 @@ public class PurpurWorldConfig {
|
||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
}
|
||||
|
||||
+ public int elytraDamagePerSecond = 1;
|
||||
@@ -128,16 +128,16 @@ index 6cc6d8015..6d875b78b 100644
|
||||
+ public int elytraDamagePerFireworkBoost = 0;
|
||||
+ public int elytraDamagePerTridentBoost = 0;
|
||||
+ private void elytraSettings() {
|
||||
+ elytraDamagePerSecond = getInt("elytra.damage-per-second", elytraDamagePerSecond);
|
||||
+ elytraDamageMultiplyBySpeed = getDouble("elytra.damage-multiplied-by-speed", elytraDamageMultiplyBySpeed);
|
||||
+ elytraIgnoreUnbreaking = getBoolean("elytra.ignore-unbreaking", elytraIgnoreUnbreaking);
|
||||
+ elytraDamagePerFireworkBoost = getInt("elytra.damage-per-boost.firework", elytraDamagePerFireworkBoost);
|
||||
+ elytraDamagePerTridentBoost = getInt("elytra.damage-per-boost.trident", elytraDamagePerTridentBoost);
|
||||
+ elytraDamagePerSecond = getInt("gameplay-mechanics.elytra.damage-per-second", elytraDamagePerSecond);
|
||||
+ elytraDamageMultiplyBySpeed = getDouble("gameplay-mechanics.elytra.damage-multiplied-by-speed", elytraDamageMultiplyBySpeed);
|
||||
+ elytraIgnoreUnbreaking = getBoolean("gameplay-mechanics.elytra.ignore-unbreaking", elytraIgnoreUnbreaking);
|
||||
+ elytraDamagePerFireworkBoost = getInt("gameplay-mechanics.elytra.damage-per-boost.firework", elytraDamagePerFireworkBoost);
|
||||
+ elytraDamagePerTridentBoost = getInt("gameplay-mechanics.elytra.damage-per-boost.trident", elytraDamagePerTridentBoost);
|
||||
+ }
|
||||
+
|
||||
public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
private void enderDragonSettings() {
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender-dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
public boolean idleTimeoutKick = true;
|
||||
public boolean idleTimeoutTickNearbyEntities = true;
|
||||
public boolean idleTimeoutCountAsSleeping = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
From 159989e47b1626c5837b62e1f0e644205ab90ada Mon Sep 17 00:00:00 2001
|
||||
From 155caf4cd63022a8e4e2a6e1651ccd9616fca731 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 30 Jan 2020 00:41:24 -0600
|
||||
Subject: [PATCH] Add tick times API
|
||||
|
||||
---
|
||||
.../net/pl3x/purpur/gui/info/RAMDetails.java | 10 +---------
|
||||
.../org/bukkit/craftbukkit/CraftServer.java | 15 +++++++++++++++
|
||||
.../org/spigotmc/TicksPerSecondCommand.java | 18 +++++++++++++++++-
|
||||
3 files changed, 33 insertions(+), 10 deletions(-)
|
||||
.../java/net/pl3x/purpur/gui/info/RAMDetails.java | 4 ++--
|
||||
.../java/org/bukkit/craftbukkit/CraftServer.java | 12 ++++++++++++
|
||||
.../java/org/spigotmc/TicksPerSecondCommand.java | 10 ++++++++++
|
||||
3 files changed, 24 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/gui/info/RAMDetails.java b/src/main/java/net/pl3x/purpur/gui/info/RAMDetails.java
|
||||
index 00f79e433..9fe2550a4 100644
|
||||
index 00f79e433..845eb1f8c 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/gui/info/RAMDetails.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/gui/info/RAMDetails.java
|
||||
@@ -15,7 +15,7 @@ import java.util.Locale;
|
||||
@@ -22,28 +22,25 @@ index 00f79e433..9fe2550a4 100644
|
||||
-> format.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT)));
|
||||
|
||||
public RAMDetails() {
|
||||
@@ -43,12 +43,4 @@ public class RAMDetails extends JList<String> {
|
||||
vector.add("Avg tick: " + DECIMAL_FORMAT.format(Bukkit.getAverageTickTime()) + " ms");
|
||||
@@ -44,7 +44,7 @@ public class RAMDetails extends JList<String> {
|
||||
setListData(vector);
|
||||
}
|
||||
-
|
||||
|
||||
- private double getAverage(long[] values) {
|
||||
- long total = 0L;
|
||||
- for (long value : values) {
|
||||
- total += value;
|
||||
- }
|
||||
- return (double) total / (double) values.length;
|
||||
- }
|
||||
}
|
||||
+ public static double getAverage(long[] values) {
|
||||
long total = 0L;
|
||||
for (long value : values) {
|
||||
total += value;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index fb0da17ed..bfc41f998 100644
|
||||
index daa94187f..ca7cc3b87 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2201,5 +2201,20 @@ public final class CraftServer implements Server {
|
||||
public boolean isLagging() {
|
||||
return getServer().lagging;
|
||||
@@ -2189,4 +2189,16 @@ public final class CraftServer implements Server {
|
||||
return net.minecraft.server.MinecraftServer.currentTick;
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public long[] getTickTimes() {
|
||||
+ return getServer().getTickTimes();
|
||||
@@ -51,43 +48,22 @@ index fb0da17ed..bfc41f998 100644
|
||||
+
|
||||
+ @Override
|
||||
+ public double getAverageTickTime() {
|
||||
+ long total = 0L;
|
||||
+ long[] tickTimes = getTickTimes();
|
||||
+ for (long value : tickTimes) {
|
||||
+ total += value;
|
||||
+ }
|
||||
+ return ((double) total / (double) tickTimes.length) * 1.0E-6D;
|
||||
+ return net.pl3x.purpur.gui.info.RAMDetails.getAverage(getTickTimes());
|
||||
+ }
|
||||
// Purpur end
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
index 2eed9d0a4..c29380e1c 100644
|
||||
index 6d21c3269..5550379a6 100644
|
||||
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
+++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
@@ -4,6 +4,12 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
+// Purpur start
|
||||
+import net.pl3x.purpur.gui.info.RAMDetails;
|
||||
+import org.apache.commons.lang.StringUtils;
|
||||
+import org.bukkit.Bukkit;
|
||||
+// Purpur end
|
||||
+
|
||||
public class TicksPerSecondCommand extends Command
|
||||
{
|
||||
|
||||
@@ -30,12 +36,22 @@ public class TicksPerSecondCommand extends Command
|
||||
for ( int i = 0; i < tps.length; i++) {
|
||||
tpsAvg[i] = format( tps[i] );
|
||||
@@ -32,10 +32,20 @@ public class TicksPerSecondCommand extends Command
|
||||
}
|
||||
- sender.sendMessage( ChatColor.GOLD + "TPS from last 5s, 1m, 5m, 15m: " + org.apache.commons.lang.StringUtils.join(tpsAvg, ", ")); // Purpur
|
||||
+ // Purpur start
|
||||
+ double avg = Bukkit.getAverageTickTime();
|
||||
+ sender.sendMessage( ChatColor.GOLD + "TPS from last 5s, 1m, 5m, 15m: " + StringUtils.join(tpsAvg, ", "));
|
||||
+ sender.sendMessage( ChatColor.GOLD + "Average tick time: " + getColor(avg) + RAMDetails.DECIMAL_FORMAT.format(avg) + " ms");
|
||||
+ // Purpur end
|
||||
sender.sendMessage( ChatColor.GOLD + "TPS from last 1m, 5m, 15m: " + org.apache.commons.lang.StringUtils.join(tpsAvg, ", "));
|
||||
// Paper end
|
||||
+ // Purpur start
|
||||
+ double avg = org.bukkit.Bukkit.getAverageTickTime();
|
||||
+ sender.sendMessage( ChatColor.GOLD + "Average tick time: " + getColor(avg) + net.pl3x.purpur.gui.info.RAMDetails.DECIMAL_FORMAT.format(avg) + " ms");
|
||||
+ // Purpur end
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
From 743e226dce9e746bd2d0358ed10d487ca53a537b Mon Sep 17 00:00:00 2001
|
||||
From 023207c11cc581bc3e6761ac56d0bb809355c2d9 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 1 Aug 2019 19:15:12 -0500
|
||||
Subject: [PATCH] Add blacklist option for grindstone
|
||||
@@ -6,11 +6,11 @@ Subject: [PATCH] Add blacklist option for grindstone
|
||||
---
|
||||
.../minecraft/server/ContainerGrindstone.java | 17 +++++++++++++++++
|
||||
.../java/net/minecraft/server/ItemStack.java | 6 ++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 12 ++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 12 ++++++++++++
|
||||
3 files changed, 35 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ContainerGrindstone.java b/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
||||
index ed88e208d..0a5abd2e1 100644
|
||||
index ed88e208d..fcfb4abdc 100644
|
||||
--- a/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
||||
+++ b/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
||||
@@ -57,12 +57,24 @@ public class ContainerGrindstone extends Container {
|
||||
@@ -18,7 +18,7 @@ index ed88e208d..0a5abd2e1 100644
|
||||
@Override
|
||||
public boolean isAllowed(ItemStack itemstack) {
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.grindstoneBlacklistDisallowPlacement && net.pl3x.purpur.PurpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ if (containeraccess.getWorld().purpurConfig.grindstoneBlacklistDisallowPlacement && containeraccess.getWorld().purpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ getBukkitView().getTopInventory().getViewers().forEach(viewer -> ((Player) viewer).updateInventory());
|
||||
+ return false;
|
||||
+ }
|
||||
@@ -30,7 +30,7 @@ index ed88e208d..0a5abd2e1 100644
|
||||
@Override
|
||||
public boolean isAllowed(ItemStack itemstack) {
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.grindstoneBlacklistDisallowPlacement && net.pl3x.purpur.PurpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ if (containeraccess.getWorld().purpurConfig.grindstoneBlacklistDisallowPlacement && containeraccess.getWorld().purpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ getBukkitView().getTopInventory().getViewers().forEach(viewer -> ((Player) viewer).updateInventory());
|
||||
+ return false;
|
||||
+ }
|
||||
@@ -43,7 +43,7 @@ index ed88e208d..0a5abd2e1 100644
|
||||
|
||||
private int e(ItemStack itemstack) {
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.grindstoneBlacklistReturnsZeroExp && net.pl3x.purpur.PurpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ if (containeraccess.getWorld().purpurConfig.grindstoneBlacklistReturnsZeroExp && containeraccess.getWorld().purpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
@@ -51,7 +51,7 @@ index ed88e208d..0a5abd2e1 100644
|
||||
Map<Enchantment, Integer> map = EnchantmentManager.a(itemstack);
|
||||
Iterator iterator = map.entrySet().iterator();
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 2b39d5ca2..e9801022e 100644
|
||||
index 7b7a0a7cb..6b45bc17c 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -541,6 +541,12 @@ public final class ItemStack {
|
||||
@@ -67,36 +67,36 @@ index 2b39d5ca2..e9801022e 100644
|
||||
public String j() {
|
||||
return this.getItem().f(this);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 7d3c5e176..73b0eec5a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.pl3x.purpur;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 272a5ae41..cd3606a65 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.server.MinecraftKey;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.spigotmc.SpigotWorldConfig;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
+import com.google.common.collect.Lists;
|
||||
import net.minecraft.server.Block;
|
||||
import net.minecraft.server.IRegistry;
|
||||
import net.minecraft.server.MinecraftKey;
|
||||
@@ -171,6 +172,17 @@ public class PurpurConfig {
|
||||
updatePermissionsOnWorldChange = getBoolean("settings.update-perms-on-world-change", updatePermissionsOnWorldChange);
|
||||
+import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -102,6 +103,17 @@ public class PurpurWorldConfig {
|
||||
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
}
|
||||
|
||||
+ public static boolean grindstoneBlacklistDisallowPlacement = true;
|
||||
+ public static boolean grindstoneBlacklistReturnsZeroExp = true;
|
||||
+ public static List<String> grindstoneBlacklist = Lists.newArrayList("minecraft:tripwire_hook");
|
||||
+ private static void grindstoneBlacklist() {
|
||||
+ grindstoneBlacklistDisallowPlacement = getBoolean("settings.grindstone.disallow-placement", grindstoneBlacklistDisallowPlacement);
|
||||
+ grindstoneBlacklistReturnsZeroExp = getBoolean("settings.grindstone.returns-zero-exp", grindstoneBlacklistReturnsZeroExp);
|
||||
+ List<String> blacklist = getList("settings.grindstone.blacklisted-items", grindstoneBlacklist);
|
||||
+ public List<String> grindstoneBlacklist = new ArrayList<>();
|
||||
+ public boolean grindstoneBlacklistDisallowPlacement = true;
|
||||
+ public boolean grindstoneBlacklistReturnsZeroExp = true;
|
||||
+ private void grindstoneBlacklist() {
|
||||
+ List<String> blacklist = getList("blocks.grindstone.blacklist.blacklisted-items", grindstoneBlacklist);
|
||||
+ grindstoneBlacklistDisallowPlacement = getBoolean("blocks.grindstone.blacklist.disallow-placement", grindstoneBlacklistDisallowPlacement);
|
||||
+ grindstoneBlacklistReturnsZeroExp = getBoolean("blocks.grindstone.blacklist.returns-zero-exp", grindstoneBlacklistReturnsZeroExp);
|
||||
+ grindstoneBlacklist.clear();
|
||||
+ grindstoneBlacklist.addAll(blacklist);
|
||||
+ }
|
||||
+
|
||||
public static boolean requireShiftToMount = true;
|
||||
private static void requireShiftToMount() {
|
||||
requireShiftToMount = getBoolean("settings.mobs.require-shift-to-mount", requireShiftToMount);
|
||||
public boolean signAllowColors = false;
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
--
|
||||
2.24.0.rc1
|
||||
2.24.0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 83c9bffd28b0101a5d15a3dc062ecabd82fea865 Mon Sep 17 00:00:00 2001
|
||||
From 150bf46cc0a227cd9d96aa4935fe7619ee7b2c9e 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] Implement lagging threshold
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Implement lagging threshold
|
||||
3 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index ac45dbf59..587bef915 100644
|
||||
index cfe3157f0..39ed2ed61 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -178,6 +178,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -21,20 +21,20 @@ index ac45dbf59..587bef915 100644
|
||||
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
|
||||
// Spigot end
|
||||
|
||||
@@ -916,6 +917,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
recentTps[0] = tps1.getAverage();
|
||||
@@ -917,6 +918,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
recentTps[1] = tps5.getAverage();
|
||||
recentTps[2] = tps15.getAverage();
|
||||
+ lagging = recentTps[0] < net.pl3x.purpur.PurpurConfig.laggingThreshold; // Purpur
|
||||
// Paper end
|
||||
+ lagging = recentTps[0] < net.pl3x.purpur.PurpurConfig.laggingThreshold; // Purpur
|
||||
tickSection = curTime;
|
||||
}
|
||||
// Spigot end
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 627177731..de0cf5c55 100644
|
||||
index e791c52a4..2c7791cf6 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -136,6 +136,11 @@ public class PurpurConfig {
|
||||
return config.getString(path, config.getString(path));
|
||||
@@ -140,6 +140,11 @@ public class PurpurConfig {
|
||||
loggerSuppressWorldGenFeatureDeserializationError = getBoolean("settings.logger.suppress-world-gen-feature-deserialization-errors", loggerSuppressWorldGenFeatureDeserializationError);
|
||||
}
|
||||
|
||||
+ public static double laggingThreshold = 19.0D;
|
||||
@@ -42,16 +42,16 @@ index 627177731..de0cf5c55 100644
|
||||
+ laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
+ }
|
||||
+
|
||||
public static boolean disableDropsOnCrammingDeath = true;
|
||||
private static void disableDropsOnCrammingDeath() {
|
||||
disableDropsOnCrammingDeath = getBoolean("settings.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
public static int packetRateLimit = 250; // per second
|
||||
public static double packetRateLimitInterval = 10.0; // seconds
|
||||
public static String packetRateLimitKickMessage = "Sent too many packets";
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 4c83b4931..5d324a949 100644
|
||||
index ca7cc3b87..0806e87cd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2195,5 +2195,10 @@ public final class CraftServer implements Server {
|
||||
public String getServerName() {
|
||||
return getProperties().serverName;
|
||||
@@ -2200,5 +2200,10 @@ public final class CraftServer implements Server {
|
||||
public double getAverageTickTime() {
|
||||
return net.pl3x.purpur.gui.info.RAMDetails.getAverage(getTickTimes());
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
@@ -1,24 +0,0 @@
|
||||
From 1ab6786f1a7c38e228214f8c10e02a6376329b1e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 11 Aug 2019 22:25:33 -0500
|
||||
Subject: [PATCH] Advancement stuffs
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/CriterionTrigger.java | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CriterionTrigger.java b/src/main/java/net/minecraft/server/CriterionTrigger.java
|
||||
index 4fe7324475..6e5d81daf1 100644
|
||||
--- a/src/main/java/net/minecraft/server/CriterionTrigger.java
|
||||
+++ b/src/main/java/net/minecraft/server/CriterionTrigger.java
|
||||
@@ -27,6 +27,7 @@ public interface CriterionTrigger<T extends CriterionInstance> {
|
||||
this.c = s;
|
||||
}
|
||||
|
||||
+ public T getInstance() { return a(); } // Purpur - OBFHELPER
|
||||
public T a() {
|
||||
return this.a;
|
||||
}
|
||||
--
|
||||
2.24.0.rc1
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
From 005e84d778ce593bdd5c28bbf5be508439583951 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 23 Jul 2019 08:28:21 -0500
|
||||
Subject: [PATCH] Implement configurable villager brain ticks
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityVillager.java | 6 ++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index 3eaac031f..65cd5f53c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -53,6 +53,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
}, MemoryModuleType.MEETING_POINT, (entityvillager, villageplacetype) -> {
|
||||
return villageplacetype == VillagePlaceType.r;
|
||||
});
|
||||
+ private final int brainTickOffset; // Purpur
|
||||
|
||||
public EntityVillager(EntityTypes<? extends EntityVillager> entitytypes, World world) {
|
||||
this(entitytypes, world, VillagerType.PLAINS);
|
||||
@@ -66,6 +67,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
this.setCanPickupLoot(true);
|
||||
this.setVillagerData(this.getVillagerData().withType(villagertype).withProfession(VillagerProfession.NONE));
|
||||
this.bo = this.a(new Dynamic(DynamicOpsNBT.a, new NBTTagCompound()));
|
||||
+ brainTickOffset = getRandom().nextInt(100); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -167,6 +169,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
this.world.getMethodProfiler().enter("brain");
|
||||
+ // Purpur start
|
||||
+ boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
+ if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick)
|
||||
+ // Purpur end
|
||||
this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error
|
||||
this.world.getMethodProfiler().exit();
|
||||
if (!this.et() && this.bB > 0) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index cd3606a65..39c56149a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -739,10 +739,14 @@ public class PurpurWorldConfig {
|
||||
public boolean villagerRidable = false;
|
||||
public boolean villagerRidableInWater = false;
|
||||
public boolean villagerRequireShiftToMount = true;
|
||||
+ public int villagerBrainTicks = 1;
|
||||
+ public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable);
|
||||
villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater);
|
||||
villagerRequireShiftToMount = getBoolean("mobs.villager.require-shift-to-mount", villagerRequireShiftToMount);
|
||||
+ villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
+ villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
}
|
||||
|
||||
public boolean villagerTraderRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -1,42 +1,43 @@
|
||||
From 870cab93964729a680ca7ae59e8c9661f332ee71 Mon Sep 17 00:00:00 2001
|
||||
From dc6745d6610beb00f366080393e08a022c278487 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 17 Aug 2019 15:27:09 -0500
|
||||
Subject: [PATCH] Add option for zombies targetting turtle eggs
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityZombie.java | 2 +-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
index 8f9d252c1e..e9da244d98 100644
|
||||
index e9e2be88e..1e60cc399 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
@@ -48,7 +48,7 @@ public class EntityZombie extends EntityMonster {
|
||||
@@ -64,7 +64,7 @@ public class EntityZombie extends EntityMonster {
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
- this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3));
|
||||
+ if (world.purpurConfig.zombieTargetsTurtleEggs)this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3)); // Purpur
|
||||
+ if (world.purpurConfig.zombieTargetTurtleEggs) this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3)); // Purpur
|
||||
this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
this.l();
|
||||
this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 7422f361e4..4072aac8e4 100644
|
||||
index 39c56149a..1ab98d49e 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -171,6 +171,11 @@ public class PurpurWorldConfig {
|
||||
villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit);
|
||||
@@ -808,10 +808,12 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieRidable = false;
|
||||
public boolean zombieRidableInWater = false;
|
||||
public boolean zombieRequireShiftToMount = true;
|
||||
+ public boolean zombieTargetTurtleEggs = true;
|
||||
private void zombieSettings() {
|
||||
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
||||
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
||||
zombieRequireShiftToMount = getBoolean("mobs.zombie.require-shift-to-mount", zombieRequireShiftToMount);
|
||||
+ zombieTargetTurtleEggs = getBoolean("mobs.zombie.target-turtle-eggs", zombieTargetTurtleEggs);
|
||||
}
|
||||
|
||||
+ public boolean zombieTargetsTurtleEggs = true;
|
||||
+ private void zombieSettings() {
|
||||
+ zombieTargetsTurtleEggs = getBoolean("mobs.zombie.target-turtle-eggs", zombieTargetsTurtleEggs);
|
||||
+ }
|
||||
+
|
||||
public float zombieHorseSpawnChance = 0F;
|
||||
private void zombieHorseSettings() {
|
||||
zombieHorseSpawnChance = (float) getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
public boolean zombieHorseCanSwim = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user