mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Update to 1.16.1
This commit is contained in:
@@ -1,41 +1,41 @@
|
||||
From e03b6ebdad870f7d6c849061daed7f715e496918 Mon Sep 17 00:00:00 2001
|
||||
From 236214ae05f55fc6ae1305edf2eb85b1bcc5af66 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 | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
pom.xml | 13 ++++++-------
|
||||
1 file changed, 6 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index a2387a667..c4b9414fb 100644
|
||||
index dfc7c2f35..cb2dea442 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -3,18 +3,18 @@
|
||||
@@ -3,18 +3,17 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
- <groupId>com.tuinity</groupId>
|
||||
- <artifactId>tuinity-parent</artifactId>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-parent</artifactId>
|
||||
+ <groupId>net.pl3x.purpur</groupId>
|
||||
+ <artifactId>purpur-parent</artifactId>
|
||||
<version>dev-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
- <artifactId>tuinity-api</artifactId>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-api</artifactId>
|
||||
+ <artifactId>purpur-api</artifactId>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.16.1-R0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
- <name>Tuinity-API</name>
|
||||
- <url>https://github.com/Spottedleaf/Tuinity</url>
|
||||
- <name>Paper-API</name>
|
||||
- <url>https://github.com/PaperMC/Paper</url>
|
||||
+ <name>Purpur-API</name>
|
||||
+ <url>https://github.com/pl3xgaming/Purpur</url>
|
||||
<description>An enhanced plugin API for Minecraft servers.</description>
|
||||
|
||||
<properties>
|
||||
@@ -149,7 +149,7 @@
|
||||
@@ -149,7 +148,7 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -1,61 +0,0 @@
|
||||
From 77e67dca85182e9899eba3e4065cabbe4e072e0d Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Fri, 14 Dec 2018 21:52:29 -0800
|
||||
Subject: [PATCH] Tuinity API Changes
|
||||
|
||||
---
|
||||
pom.xml | 12 ++++++------
|
||||
src/main/java/org/bukkit/Server.java | 8 ++++++++
|
||||
2 files changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 20c473f52..a2387a667 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -3,18 +3,18 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-parent</artifactId>
|
||||
+ <groupId>com.tuinity</groupId>
|
||||
+ <artifactId>tuinity-parent</artifactId>
|
||||
<version>dev-SNAPSHOT</version>
|
||||
+ <relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-api</artifactId>
|
||||
+ <artifactId>tuinity-api</artifactId>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
- <name>Paper-API</name>
|
||||
- <url>https://github.com/PaperMC/Paper</url>
|
||||
+ <name>Tuinity-API</name>
|
||||
+ <url>https://github.com/Spottedleaf/Tuinity</url>
|
||||
<description>An enhanced plugin API for Minecraft servers.</description>
|
||||
|
||||
<properties>
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index cc06492f4..cf20e7541 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1396,6 +1396,14 @@ public interface Server extends PluginMessageRecipient {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Tuinity start - add config to timings report
|
||||
+ @NotNull
|
||||
+ public org.bukkit.configuration.file.YamlConfiguration getTuinityConfig()
|
||||
+ {
|
||||
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||
+ }
|
||||
+ // Tuinity end - add config to timings report
|
||||
+
|
||||
/**
|
||||
* Sends the component to the player
|
||||
*
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From bc7ef0c8f2a4e9310cac260ba83bd2534a77d49f Mon Sep 17 00:00:00 2001
|
||||
From 207d7356ada158abb9151799b2c290cef7e465d0 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 18 Feb 2020 20:30:03 -0600
|
||||
Subject: [PATCH] Purpur config files
|
||||
@@ -8,12 +8,12 @@ Subject: [PATCH] Purpur config files
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index cf20e7541..ab1d082a4 100644
|
||||
index b464cc1a7..1a05a438c 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1404,6 +1404,18 @@ public interface Server extends PluginMessageRecipient {
|
||||
@@ -1424,6 +1424,18 @@ public interface Server extends PluginMessageRecipient {
|
||||
}
|
||||
// Tuinity end - add config to timings report
|
||||
// Paper end
|
||||
|
||||
+ // Purpur start
|
||||
+ @NotNull
|
||||
@@ -1,4 +1,4 @@
|
||||
From 465547cca4e6f15f94abbc98fa5dbf0a5f7d2447 Mon Sep 17 00:00:00 2001
|
||||
From 77cf864ad36201a94e3c8ac0535064c98e5c175a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 5 Jun 2020 23:32:38 -0500
|
||||
Subject: [PATCH] Default permissions
|
||||
@@ -6,8 +6,8 @@ Subject: [PATCH] Default permissions
|
||||
---
|
||||
.../util/permissions/CommandPermissions.java | 1 +
|
||||
.../util/permissions/DefaultPermissions.java | 2 +
|
||||
.../util/permissions/PurpurPermissions.java | 62 +++++++++++++++++++
|
||||
3 files changed, 65 insertions(+)
|
||||
.../util/permissions/PurpurPermissions.java | 69 +++++++++++++++++++
|
||||
3 files changed, 72 insertions(+)
|
||||
create mode 100644 src/main/java/org/bukkit/util/permissions/PurpurPermissions.java
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
|
||||
@@ -37,10 +37,10 @@ index e1a4ddf2c..8e481e381 100644
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java b/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java
|
||||
new file mode 100644
|
||||
index 000000000..64fdd9230
|
||||
index 000000000..14cb78e3e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java
|
||||
@@ -0,0 +1,62 @@
|
||||
@@ -0,0 +1,69 @@
|
||||
+package org.bukkit.util.permissions;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
@@ -71,6 +71,13 @@ index 000000000..64fdd9230
|
||||
+ public static Permission registerPermissions() {
|
||||
+ Permission purpur = DefaultPermissions.registerPermission(ROOT, "Gives the user the ability to use all Purpur utilities and commands");
|
||||
+
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.six", "Gives the user six rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.five", "Gives the user five rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.four", "Gives the user four rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.three", "Gives the user three rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.two", "Gives the user two rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.one", "Gives the user one row of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "debug.f3n", "Allows the user to use F3+N keybind to swap gamemodes", PermissionDefault.FALSE, purpur);
|
||||
+
|
||||
+ DefaultPermissions.registerPermission(PREFIX + "drop.spawner", "Allows the user to drop spawner cage when broken with diamond pickaxe with silk touch", PermissionDefault.FALSE, purpur);
|
||||
@@ -1,4 +1,4 @@
|
||||
From b188d7fb384b09a447261d6efcf8c65258799677 Mon Sep 17 00:00:00 2001
|
||||
From 683682367df0d1ec0605b5d75398d9a3f096ca2a 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,10 +8,10 @@ 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 10c3b6d75..931e5ff7b 100644
|
||||
index b59fec1ae..e3b77f565 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 {
|
||||
@@ -132,7 +132,7 @@ public enum InventoryType {
|
||||
STONECUTTER(2, "Stonecutter")
|
||||
;
|
||||
|
||||
@@ -20,7 +20,7 @@ index 10c3b6d75..931e5ff7b 100644
|
||||
private final String title;
|
||||
private final boolean isCreatable;
|
||||
|
||||
@@ -142,6 +142,12 @@ public enum InventoryType {
|
||||
@@ -146,6 +146,12 @@ public enum InventoryType {
|
||||
this.isCreatable = isCreatable;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From a05e6fbef6eb46c46f84a91c09731a0d28ad8c2e Mon Sep 17 00:00:00 2001
|
||||
From c43598530aeb734560bda5aa9e33ba4ecc18ed2a 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
|
||||
Subject: [PATCH] Advancement API
|
||||
|
||||
---
|
||||
.../org/bukkit/advancement/Advancement.java | 9 ++++
|
||||
@@ -1,120 +0,0 @@
|
||||
From 0c20fdc1cc34d29b9135326be5db514107bb6766 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
|
||||
|
||||
---
|
||||
.../paper/entity/ai/VanillaGoal.java | 4 ++
|
||||
.../event/entity/RidableSpacebarEvent.java | 37 ++++++++++++++++++
|
||||
src/main/java/org/bukkit/entity/Entity.java | 38 +++++++++++++++++++
|
||||
3 files changed, 79 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/entity/RidableSpacebarEvent.java
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index d23ad96ee..36d37e9a3 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -154,6 +154,10 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<Mob> FOLLOW_ENTITY = GoalKey.of(Mob.class, NamespacedKey.minecraft("follow_entity"));
|
||||
GoalKey<Tameable> FOLLOW_OWNER = GoalKey.of(Tameable.class, NamespacedKey.minecraft("follow_owner"));
|
||||
GoalKey<Animals> FOLLOW_PARENT = GoalKey.of(Animals.class, NamespacedKey.minecraft("follow_parent"));
|
||||
+ // Purpur start
|
||||
+ GoalKey<Phantom> FIND_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal_goal"));
|
||||
+ GoalKey<Phantom> ORBIT_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal_goal"));
|
||||
+ // Purpur end
|
||||
GoalKey<SkeletonHorse> HORSE_TRAP = GoalKey.of(SkeletonHorse.class, NamespacedKey.minecraft("horse_trap"));
|
||||
GoalKey<Creature> HURT_BY_TARGET = GoalKey.of(Creature.class, NamespacedKey.minecraft("hurt_by_target"));
|
||||
GoalKey<Mob> INTERACT = GoalKey.of(Mob.class, NamespacedKey.minecraft("interact"));
|
||||
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 000000000..c0ec5a130
|
||||
--- /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 3f0f38031..25372c58b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -659,4 +659,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.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From db2a7cb27f0b3422bfd8f786c8eb23ad55fc198c Mon Sep 17 00:00:00 2001
|
||||
From 3efaae899100095ab241d17882103707e439d625 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
|
||||
Subject: [PATCH] Llama API
|
||||
|
||||
---
|
||||
.../event/entity/LlamaJoinCaravanEvent.java | 61 ++++++++++++++++++
|
||||
@@ -1,142 +0,0 @@
|
||||
From acabe1261f9db72988a29d0d72ee138b7c0cf221 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
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/Bukkit.java | 3 ---
|
||||
src/main/java/org/bukkit/Server.java | 3 ---
|
||||
src/main/java/org/bukkit/command/CommandExecutor.java | 2 +-
|
||||
src/main/java/org/bukkit/command/TabCompleter.java | 2 +-
|
||||
src/main/java/org/bukkit/inventory/ItemStack.java | 8 --------
|
||||
src/main/java/org/bukkit/plugin/java/JavaPlugin.java | 4 ++--
|
||||
src/test/java/org/bukkit/AnnotationTest.java | 5 +++++
|
||||
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 a9c10228e..780d603e4 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -863,13 +863,10 @@ public final class Bukkit {
|
||||
* This will return an object even if the player does not exist. To this
|
||||
* method, all players will exist.
|
||||
*
|
||||
- * @deprecated Persistent storage of users should be by UUID as names are no longer
|
||||
- * unique past a single session.
|
||||
* @param name the name the player to retrieve
|
||||
* @return an offline player
|
||||
* @see #getOfflinePlayer(java.util.UUID)
|
||||
*/
|
||||
- @Deprecated
|
||||
@NotNull
|
||||
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 ab1d082a4..a4cf71fb4 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -722,13 +722,10 @@ public interface Server extends PluginMessageRecipient {
|
||||
* This will return an object even if the player does not exist. To this
|
||||
* method, all players will exist.
|
||||
*
|
||||
- * @deprecated Persistent storage of users should be by UUID as names are no longer
|
||||
- * unique past a single session.
|
||||
* @param name the name the player to retrieve
|
||||
* @return an offline player
|
||||
* @see #getOfflinePlayer(java.util.UUID)
|
||||
*/
|
||||
- @Deprecated
|
||||
@NotNull
|
||||
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
|
||||
--- 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 {
|
||||
* @param args Passed command arguments
|
||||
* @return true if a valid command, otherwise false
|
||||
*/
|
||||
- public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args);
|
||||
+ 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
|
||||
--- 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 {
|
||||
* to default to the command executor
|
||||
*/
|
||||
@Nullable
|
||||
- public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args);
|
||||
+ 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 ccd81fca2..a8ade268c 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 {
|
||||
* Sets the durability of this item
|
||||
*
|
||||
* @param durability Durability of this item
|
||||
- * @deprecated durability is now part of ItemMeta. To avoid confusion and
|
||||
- * misuse, {@link #getItemMeta()}, {@link #setItemMeta(ItemMeta)} and
|
||||
- * {@link Damageable#setDamage(int)} should be used instead. This is because
|
||||
- * any call to this method will be overwritten by subsequent setting of
|
||||
- * ItemMeta which was created before this call.
|
||||
*/
|
||||
- @Deprecated
|
||||
public void setDurability(final short durability) {
|
||||
ItemMeta meta = getItemMeta();
|
||||
if (meta != null) {
|
||||
@@ -223,9 +217,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
* Gets the durability of this item
|
||||
*
|
||||
* @return Durability of this item
|
||||
- * @deprecated see {@link #setDurability(short)}
|
||||
*/
|
||||
- @Deprecated
|
||||
public short getDurability() {
|
||||
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
|
||||
--- 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 {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
- public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||
+ public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { // Purpur - remove pointless annotations
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ public abstract class JavaPlugin extends PluginBase {
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
- public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
|
||||
+ public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) { // Purpur - remove pointless annotations
|
||||
return null;
|
||||
}
|
||||
|
||||
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
index a48be38b1..951b81e79 100644
|
||||
--- a/src/test/java/org/bukkit/AnnotationTest.java
|
||||
+++ b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
@@ -41,6 +41,11 @@ public class AnnotationTest {
|
||||
"org/bukkit/plugin/java/PluginClassLoader",
|
||||
// Generic functional interface
|
||||
"org/bukkit/util/Consumer",
|
||||
+ // Purpur start
|
||||
+ "org/bukkit/command/CommandExecutor",
|
||||
+ "org/bukkit/command/TabCompleter",
|
||||
+ "org/bukkit/plugin/java/JavaPlugin",
|
||||
+ // Purpur end
|
||||
// Paper start
|
||||
// Timings history is broken in terms of nullability due to guavas Function defining that the param is NonNull
|
||||
"co/aikar/timings/TimingHistory$2",
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From f6443249943ce18e3d4b7379852b7aadf34262a7 Mon Sep 17 00:00:00 2001
|
||||
From bbc865bdfdd716cc526fbd7cc57e6eb0841d9926 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
|
||||
Subject: [PATCH] Evoker API
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/entity/Evoker.java | 17 +++++++++++++++++
|
||||
@@ -1,7 +1,7 @@
|
||||
From d94af99f8daf2617cad173e2a3f6400b213e5ae1 Mon Sep 17 00:00:00 2001
|
||||
From b01aba9c3138bfcde84036b1fbed0ec910617913 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
|
||||
Subject: [PATCH] AFK API
|
||||
|
||||
---
|
||||
.../net/pl3x/purpur/event/PlayerAFKEvent.java | 70 +++++++++++++++++++
|
||||
@@ -86,10 +86,10 @@ index 000000000..0c8b3e5e4
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 787bb144b..edc481170 100644
|
||||
index 2eb312138..2dca16ac4 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1830,4 +1830,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1870,4 +1870,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Override
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
@@ -1,59 +0,0 @@
|
||||
From e503ea72858416dd97bd79c5aae85a2834f11195 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
|
||||
|
||||
---
|
||||
.../event/entity/EntityPortalReadyEvent.java | 40 +++++++++++++++++++
|
||||
1 file changed, 40 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/entity/EntityPortalReadyEvent.java
|
||||
|
||||
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
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/EntityPortalReadyEvent.java
|
||||
@@ -0,0 +1,40 @@
|
||||
+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;
|
||||
+
|
||||
+/**
|
||||
+ * Called when an entity is ready to travel through a portal
|
||||
+ */
|
||||
+public class EntityPortalReadyEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private boolean cancelled = false;
|
||||
+
|
||||
+ public EntityPortalReadyEvent(@NotNull Entity entity) {
|
||||
+ super(entity);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 53733732e9661eb0f898887c88afd73b93a808f6 Mon Sep 17 00:00:00 2001
|
||||
From 964c8bd13a95dd17362e4c9bf98acc1a7662e008 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
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH] Bring back server name
|
||||
2 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 780d603e4..33ccf2979 100644
|
||||
index 329e2dd1c..4f6f01939 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1714,4 +1714,15 @@ public final class Bukkit {
|
||||
@@ -1749,4 +1749,15 @@ public final class Bukkit {
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
}
|
||||
@@ -29,10 +29,10 @@ index 780d603e4..33ccf2979 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index a4cf71fb4..adfa27be9 100644
|
||||
index 1a05a438c..c8b50ec90 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1513,4 +1513,13 @@ public interface Server extends PluginMessageRecipient {
|
||||
@@ -1536,4 +1536,13 @@ public interface Server extends PluginMessageRecipient {
|
||||
@NotNull
|
||||
com.destroystokyo.paper.entity.ai.MobGoals getMobGoals();
|
||||
// Paper end
|
||||
@@ -1,7 +1,7 @@
|
||||
From 280f0a2c26874110fea70cc278976440c33f58e3 Mon Sep 17 00:00:00 2001
|
||||
From c9d8ecde06f4f694ed59d1da743b79b003a55b3c 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
|
||||
Subject: [PATCH] ExecuteCommandEvent
|
||||
|
||||
---
|
||||
.../purpur/event/ExecuteCommandEvent.java | 130 ++++++++++++++++++
|
||||
@@ -1,17 +1,17 @@
|
||||
From d74d33e1db952f3058834e45fc7ec553efa4d913 Mon Sep 17 00:00:00 2001
|
||||
From 6e3bdc06356d7b63bb206d7319badf594e30d872 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
|
||||
Subject: [PATCH] LivingEntity safeFallDistance
|
||||
|
||||
---
|
||||
.../java/org/bukkit/entity/LivingEntity.java | 16 ++++++++++++++++
|
||||
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 7f73e4b92..1192fef87 100644
|
||||
index a60523cc9..5b688cd04 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -732,4 +732,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -753,4 +753,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
*/
|
||||
void setJumping(boolean jumping);
|
||||
// Paper end
|
||||
@@ -1,7 +1,7 @@
|
||||
From 90c5505c1c2c90cc976c8eee480008146585fb72 Mon Sep 17 00:00:00 2001
|
||||
From 28381a87dfb15e899df91a30192d98eb2575dff8 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
|
||||
Subject: [PATCH] MoonPhase API
|
||||
|
||||
---
|
||||
src/main/java/net/pl3x/purpur/MoonPhase.java | 36 ++++++++++++++++++++
|
||||
@@ -52,10 +52,10 @@ index 000000000..f5ad98c62
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 9518da825..cf0d18283 100644
|
||||
index 75c9225bd..9955d7417 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3382,6 +3382,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
@@ -3450,6 +3450,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
@NotNull
|
||||
public List<Raid> getRaids();
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
From 97b09e0112fecb7c4bd3dacf078e7cedcf402cdd 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
|
||||
|
||||
---
|
||||
.../pl3x/purpur/event/ChunkTooLargeEvent.java | 109 ++++++++++++++++++
|
||||
1 file changed, 109 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/ChunkTooLargeEvent.java
|
||||
|
||||
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
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/ChunkTooLargeEvent.java
|
||||
@@ -0,0 +1,109 @@
|
||||
+package net.pl3x.purpur.event;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.World;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Called when an oversized chunk loads or saves
|
||||
+ */
|
||||
+public class ChunkTooLargeEvent extends Event {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final String worldName;
|
||||
+ private final World world;
|
||||
+ private final int chunkX;
|
||||
+ private final int chunkZ;
|
||||
+ private final boolean saving;
|
||||
+ private final boolean overzealous;
|
||||
+
|
||||
+ public ChunkTooLargeEvent(@NotNull String worldName, int chunkX, int chunkZ, boolean saving, boolean overzealous) {
|
||||
+ super(!Bukkit.isPrimaryThread());
|
||||
+ this.worldName = worldName;
|
||||
+ this.world = Bukkit.getWorld(worldName);
|
||||
+ this.chunkX = chunkX;
|
||||
+ this.chunkZ = chunkZ;
|
||||
+ this.saving = saving;
|
||||
+ this.overzealous = overzealous;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the world name according to the save directory
|
||||
+ *
|
||||
+ * @return World name
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getWorldName() {
|
||||
+ return worldName;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the world
|
||||
+ *
|
||||
+ * @return World, or null if world not loaded
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public World getWorld() {
|
||||
+ return world;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the X chunk coordinate
|
||||
+ *
|
||||
+ * @return X chunk coordinate
|
||||
+ */
|
||||
+ public int getChunkX() {
|
||||
+ return chunkX;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the Z chunk coordinate
|
||||
+ *
|
||||
+ * @return Z chunk coordinate
|
||||
+ */
|
||||
+ public int getChunkZ() {
|
||||
+ return chunkZ;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Whether this happened during a save attempt.
|
||||
+ *
|
||||
+ * @return True if saving, false if loading
|
||||
+ */
|
||||
+ public boolean isSaving() {
|
||||
+ return saving;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * If saving, was this is overzealous mode
|
||||
+ *
|
||||
+ * @return True if saving in overzealous mode
|
||||
+ */
|
||||
+ public boolean isOverzealous() {
|
||||
+ return overzealous;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the location
|
||||
+ *
|
||||
+ * @return Location, or null if world not loaded
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getLocation() {
|
||||
+ return world == null ? null : new Location(world, chunkX << 4, 128, chunkZ << 4);
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From ca1fcc1af2f85b551bf7543deef46acea22634c4 Mon Sep 17 00:00:00 2001
|
||||
From cc7269c63a9bf44a2ddf6d3e51d3d665d265f271 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
|
||||
Subject: [PATCH] Lagging threshold
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/Bukkit.java | 9 +++++++++
|
||||
@@ -9,10 +9,10 @@ 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 33ccf2979..ee8fe48aa 100644
|
||||
index 4f6f01939..4c410f6e1 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1724,5 +1724,14 @@ public final class Bukkit {
|
||||
@@ -1759,5 +1759,14 @@ public final class Bukkit {
|
||||
public static String getServerName() {
|
||||
return server.getServerName();
|
||||
}
|
||||
@@ -28,10 +28,10 @@ index 33ccf2979..ee8fe48aa 100644
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index adfa27be9..40bf67eb9 100644
|
||||
index c8b50ec90..dc6201365 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1521,5 +1521,12 @@ public interface Server extends PluginMessageRecipient {
|
||||
@@ -1544,5 +1544,12 @@ public interface Server extends PluginMessageRecipient {
|
||||
*/
|
||||
@NotNull
|
||||
String getServerName();
|
||||
@@ -1,7 +1,7 @@
|
||||
From 6736fb9a85fe44f9af5c97709ed00d248ae45d0d Mon Sep 17 00:00:00 2001
|
||||
From 3414a3777cd50ba9f807ed0f83284f7dd88e0137 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
|
||||
Subject: [PATCH] ItemFactory#getMonsterEgg
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/inventory/ItemFactory.java | 11 +++++++++++
|
||||
@@ -1,7 +1,7 @@
|
||||
From ace36924c5ca7ff1d4ca22ede17a8fd5ba98c21d Mon Sep 17 00:00:00 2001
|
||||
From 793caade58c03633ae3b36b59ced116586950df6 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
|
||||
Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent
|
||||
|
||||
---
|
||||
.../PlayerSetSpawnerTypeWithEggEvent.java | 85 +++++++++++++++++++
|
||||
@@ -1,7 +1,7 @@
|
||||
From 58a00947d50d1e9be98cac3ed1d51ced2d3bfd79 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
|
||||
From 6f446935210fd7f4676937654457d8d6c1faf2ca Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 21 Nov 2016 17:02:11 -0500
|
||||
Subject: [PATCH] EMC - MonsterEggSpawnEvent
|
||||
|
||||
---
|
||||
.../event/entity/MonsterEggSpawnEvent.java | 67 +++++++++++++++++++
|
||||
@@ -1,7 +1,7 @@
|
||||
From 9ee7302f78720dc515a2bdcca1d53512de2ac975 Mon Sep 17 00:00:00 2001
|
||||
From 49323476e3d0ca119769a379c1080de43ebd3981 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()
|
||||
Subject: [PATCH] Villager#resetOffers
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/entity/Villager.java | 7 +++++++
|
||||
@@ -1,17 +1,17 @@
|
||||
From 3474b0cb95240f60a13d4c4fc4d7d2ecdcf95620 Mon Sep 17 00:00:00 2001
|
||||
From f7b6857340ba29d5877523fa69ad968247143ae7 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
|
||||
Subject: [PATCH] World#getPlacementBlockData
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/World.java | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index cf0d18283..3a7226cc9 100644
|
||||
index 9955d7417..950425979 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3390,6 +3390,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
@@ -3458,6 +3458,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
*/
|
||||
@NotNull
|
||||
net.pl3x.purpur.MoonPhase getMoonPhase();
|
||||
@@ -1,132 +0,0 @@
|
||||
From 46a1c768adda232530d684c5ac49b69b6271cd04 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
|
||||
|
||||
---
|
||||
.../event/entity/ThrownEggHatchEvent.java | 113 ++++++++++++++++++
|
||||
1 file changed, 113 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/entity/ThrownEggHatchEvent.java
|
||||
|
||||
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
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/entity/ThrownEggHatchEvent.java
|
||||
@@ -0,0 +1,113 @@
|
||||
+package net.pl3x.purpur.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Egg;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a thrown egg might hatch
|
||||
+ */
|
||||
+public class ThrownEggHatchEvent extends Event {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ private final Egg egg;
|
||||
+ private boolean hatching;
|
||||
+ private EntityType hatchType;
|
||||
+ private byte numHatches;
|
||||
+
|
||||
+ public ThrownEggHatchEvent(@NotNull final Egg egg, final boolean hatching, final byte numHatches, @NotNull final EntityType hatchingType) {
|
||||
+ this.egg = egg;
|
||||
+ this.hatching = hatching;
|
||||
+ this.numHatches = numHatches;
|
||||
+ this.hatchType = hatchingType;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the egg involved in this event.
|
||||
+ *
|
||||
+ * @return the egg involved in this event
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Egg getEgg() {
|
||||
+ return egg;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets whether the egg is hatching or not. Will be what the server
|
||||
+ * would've done without interaction.
|
||||
+ *
|
||||
+ * @return boolean Whether the egg is going to hatch or not
|
||||
+ */
|
||||
+ public boolean isHatching() {
|
||||
+ return hatching;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets whether the egg will hatch or not.
|
||||
+ *
|
||||
+ * @param hatching true if you want the egg to hatch, false if you want it not to
|
||||
+ */
|
||||
+ public void setHatching(boolean hatching) {
|
||||
+ this.hatching = hatching;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the type of the mob being hatched (EntityType.CHICKEN by default)
|
||||
+ *
|
||||
+ * @return The type of the mob being hatched by the egg
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public EntityType getHatchingType() {
|
||||
+ return hatchType;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Change the type of mob being hatched by the egg
|
||||
+ *
|
||||
+ * @param hatchType The type of the mob being hatched by the egg
|
||||
+ */
|
||||
+ public void setHatchingType(@NotNull EntityType hatchType) {
|
||||
+ if (!hatchType.isSpawnable()) throw new IllegalArgumentException("Can't spawn that entity type from an egg!");
|
||||
+ this.hatchType = hatchType;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the number of mob hatches from the egg. By default the number will
|
||||
+ * be the number the server would've done
|
||||
+ * <ul>
|
||||
+ * <li>7/8 chance of being 0
|
||||
+ * <li>31/256 ~= 1/8 chance to be 1
|
||||
+ * <li>1/256 chance to be 4
|
||||
+ * </ul>
|
||||
+ *
|
||||
+ * @return The number of mobs going to be hatched by the egg
|
||||
+ */
|
||||
+ public byte getNumHatches() {
|
||||
+ return numHatches;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Change the number of mobs coming out of the hatched egg
|
||||
+ * <p>
|
||||
+ * The boolean hatching will override this number. Ie. If hatching =
|
||||
+ * false, this number will not matter
|
||||
+ *
|
||||
+ * @param numHatches The number of mobs coming out of the egg
|
||||
+ */
|
||||
+ public void setNumHatches(byte numHatches) {
|
||||
+ this.numHatches = numHatches;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From 6172f928c68e5721317cacb90c6d32e5c45239f4 Mon Sep 17 00:00:00 2001
|
||||
From ee3249840f9b53b10d7df7434088c5be3a1cd1ea 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
|
||||
Subject: [PATCH] LivingEntity#playPickupItemAnimation
|
||||
|
||||
---
|
||||
.../java/org/bukkit/entity/LivingEntity.java | 17 +++++++++++++++++
|
||||
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 1192fef87..2a713adb5 100644
|
||||
index 5b688cd04..a0db76946 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -747,5 +747,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -768,5 +768,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param safeFallDistance Safe fall distance
|
||||
*/
|
||||
void setSafeFallDistance(float safeFallDistance);
|
||||
@@ -1,7 +1,7 @@
|
||||
From 1f20a2388d7c234a15f667c52eb11e1e2e89153e Mon Sep 17 00:00:00 2001
|
||||
From 9dc21420ed45e161850891442fb6f6ab988eb2e8 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
|
||||
Subject: [PATCH] SkeletonHorseTrapEvent#getPlayer
|
||||
|
||||
---
|
||||
.../event/entity/SkeletonHorseTrapEvent.java | 24 +++++++++++++++++++
|
||||
@@ -1,7 +1,7 @@
|
||||
From b5e2f3328828a98fa1521fe61725cddd2d104590 Mon Sep 17 00:00:00 2001
|
||||
From 585d46d0b381d2dd334997acf9140f505b484bfe Mon Sep 17 00:00:00 2001
|
||||
From: KennyTV <kennytv@t-online.de>
|
||||
Date: Mon, 20 Apr 2020 13:57:13 +0200
|
||||
Subject: [PATCH] PlayerItemCooldownEvent
|
||||
Subject: [PATCH] PaperPR - PlayerItemCooldownEvent
|
||||
|
||||
---
|
||||
.../event/player/PlayerItemCooldownEvent.java | 77 +++++++++++++++++++
|
||||
@@ -1,7 +1,7 @@
|
||||
From ed866cae2228a4924e2ddba5b9f0377170d9555f Mon Sep 17 00:00:00 2001
|
||||
From e15332baaee66fbb5134bc7891a9ba0890d24e04 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
|
||||
Subject: [PATCH] EntityMoveEvent
|
||||
|
||||
---
|
||||
.../purpur/event/entity/EntityMoveEvent.java | 95 +++++++++++++++++++
|
||||
@@ -1,21 +1,21 @@
|
||||
From 5b7ad2395e52a542256545223baee7b6f57e0adf Mon Sep 17 00:00:00 2001
|
||||
From b9e5c3e951fb47294a74c6515e6c3f5442a8b8e7 Mon Sep 17 00:00:00 2001
|
||||
From: Eearslya Sleiarion <eearslya@gmail.com>
|
||||
Date: Mon, 24 Jun 2019 21:27:39 -0700
|
||||
Subject: [PATCH] Add BellRingEvent
|
||||
Subject: [PATCH] PaperPR - BellRingEvent
|
||||
|
||||
Add a new event, BellRingEvent, to trigger whenever a player rings a
|
||||
village bell. Passes along the bell block and the player who rang it.
|
||||
---
|
||||
.../paper/event/block/BellRingEvent.java | 54 +++++++++++++++++++
|
||||
1 file changed, 54 insertions(+)
|
||||
.../paper/event/block/BellRingEvent.java | 53 +++++++++++++++++++
|
||||
1 file changed, 53 insertions(+)
|
||||
create mode 100644 src/main/java/com/destroystokyo/paper/event/block/BellRingEvent.java
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/block/BellRingEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BellRingEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..7b4de3f0a
|
||||
index 000000000..82e0a747b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/block/BellRingEvent.java
|
||||
@@ -0,0 +1,54 @@
|
||||
@@ -0,0 +1,53 @@
|
||||
+package com.destroystokyo.paper.event.block;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
@@ -23,7 +23,6 @@ index 000000000..7b4de3f0a
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.block.BlockEvent;
|
||||
+import org.bukkit.potion.PotionEffect;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
@@ -1,4 +1,4 @@
|
||||
From 02ff3b3a31c89fa3c48f228b8637803d919d0c9c Mon Sep 17 00:00:00 2001
|
||||
From be009f6bd10975040ad8ff9378eca1569132774b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 2 May 2020 20:55:31 -0500
|
||||
Subject: [PATCH] Player invulnerabilities
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] Player invulnerabilities
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index edc481170..5d77b71d1 100644
|
||||
index 2dca16ac4..55edcd54b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1850,5 +1850,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1890,5 +1890,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* Reset the idle timer back to 0
|
||||
*/
|
||||
void resetIdleTimer();
|
||||
@@ -1,7 +1,7 @@
|
||||
From 3121b0887bf03835c9b9a6f1fd3fd2775af5681f Mon Sep 17 00:00:00 2001
|
||||
From 4b4840812bcfe1331263157f9b7b61ec8d79e672 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 19 Apr 2020 00:25:09 -0500
|
||||
Subject: [PATCH] More anvil controls
|
||||
Subject: [PATCH] Anvil API
|
||||
|
||||
---
|
||||
.../event/inventory/AnvilTakeResultEvent.java | 52 +++++++++++++++++++
|
||||
@@ -1,7 +1,7 @@
|
||||
From 28d6279d8881deed20cc24abfecddfcffefb94c2 Mon Sep 17 00:00:00 2001
|
||||
From dc446f6d6e36a6b06f04d8395835257126454d27 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 15 Mar 2020 20:52:12 -0500
|
||||
Subject: [PATCH] Add ItemStack convenience methods
|
||||
Subject: [PATCH] ItemStack convenience methods
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/Material.java | 32 +
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH] Add ItemStack convenience methods
|
||||
2 files changed, 651 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index b89fc2dc0..d5cf01dae 100644
|
||||
index 769c65e79..7126e5cba 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -8021,4 +8021,36 @@ public enum Material implements Keyed {
|
||||
@@ -8636,4 +8636,36 @@ public enum Material implements Keyed {
|
||||
// </editor-fold>
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ index b89fc2dc0..d5cf01dae 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index a8ade268c..cdc62301e 100644
|
||||
index ccd81fca2..c38fd8403 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
@@ -72,7 +72,7 @@ index a8ade268c..cdc62301e 100644
|
||||
|
||||
/**
|
||||
* Represents a stack of items.
|
||||
@@ -783,4 +795,611 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
@@ -791,4 +803,611 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
return itemMeta.hasItemFlag(flag);
|
||||
}
|
||||
// Paper end
|
||||
@@ -1,61 +0,0 @@
|
||||
From f6f1059eb70c8286fafd421d629652abddeab72a 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
|
||||
|
||||
---
|
||||
.../LootableInventoryFirstFillEvent.java | 42 +++++++++++++++++++
|
||||
1 file changed, 42 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/block/LootableInventoryFirstFillEvent.java
|
||||
|
||||
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
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/block/LootableInventoryFirstFillEvent.java
|
||||
@@ -0,0 +1,42 @@
|
||||
+package net.pl3x.purpur.event.block;
|
||||
+
|
||||
+import com.destroystokyo.paper.loottable.LootableInventory;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+public class LootableInventoryFirstFillEvent extends Event {
|
||||
+ @Nullable
|
||||
+ private final Player player;
|
||||
+ @NotNull
|
||||
+ private final LootableInventory inventory;
|
||||
+
|
||||
+ public LootableInventoryFirstFillEvent(@Nullable Player player, @NotNull LootableInventory inventory) {
|
||||
+ this.player = player;
|
||||
+ this.inventory = inventory;
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ public Player getPlayer() {
|
||||
+ return player;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public LootableInventory getInventory() {
|
||||
+ return inventory;
|
||||
+ }
|
||||
+
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 19065eff8026e396d1bf06bc2f87e7598c322c25 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 28 Jun 2020 21:50:55 -0500
|
||||
Subject: [PATCH] Phantoms attracted to crystals and crystals shoot phantoms
|
||||
|
||||
---
|
||||
.../java/com/destroystokyo/paper/entity/ai/VanillaGoal.java | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index d7f1b2c84..8d25b6f09 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
@@ -205,4 +205,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<Zombie> ZOMBIE_ATTACK = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack"));
|
||||
GoalKey<Creature> STROLL_VILLAGE_GOLEM = GoalKey.of(Creature.class, NamespacedKey.minecraft("stroll_village_golem"));
|
||||
GoalKey<Mob> UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset"));
|
||||
+ // Purpur start
|
||||
+ GoalKey<Phantom> FIND_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal_goal"));
|
||||
+ GoalKey<Phantom> ORBIT_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal_goal"));
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
From b08452c2c1e0893a931b924f80972baa4d007619 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
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/PortalType.java | 7 +++++++
|
||||
.../org/bukkit/event/entity/EntityCreatePortalEvent.java | 4 +---
|
||||
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
|
||||
--- a/src/main/java/org/bukkit/PortalType.java
|
||||
+++ b/src/main/java/org/bukkit/PortalType.java
|
||||
@@ -15,6 +15,13 @@ public enum PortalType {
|
||||
*/
|
||||
ENDER,
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * This is an End Gateway portal
|
||||
+ */
|
||||
+ END_GATEWAY,
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* 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
|
||||
--- 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;
|
||||
|
||||
/**
|
||||
* Thrown when a Living Entity creates a portal in a world.
|
||||
- *
|
||||
- * @deprecated Use {@link PortalCreateEvent}
|
||||
*/
|
||||
-@Deprecated
|
||||
+// Purpur - un-deprecate
|
||||
public class EntityCreatePortalEvent extends EntityEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final List<BlockState> blocks;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
From eb6271ac09f62253e19664c2a5e4b28f1dd5a914 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Wed, 1 Apr 2020 19:18:29 -0500
|
||||
Subject: [PATCH] Configurable enchantment max level
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/enchantments/Enchantment.java | 9 +++++++++
|
||||
.../java/org/bukkit/enchantments/EnchantmentWrapper.java | 7 +++++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
|
||||
index d1885f178..b277428d6 100644
|
||||
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
|
||||
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
|
||||
@@ -232,6 +232,15 @@ public abstract class Enchantment implements Keyed {
|
||||
*/
|
||||
public abstract int getMaxLevel();
|
||||
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Sets the maximum level that this Enchantment may become.
|
||||
+ *
|
||||
+ * @param maxLevel Maximum level of the Enchantment
|
||||
+ */
|
||||
+ public abstract void setMaxLevel(int maxLevel);
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
* Gets the level that this Enchantment should start at
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java
|
||||
index 9566e4306..67e31fee3 100644
|
||||
--- a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java
|
||||
+++ b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java
|
||||
@@ -27,6 +27,13 @@ public class EnchantmentWrapper extends Enchantment {
|
||||
return getEnchantment().getMaxLevel();
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public void setMaxLevel(int maxLevel) {
|
||||
+ getEnchantment().setMaxLevel(maxLevel);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public int getStartLevel() {
|
||||
return getEnchantment().getStartLevel();
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
From 520632fdade49977988e20c07bd90d360f86418a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 18 Jun 2020 23:29:43 -0500
|
||||
Subject: [PATCH] Add PrepareGrindstoneEvent
|
||||
|
||||
---
|
||||
.../inventory/PrepareGrindstoneEvent.java | 54 +++++++++++++++++++
|
||||
1 file changed, 54 insertions(+)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/event/inventory/PrepareGrindstoneEvent.java
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/inventory/PrepareGrindstoneEvent.java b/src/main/java/net/pl3x/purpur/event/inventory/PrepareGrindstoneEvent.java
|
||||
new file mode 100644
|
||||
index 000000000..d0670bb72
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/inventory/PrepareGrindstoneEvent.java
|
||||
@@ -0,0 +1,54 @@
|
||||
+package net.pl3x.purpur.event.inventory;
|
||||
+
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.inventory.InventoryEvent;
|
||||
+import org.bukkit.inventory.GrindstoneInventory;
|
||||
+import org.bukkit.inventory.InventoryView;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Called when an item is put in a grindstone slot.
|
||||
+ */
|
||||
+public class PrepareGrindstoneEvent extends InventoryEvent {
|
||||
+
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private ItemStack result;
|
||||
+
|
||||
+ public PrepareGrindstoneEvent(@NotNull InventoryView inventory, @Nullable ItemStack result) {
|
||||
+ super(inventory);
|
||||
+ this.result = result;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public GrindstoneInventory getInventory() {
|
||||
+ return (GrindstoneInventory) super.getInventory();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get result item, may be null.
|
||||
+ *
|
||||
+ * @return result item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public ItemStack getResult() {
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ public void setResult(@Nullable ItemStack result) {
|
||||
+ this.result = result;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,44 +1,45 @@
|
||||
From e2ba591861d7dd7532a3a9e8669ce81dc81ef8d9 Mon Sep 17 00:00:00 2001
|
||||
From d8265c1939a992ff975a7d259bf3e60abec03067 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 01:02:11 -0500
|
||||
Subject: [PATCH] Rebrand
|
||||
|
||||
---
|
||||
pom.xml | 34 ++++--
|
||||
pom.xml | 31 +++--
|
||||
.../paper/console/PaperConsole.java | 2 +-
|
||||
.../net/minecraft/server/MinecraftServer.java | 2 +-
|
||||
.../net/pl3x/purpur/PurpurVersionFetcher.java | 115 ++++++++++++++++++
|
||||
.../org/bukkit/craftbukkit/CraftServer.java | 2 +-
|
||||
.../craftbukkit/util/CraftMagicNumbers.java | 2 +-
|
||||
.../bukkit/craftbukkit/util/Versioning.java | 2 +-
|
||||
7 files changed, 144 insertions(+), 15 deletions(-)
|
||||
7 files changed, 142 insertions(+), 14 deletions(-)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/PurpurVersionFetcher.java
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 66517f30f..097c736bc 100644
|
||||
index ef8ee637a..97c73571b 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -1,11 +1,11 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
@@ -1,12 +1,11 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
- <artifactId>tuinity</artifactId>
|
||||
- <artifactId>paper</artifactId>
|
||||
+ <artifactId>purpur</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
- <name>Tuinity-Server</name>
|
||||
- <url>https://github.com/Spottedleaf/Tuinity</url>
|
||||
<version>1.16.1-R0.1-SNAPSHOT</version>
|
||||
- <name>Paper</name>
|
||||
- <url>https://papermc.io</url>
|
||||
-
|
||||
+ <name>Purpur</name>
|
||||
+ <url>http://pl3x.net</url>
|
||||
<properties>
|
||||
<!-- <skipTests>true</skipTests> Paper - This [was] not going to end well -->
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -17,16 +17,16 @@
|
||||
@@ -18,16 +17,16 @@
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
- <groupId>com.tuinity</groupId>
|
||||
- <artifactId>tuinity-parent</artifactId>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-parent</artifactId>
|
||||
+ <groupId>net.pl3x.purpur</groupId>
|
||||
+ <artifactId>purpur-parent</artifactId>
|
||||
<version>dev-SNAPSHOT</version>
|
||||
@@ -47,14 +48,14 @@ index 66517f30f..097c736bc 100644
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
- <groupId>com.tuinity</groupId>
|
||||
- <artifactId>tuinity-api</artifactId>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-api</artifactId>
|
||||
+ <groupId>net.pl3x.purpur</groupId>
|
||||
+ <artifactId>purpur-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -42,6 +42,20 @@
|
||||
@@ -43,6 +42,20 @@
|
||||
<version>${minecraft.version}-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -75,25 +76,15 @@ index 66517f30f..097c736bc 100644
|
||||
<dependency>
|
||||
<groupId>net.minecrell</groupId>
|
||||
<artifactId>terminalconsoleappender</artifactId>
|
||||
@@ -163,15 +177,15 @@
|
||||
@@ -164,7 +177,7 @@
|
||||
|
||||
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
|
||||
<build>
|
||||
- <finalName>tuinity-${minecraft.version}</finalName>
|
||||
- <defaultGoal>install</defaultGoal> <!-- Paper -->
|
||||
- <finalName>paper-${minecraft.version}</finalName>
|
||||
+ <finalName>purpur-${minecraft.version}</finalName>
|
||||
+ <defaultGoal>clean install</defaultGoal> <!-- Paper -->
|
||||
<defaultGoal>clean install</defaultGoal> <!-- Paper -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.lukegb.mojo</groupId>
|
||||
<artifactId>gitdescribe-maven-plugin</artifactId>
|
||||
<version>1.3</version>
|
||||
<configuration>
|
||||
- <outputPrefix>git-Tuinity-</outputPrefix> <!-- Tuinity -->
|
||||
+ <outputPrefix>git-Purpur-</outputPrefix>
|
||||
<scmDirectory>..</scmDirectory>
|
||||
</configuration>
|
||||
<executions>
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index 74ed02fa9..c1280478e 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -108,15 +99,15 @@ index 74ed02fa9..c1280478e 100644
|
||||
.completer(new ConsoleCommandCompleter(this.server))
|
||||
);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3c9392077..28d92cbce 100644
|
||||
index 5c862de2f..0d0998b06 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1630,7 +1630,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1446,7 +1446,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
- return "Tuinity"; // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return "Purpur"; // Purpur // Tuinity // Paper // Spigot // CraftBukkit
|
||||
- return "Paper"; //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return "Purpur"; // Purpur // Paper // Spigot // CraftBukkit
|
||||
}
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
@@ -242,23 +233,23 @@ index 000000000..d8b408f06
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 760752eae..2a6fd01d6 100644
|
||||
index 25e012678..1026fd81b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -205,7 +205,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -229,7 +229,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
- private final String serverName = "Tuinity"; // Paper // Tuinity
|
||||
+ private final String serverName = "Purpur"; // Paper // Tuinity // Purpur
|
||||
- private final String serverName = "Paper"; // Paper
|
||||
+ private final String serverName = "Purpur"; // Paper // Purpur
|
||||
private final String serverVersion;
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 004b6ce13..e1cfde4ff 100644
|
||||
index 257f46003..63db398ec 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -312,7 +312,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -317,7 +317,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
||||
@Override
|
||||
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
||||
@@ -268,14 +259,14 @@ index 004b6ce13..e1cfde4ff 100644
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 001b1e519..e9aee2d8a 100644
|
||||
index 674096cab..e9aee2d8a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
@@ -11,7 +11,7 @@ public final class Versioning {
|
||||
public static String getBukkitVersion() {
|
||||
String result = "Unknown-Version";
|
||||
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.tuinity/tuinity-api/pom.properties"); // Tuinity
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.destroystokyo.paper/paper-api/pom.properties");
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/net.pl3x.purpur/purpur-api/pom.properties"); // Purpur
|
||||
Properties properties = new Properties();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
From ac0db702eab4e6197bb37c8e84a81b410eae71ba Mon Sep 17 00:00:00 2001
|
||||
From 99870e5b09eef243de5335b21a4efbeb4b427322 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
|
||||
@@ -42,16 +42,16 @@ index 24641501a..b767dd1d0 100644
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 1f1243ae8..3190c709a 100644
|
||||
index 8b2755a3b..df75a9e8a 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -192,6 +192,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -168,6 +168,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
return false;
|
||||
}
|
||||
com.destroystokyo.paper.PaperConfig.registerCommands();
|
||||
+ // Purpur start
|
||||
+ try {
|
||||
+ net.pl3x.purpur.PurpurConfig.init((File) options.valueOf("purpur-settings"));
|
||||
+ net.pl3x.purpur.PurpurConfig.init((java.io.File) options.valueOf("purpur-settings"));
|
||||
+ } catch (Exception e) {
|
||||
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
||||
+ return false;
|
||||
@@ -60,12 +60,12 @@ index 1f1243ae8..3190c709a 100644
|
||||
+ // Purpur end
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
// Paper end
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((File) options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 6ae9ec627..bdb12d16f 100644
|
||||
index b598c4869..c59282ef3 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -85,6 +85,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -91,6 +91,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
public boolean populating;
|
||||
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
|
||||
|
||||
@@ -73,14 +73,14 @@ index 6ae9ec627..bdb12d16f 100644
|
||||
public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper
|
||||
public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
|
||||
@@ -138,6 +139,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
protected World(WorldData worlddata, DimensionManager dimensionmanager, java.util.concurrent.Executor executor, BiFunction<World, WorldProvider, IChunkProvider> bifunction, GameProfilerFiller gameprofilerfiller, boolean flag, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { // Paper - executor
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
|
||||
+ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig(worlddata.getName(), this.paperConfig, this.spigotConfig); // Purpur
|
||||
@@ -120,6 +121,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) {
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper
|
||||
+ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.paperConfig, this.spigotConfig); // Purpur
|
||||
this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
||||
this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(worlddata.getName()); // Tuinity - Server Config
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
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..333c880bf
|
||||
@@ -364,26 +364,26 @@ index 000000000..7d983d9a5
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2a6fd01d6..e3a012800 100644
|
||||
index 1026fd81b..6c602ef79 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -816,6 +816,7 @@ public final class CraftServer implements Server {
|
||||
@@ -846,6 +846,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
+ net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
for (WorldServer world : console.getWorlds()) {
|
||||
world.worldData.setDifficulty(config.difficulty);
|
||||
world.worldDataServer.setDifficulty(config.difficulty);
|
||||
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
|
||||
@@ -845,6 +846,7 @@ public final class CraftServer implements Server {
|
||||
@@ -880,6 +881,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
world.paperConfig.init(); // Paper
|
||||
world.tuinityConfig.init(); // Tuinity - Server Config
|
||||
+ world.purpurConfig.init(); // Purpur
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -863,6 +865,7 @@ public final class CraftServer implements Server {
|
||||
@@ -898,6 +900,7 @@ public final class CraftServer implements Server {
|
||||
reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
com.destroystokyo.paper.PaperConfig.registerCommands(); // Paper
|
||||
@@ -391,9 +391,9 @@ index 2a6fd01d6..e3a012800 100644
|
||||
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2147,6 +2150,18 @@ public final class CraftServer implements Server {
|
||||
@@ -2204,6 +2207,18 @@ public final class CraftServer implements Server {
|
||||
return com.destroystokyo.paper.PaperConfig.config;
|
||||
}
|
||||
// Tuinity end - add config to timings report
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
@@ -411,12 +411,12 @@ index 2a6fd01d6..e3a012800 100644
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 90a2f8fea..8d436d275 100644
|
||||
index 83151f3d7..8879c6421 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -146,6 +146,14 @@ public class Main {
|
||||
@@ -139,6 +139,14 @@ public class Main {
|
||||
.describedAs("Yml file");
|
||||
/* Conctete End - Server Config */
|
||||
// Paper end
|
||||
|
||||
+ // Purpur Start
|
||||
+ acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings")
|
||||
@@ -1,36 +1,34 @@
|
||||
From 8f0c3e0dbe590e8d7fd6e810a1a69e7c3959ce6c Mon Sep 17 00:00:00 2001
|
||||
From 89bd8621126f5990f782a9709221523940f229df Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 5 Jun 2020 21:30:19 -0500
|
||||
Subject: [PATCH] Timings stuff
|
||||
|
||||
---
|
||||
.../java/co/aikar/timings/TimingsExport.java | 27 +++++++++++++++----
|
||||
1 file changed, 22 insertions(+), 5 deletions(-)
|
||||
.../java/co/aikar/timings/TimingsExport.java | 25 ++++++++++++++++---
|
||||
1 file changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index b09981e9b..3342201b3 100644
|
||||
index e33e889c2..29174d903 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -227,10 +227,14 @@ public class TimingsExport extends Thread {
|
||||
@@ -227,9 +227,13 @@ public class TimingsExport extends Thread {
|
||||
// Information on the users Config
|
||||
|
||||
parent.put("config", createObject(
|
||||
- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||
- pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report
|
||||
- pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report
|
||||
- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null))
|
||||
+ // Purpur start
|
||||
+ pair("server.properties", mapAsJSON(Bukkit.spigot().getServerProperties())),
|
||||
+ pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
+ pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||
+ pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)),
|
||||
+ pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)),
|
||||
+ pair("purpur", mapAsJSON(Bukkit.spigot().getPurpurConfig(), null))
|
||||
+ // Purpur end
|
||||
));
|
||||
|
||||
new TimingsExport(listeners, parent, history).start();
|
||||
@@ -271,6 +275,19 @@ public class TimingsExport extends Thread {
|
||||
@@ -270,6 +274,19 @@ public class TimingsExport extends Thread {
|
||||
return timingsCost;
|
||||
}
|
||||
|
||||
@@ -50,12 +48,12 @@ index b09981e9b..3342201b3 100644
|
||||
private static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) {
|
||||
|
||||
JSONObject object = new JSONObject();
|
||||
@@ -307,7 +324,7 @@ public class TimingsExport extends Thread {
|
||||
@@ -306,7 +323,7 @@ public 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(Bukkit.spigot().getPurpurConfig().getString("settings.timings.url", "https://timings.pl3x.net") + "/post").openConnection(); // Purpur
|
||||
+ HttpURLConnection con = (HttpURLConnection) new URL(net.pl3x.purpur.PurpurConfig.timingsUrl + "/post").openConnection(); // Purpur
|
||||
con.setDoOutput(true);
|
||||
String hostName = "BrokenHost";
|
||||
try {
|
||||
@@ -1,19 +1,19 @@
|
||||
From a45c6a3ab3401040e7ab6a00de1f3c847e183dc6 Mon Sep 17 00:00:00 2001
|
||||
From 6946e2a10fd1cb63084783c07c277936405d9b65 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 23 Jun 2019 17:01:26 -0500
|
||||
Subject: [PATCH] Enderchest 6 rows (plus permissions)
|
||||
Date: Thu, 23 May 2019 21:50:37 -0500
|
||||
Subject: [PATCH] Barrels and enderchests 6 rows
|
||||
|
||||
---
|
||||
.../net/minecraft/server/BlockEnderChest.java | 21 +++++++++++++++++++
|
||||
.../net/minecraft/server/BlockEnderChest.java | 21 ++++++++++++++++
|
||||
.../minecraft/server/InventoryEnderChest.java | 2 +-
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 8 +++++++
|
||||
.../craftbukkit/inventory/CraftContainer.java | 2 +-
|
||||
.../minecraft/server/TileEntityBarrel.java | 5 ++--
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 25 +++++++++++++++++++
|
||||
.../craftbukkit/inventory/CraftContainer.java | 4 ++-
|
||||
.../craftbukkit/inventory/CraftInventory.java | 2 +-
|
||||
.../permissions/CraftDefaultPermissions.java | 8 +++++++
|
||||
6 files changed, 40 insertions(+), 3 deletions(-)
|
||||
6 files changed, 54 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockEnderChest.java b/src/main/java/net/minecraft/server/BlockEnderChest.java
|
||||
index 0a892a5f1..e7ef571dc 100644
|
||||
index af2819bb8..73ab299a4 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockEnderChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockEnderChest.java
|
||||
@@ -48,6 +48,27 @@ public class BlockEnderChest extends BlockChestAbstract<TileEntityEnderChest> im
|
||||
@@ -45,7 +45,7 @@ index 0a892a5f1..e7ef571dc 100644
|
||||
}, BlockEnderChest.e));
|
||||
entityhuman.a(StatisticList.OPEN_ENDERCHEST);
|
||||
diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
index fd31b9a6d..903c02e9e 100644
|
||||
index bf8c5436b..d147377e5 100644
|
||||
--- a/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
@@ -20,7 +20,7 @@ public class InventoryEnderChest extends InventorySubcontainer {
|
||||
@@ -57,48 +57,95 @@ index fd31b9a6d..903c02e9e 100644
|
||||
this.owner = owner;
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityBarrel.java b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
index 195abfdff..7e368a2ed 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.b);
|
||||
+ this.items = NonNullList.a(net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27, ItemStack.b); // Purpur
|
||||
}
|
||||
|
||||
public TileEntityBarrel() {
|
||||
@@ -83,7 +83,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
- return 27;
|
||||
+ return net.pl3x.purpur.PurpurConfig.barrelSixRows ? 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.barrelSixRows) return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, this, 6); // 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 581e8eebe..c3ecd6fc7 100644
|
||||
index 333c880bf..fc38163b1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -157,14 +157,22 @@ public class PurpurConfig {
|
||||
@@ -7,6 +7,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;
|
||||
|
||||
public static boolean barrelSixRows = false;
|
||||
public static boolean slimeBlocksNotPushable = false;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -127,4 +128,28 @@ public class PurpurConfig {
|
||||
config.addDefault(path, def);
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
+
|
||||
+ public static String timingsUrl = "https://timings.pl3x.net";
|
||||
+ private static void timingsSettings() {
|
||||
+ timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean barrelSixRows = false;
|
||||
+ public static boolean enderChestSixRows = false;
|
||||
+ public static boolean enderChestPermissionRows = false;
|
||||
private static void blockSettings() {
|
||||
if (version < 3) {
|
||||
boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
set("settings.blocks.barrel.six-rows", oldValue);
|
||||
set("settings.packed-barrels", null);
|
||||
+ private static void blockSettings() {
|
||||
+ if (version < 3) {
|
||||
+ boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
+ set("settings.blocks.barrel.six-rows", oldValue);
|
||||
+ set("settings.packed-barrels", null);
|
||||
+ oldValue = getBoolean("settings.large-ender-chests", true);
|
||||
+ set("settings.blocks.ender_chest.six-rows", oldValue);
|
||||
+ set("settings.large-ender-chests", null);
|
||||
}
|
||||
barrelSixRows = getBoolean("settings.blocks.barrel.six-rows", barrelSixRows);
|
||||
InventoryType.BARREL.setDefaultSize(barrelSixRows ? 54 : 27);
|
||||
+ }
|
||||
+ barrelSixRows = getBoolean("settings.blocks.barrel.six-rows", barrelSixRows);
|
||||
+ InventoryType.BARREL.setDefaultSize(barrelSixRows ? 54 : 27);
|
||||
+ enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
|
||||
+ InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
+ enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
slimeBlocksNotPushable = getBoolean("settings.blocks.slime.not-movable-by-piston", slimeBlocksNotPushable);
|
||||
}
|
||||
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
index d295821c5..610cbbe85 100644
|
||||
index 8c714c743..cae362bae 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
@@ -195,7 +195,7 @@ public class CraftContainer extends Container {
|
||||
@@ -198,8 +198,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
|
||||
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.enderChestSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
break; // Purpur
|
||||
+ break; // Purpur
|
||||
case BARREL:
|
||||
delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.barrelSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
- delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9);
|
||||
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.barrelSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
break;
|
||||
case DISPENSER:
|
||||
case DROPPER:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
index 57858327a..d57ad13f7 100644
|
||||
index 726631348..a45100034 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
@@ -81,7 +81,7 @@ public class CraftInventory implements Inventory {
|
||||
@@ -110,25 +157,6 @@ index 57858327a..d57ad13f7 100644
|
||||
throw new IllegalArgumentException("Invalid inventory size; expected " + getSize() + " or less");
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
|
||||
index a4a809f30..e7d19d67c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
|
||||
@@ -18,6 +18,14 @@ public final class CraftDefaultPermissions {
|
||||
DefaultPermissions.registerPermission(ROOT + ".debugstick.always", "Gives the user the ability to use the debug stick in all game modes", org.bukkit.permissions.PermissionDefault.FALSE, parent);
|
||||
DefaultPermissions.registerPermission(ROOT + ".commandblock", "Gives the user the ability to use command blocks.", org.bukkit.permissions.PermissionDefault.OP, parent); // Paper
|
||||
// Spigot end
|
||||
+ // Purpur start
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.six", "Gives the user six rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.five", "Gives the user five rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.four", "Gives the user four rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.three", "Gives the user three rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.two", "Gives the user two rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.one", "Gives the user one row of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ // Purpur end
|
||||
parent.recalculatePermissibles();
|
||||
}
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 334b15abb698261d55af562dca76653a34cac4a9 Mon Sep 17 00:00:00 2001
|
||||
From f38bc41c719f4ec2f111350a6fb57cdf1cb1444a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 31 May 2019 21:24:33 -0500
|
||||
Subject: [PATCH] Advancement API Additions
|
||||
Subject: [PATCH] Advancement API
|
||||
|
||||
---
|
||||
.../net/minecraft/server/Advancement.java | 2 +-
|
||||
@@ -14,10 +14,10 @@ Subject: [PATCH] Advancement API Additions
|
||||
create mode 100644 src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Advancement.java b/src/main/java/net/minecraft/server/Advancement.java
|
||||
index 4b85551fa..4cba4187a 100644
|
||||
index 315a03cf5..07d4c4cfd 100644
|
||||
--- a/src/main/java/net/minecraft/server/Advancement.java
|
||||
+++ b/src/main/java/net/minecraft/server/Advancement.java
|
||||
@@ -65,7 +65,7 @@ public class Advancement {
|
||||
@@ -64,7 +64,7 @@ public class Advancement {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -27,10 +27,10 @@ index 4b85551fa..4cba4187a 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDisplay.java b/src/main/java/net/minecraft/server/AdvancementDisplay.java
|
||||
index e8172d56f..976c85ef1 100644
|
||||
index 12c63a53b..0d3900456 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDisplay.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDisplay.java
|
||||
@@ -16,10 +16,11 @@ public class AdvancementDisplay {
|
||||
@@ -15,10 +15,11 @@ public class AdvancementDisplay {
|
||||
private final MinecraftKey d;
|
||||
private final AdvancementFrameType e;
|
||||
private final boolean f;
|
||||
@@ -44,7 +44,7 @@ index e8172d56f..976c85ef1 100644
|
||||
|
||||
public AdvancementDisplay(ItemStack itemstack, IChatBaseComponent ichatbasecomponent, IChatBaseComponent ichatbasecomponent1, @Nullable MinecraftKey minecraftkey, AdvancementFrameType advancementframetype, boolean flag, boolean flag1, boolean flag2) {
|
||||
this.a = ichatbasecomponent;
|
||||
@@ -37,22 +38,29 @@ public class AdvancementDisplay {
|
||||
@@ -36,22 +37,29 @@ public class AdvancementDisplay {
|
||||
this.j = f1;
|
||||
}
|
||||
|
||||
@@ -107,10 +107,10 @@ index a9c49a434..551a84547 100644
|
||||
this.e = i;
|
||||
this.f = enumchatformat;
|
||||
diff --git a/src/main/java/net/minecraft/server/CriterionTrigger.java b/src/main/java/net/minecraft/server/CriterionTrigger.java
|
||||
index 4fe732447..6e5d81daf 100644
|
||||
index cfb420a9c..6fd3671c3 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> {
|
||||
@@ -26,6 +26,7 @@ public interface CriterionTrigger<T extends CriterionInstance> {
|
||||
this.c = s;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,135 +0,0 @@
|
||||
From b1cd21795f45b71ae265cebd95060a23cfcf9310 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Mar 2020 13:17:09 -0500
|
||||
Subject: [PATCH] Add language asset purpur.lang
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityPlayer.java | 1 +
|
||||
.../net/minecraft/server/LocaleLanguage.java | 48 +++++++++++++++++--
|
||||
.../pl3x/purpur/command/PurpurCommand.java | 3 ++
|
||||
src/main/resources/purpur.lang | 1 +
|
||||
4 files changed, 49 insertions(+), 4 deletions(-)
|
||||
create mode 100644 src/main/resources/purpur.lang
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 39072ebdc..fe1e9ea61 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1582,6 +1582,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void a(IChatBaseComponent ichatbasecomponent, ChatMessageType chatmessagetype) {
|
||||
+ if (ichatbasecomponent == null) return; // Purpur
|
||||
this.playerConnection.a((Packet) (new PacketPlayOutChat(ichatbasecomponent, chatmessagetype)), (future) -> {
|
||||
if (!future.isSuccess() && (chatmessagetype == ChatMessageType.GAME_INFO || chatmessagetype == ChatMessageType.SYSTEM)) {
|
||||
boolean flag = true;
|
||||
diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java
|
||||
index 601273933..75707adcd 100644
|
||||
--- a/src/main/java/net/minecraft/server/LocaleLanguage.java
|
||||
+++ b/src/main/java/net/minecraft/server/LocaleLanguage.java
|
||||
@@ -15,18 +15,41 @@ import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
+import org.bukkit.ChatColor;
|
||||
|
||||
public class LocaleLanguage {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Pattern b = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]");
|
||||
private static final LocaleLanguage c = new LocaleLanguage();
|
||||
- private final Map<String, String> d = Maps.newHashMap();
|
||||
- private long e;
|
||||
+ private final Map<String, String> d = Maps.newHashMap(); public Map<String, String> getStorage() { return this.d; } // Purpur - OBFHELPER
|
||||
+ private long e; public long getLastUpdateTime() { return this.e; } public void setLastUpdateTime(int time) { this.e = time; } // Purpur - OBFHELPER
|
||||
|
||||
public LocaleLanguage() {
|
||||
+ // Purpur start
|
||||
+ reload(this);
|
||||
+ }
|
||||
+
|
||||
+ private void loadFromFile(String resource) {
|
||||
try {
|
||||
- InputStream inputstream = LocaleLanguage.class.getResourceAsStream("/assets/minecraft/lang/en_us.json");
|
||||
+ java.io.File file = new java.io.File(resource);
|
||||
+ if (!file.exists()) {
|
||||
+ java.nio.file.Files.copy(getClass().getResourceAsStream("/" + resource), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
|
||||
+ }
|
||||
+ loadFromJar("/" + resource);
|
||||
+ loadFromStream(resource, new java.io.FileInputStream(file));
|
||||
+ } catch (IOException e) {
|
||||
+ LOGGER.error("Couldn't read string from " + resource, e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private void loadFromJar(String resource) {
|
||||
+ loadFromStream(resource, getClass().getResourceAsStream(resource));
|
||||
+ }
|
||||
+
|
||||
+ private void loadFromStream(String resource, InputStream inputstream) {
|
||||
+ try {
|
||||
+ // Purpur end
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -60,7 +83,7 @@ public class LocaleLanguage {
|
||||
|
||||
}
|
||||
} catch (JsonParseException | IOException ioexception) {
|
||||
- LocaleLanguage.LOGGER.error("Couldn't read strings from /assets/minecraft/lang/en_us.json", ioexception);
|
||||
+ LocaleLanguage.LOGGER.error("Couldn't read strings from " + resource, ioexception); // Purpur
|
||||
}
|
||||
|
||||
}
|
||||
@@ -88,4 +111,21 @@ public class LocaleLanguage {
|
||||
public long b() {
|
||||
return this.e;
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ public static void reload(LocaleLanguage instance) {
|
||||
+ instance.setLastUpdateTime(0);
|
||||
+ instance.getStorage().clear();
|
||||
+ instance.loadFromJar("/assets/minecraft/lang/en_us.json");
|
||||
+ instance.loadFromFile("purpur.lang");
|
||||
+ }
|
||||
+
|
||||
+ public static ChatMessage translate(String key, Object... args) {
|
||||
+ String str = getInstance().translateKey(key);
|
||||
+ if (str == null) return null;
|
||||
+ str = ChatColor.translateAlternateColorCodes('&', str);
|
||||
+ if (str.isEmpty()) return null;
|
||||
+ return new ChatMessage(str, args);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/command/PurpurCommand.java b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java
|
||||
index 7d983d9a5..36260e0ec 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/command/PurpurCommand.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.pl3x.purpur.command;
|
||||
|
||||
+import net.minecraft.server.LocaleLanguage;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.WorldServer;
|
||||
import net.pl3x.purpur.PurpurConfig;
|
||||
@@ -45,6 +46,8 @@ public class PurpurCommand extends Command {
|
||||
Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
|
||||
Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
|
||||
|
||||
+ LocaleLanguage.reload(LocaleLanguage.getInstance());
|
||||
+
|
||||
MinecraftServer console = MinecraftServer.getServer();
|
||||
PurpurConfig.init((File) console.options.valueOf("purpur-settings"));
|
||||
for (WorldServer world : console.getWorlds()) {
|
||||
diff --git a/src/main/resources/purpur.lang b/src/main/resources/purpur.lang
|
||||
new file mode 100644
|
||||
index 000000000..0967ef424
|
||||
--- /dev/null
|
||||
+++ b/src/main/resources/purpur.lang
|
||||
@@ -0,0 +1 @@
|
||||
+{}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From eab02ae8ebe093cfce94311b02c3c76349add5bd Mon Sep 17 00:00:00 2001
|
||||
From ce23a90cbb5d648a846bdfc45696a55bab8a3ed9 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 22:50:12 -0500
|
||||
Subject: [PATCH] Add more llama API
|
||||
Subject: [PATCH] Llama API
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityLlama.java | 18 ++++++--
|
||||
@@ -10,20 +10,20 @@ Subject: [PATCH] Add more llama API
|
||||
3 files changed, 61 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
index c5f87cbdd..082aac258 100644
|
||||
index 4fe769c76..cf3192085 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
@@ -12,7 +12,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -13,7 +13,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@Nullable
|
||||
private EntityLlama bJ;
|
||||
private EntityLlama bI;
|
||||
@Nullable
|
||||
- private EntityLlama bK;
|
||||
+ private EntityLlama bK; public EntityLlama getCaravanTail() { return bK; } // Purpur - OBFHELPER
|
||||
- private EntityLlama bJ;
|
||||
+ private EntityLlama bJ; public EntityLlama getCaravanTail() { return bJ; } // Purpur - OBFHELPER
|
||||
+ public boolean shouldJoinCaravan = true; // Purpur
|
||||
|
||||
public EntityLlama(EntityTypes<? extends EntityLlama> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -79,7 +80,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -41,7 +42,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
if (!this.inventoryChest.getItem(1).isEmpty()) {
|
||||
nbttagcompound.set("DecorItem", this.inventoryChest.getItem(1).save(new NBTTagCompound()));
|
||||
}
|
||||
@@ -32,7 +32,7 @@ index c5f87cbdd..082aac258 100644
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,7 +91,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -52,7 +53,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
if (nbttagcompound.hasKeyOfType("DecorItem", 10)) {
|
||||
this.inventoryChest.setItem(1, ItemStack.a(nbttagcompound.getCompound("DecorItem")));
|
||||
}
|
||||
@@ -42,45 +42,45 @@ index c5f87cbdd..082aac258 100644
|
||||
+ nbttagcompound.setBoolean("Purpur.ShouldJoinCaravan", shouldJoinCaravan);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.eI();
|
||||
this.ff();
|
||||
}
|
||||
|
||||
@@ -413,19 +418,24 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -387,19 +392,24 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
}
|
||||
}
|
||||
|
||||
+ public void leaveCaravan() { fb(); } // Purpur - OBFHELPER
|
||||
public void fb() {
|
||||
if (this.bJ != null) {
|
||||
+ public void leaveCaravan() { fB(); } // Purpur - OBFHELPER
|
||||
public void fB() {
|
||||
if (this.bI != null) {
|
||||
+ new net.pl3x.purpur.event.entity.LlamaLeaveCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity()).callEvent(); // Purpur
|
||||
this.bJ.bK = null;
|
||||
this.bI.bJ = null;
|
||||
}
|
||||
|
||||
this.bJ = null;
|
||||
this.bI = null;
|
||||
}
|
||||
|
||||
+ public void joinCaravan(EntityLlama entitiyllama) { a(entitiyllama); } // Purpur - OBFHELPER
|
||||
public void a(EntityLlama entityllama) {
|
||||
+ if (!shouldJoinCaravan || !new net.pl3x.purpur.event.entity.LlamaJoinCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity(), (org.bukkit.entity.Llama) entityllama.getBukkitEntity()).callEvent()) return; // Purpur
|
||||
this.bJ = entityllama;
|
||||
this.bJ.bK = this;
|
||||
this.bI = entityllama;
|
||||
this.bI.bJ = this;
|
||||
}
|
||||
|
||||
+ public boolean hasCaravanTail() { return fc(); } // Purpur - OBFHELPER
|
||||
public boolean fc() {
|
||||
return this.bK != null;
|
||||
+ public boolean hasCaravanTail() { return fC(); } // Purpur - OBFHELPER
|
||||
public boolean fC() {
|
||||
return this.bJ != null;
|
||||
}
|
||||
@@ -436,7 +446,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -410,7 +420,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
}
|
||||
|
||||
@Nullable
|
||||
- public EntityLlama fe() {
|
||||
+ public EntityLlama fe() { return getCaravanHead(); } public EntityLlama getCaravanHead() { // Purpur - OBFHELPER
|
||||
return this.bJ;
|
||||
- public EntityLlama fE() {
|
||||
+ public EntityLlama fE() { return getCaravanHead(); } public EntityLlama getCaravanHead() { // Purpur - OBFHELPER
|
||||
return this.bI;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java b/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
||||
index e181d8350..8376f1dc4 100644
|
||||
index 938c271fa..e21901a72 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
||||
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
@@ -97,7 +97,7 @@ index e181d8350..8376f1dc4 100644
|
||||
@Override
|
||||
public boolean a() {
|
||||
+ if (!getLlama().shouldJoinCaravan) return false; // Purpur
|
||||
if (!this.a.isLeashed() && !this.a.fd()) {
|
||||
if (!this.a.isLeashed() && !this.a.fD()) {
|
||||
List<Entity> list = this.a.world.getEntities(this.a, this.a.getBoundingBox().grow(9.0D, 4.0D, 9.0D), (entity) -> {
|
||||
EntityTypes<?> entitytypes = entity.getEntityType();
|
||||
@@ -77,6 +78,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal {
|
||||
@@ -105,8 +105,8 @@ index e181d8350..8376f1dc4 100644
|
||||
@Override
|
||||
public boolean b() {
|
||||
+ if (!getLlama().shouldJoinCaravan) return false; // Purpur
|
||||
if (this.a.fd() && this.a.fe().isAlive() && this.a(this.a, 0)) {
|
||||
double d0 = this.a.h((Entity) this.a.fe());
|
||||
if (this.a.fD() && this.a.fE().isAlive() && this.a(this.a, 0)) {
|
||||
double d0 = this.a.h((Entity) this.a.fE());
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
||||
index 3f94c5a92..a02763480 100644
|
||||
74
patches/server/0007-Evoker-API.patch
Normal file
74
patches/server/0007-Evoker-API.patch
Normal file
@@ -0,0 +1,74 @@
|
||||
From b509638d3539212f7aa2d9dd86aebaac925ac2ab Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:29:02 -0500
|
||||
Subject: [PATCH] Evoker API
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityEvoker.java | 5 +++--
|
||||
.../bukkit/craftbukkit/entity/CraftEvoker.java | 17 +++++++++++++++++
|
||||
2 files changed, 20 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
index dd55e5e5b..c37c2930e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
@@ -24,7 +24,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
|
||||
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
|
||||
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
|
||||
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a());
|
||||
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // Purpur - decompile error
|
||||
this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300));
|
||||
this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false));
|
||||
@@ -79,12 +79,13 @@ public class EntityEvoker extends EntityIllagerWizard {
|
||||
return SoundEffects.ENTITY_EVOKER_HURT;
|
||||
}
|
||||
|
||||
+ public void setWololoTarget(@Nullable EntitySheep sheep) { a(sheep); } // Purpur - OBFHELPER
|
||||
private void a(@Nullable EntitySheep entitysheep) {
|
||||
this.bv = entitysheep;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
- private EntitySheep fh() {
|
||||
+ private EntitySheep fh() { return getWololoTarget(); } public EntitySheep getWololoTarget() { // Purpur - OBFHELPER
|
||||
return this.bv;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
index 0636d2647..a7a548421 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
@@ -5,6 +5,10 @@ import net.minecraft.server.EntityIllagerWizard;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Evoker;
|
||||
+// Purpur start
|
||||
+import net.minecraft.server.EntitySheep;
|
||||
+import javax.annotation.Nullable;
|
||||
+// Purpur end
|
||||
|
||||
public class CraftEvoker extends CraftSpellcaster implements Evoker {
|
||||
|
||||
@@ -36,4 +40,17 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker {
|
||||
public void setCurrentSpell(Evoker.Spell spell) {
|
||||
getHandle().setSpell(spell == null ? EntityIllagerWizard.Spell.NONE : EntityIllagerWizard.Spell.a(spell.ordinal()));
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Nullable
|
||||
+ public org.bukkit.entity.Sheep getWololoTarget() {
|
||||
+ EntitySheep target = getHandle().getWololoTarget();
|
||||
+ return target == null ? null : (org.bukkit.entity.Sheep) target.getBukkitEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setWololoTarget(@Nullable org.bukkit.entity.Sheep sheep) {
|
||||
+ getHandle().setWololoTarget(sheep == null ? null : (EntitySheep) ((CraftEntity) sheep).getHandle());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
From fa7ce62a34d0cd0e28afe493de492cb5e8c0d4df Mon Sep 17 00:00:00 2001
|
||||
From d92c7dd2a708064c634e5a66ce12f673acddf32e 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
|
||||
Subject: [PATCH] AFK API
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/Entity.java | 1 +
|
||||
.../net/minecraft/server/EntityHuman.java | 9 ++++
|
||||
.../net/minecraft/server/EntityPlayer.java | 43 +++++++++++++++++++
|
||||
.../net/minecraft/server/IEntityAccess.java | 34 ++++++---------
|
||||
.../net/minecraft/server/EntityPlayer.java | 46 +++++++++++++++++++
|
||||
.../net/minecraft/server/IEntityAccess.java | 34 +++++---------
|
||||
.../net/minecraft/server/IEntitySelector.java | 2 +
|
||||
.../minecraft/server/PlayerConnection.java | 12 +++++-
|
||||
.../minecraft/server/PlayerConnection.java | 12 ++++-
|
||||
.../net/minecraft/server/WorldServer.java | 4 +-
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 8 ++++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 11 +++++
|
||||
.../craftbukkit/entity/CraftPlayer.java | 17 ++++++++
|
||||
.../craftbukkit/entity/CraftPlayer.java | 17 +++++++
|
||||
.../java/org/spigotmc/ActivationRange.java | 1 +
|
||||
src/main/resources/purpur.lang | 4 +-
|
||||
11 files changed, 112 insertions(+), 26 deletions(-)
|
||||
11 files changed, 120 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 08645bd03..580843686 100644
|
||||
index 38887c1b7..3709f3386 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1623,6 +1623,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1384,6 +1384,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return MathHelper.c(f * f + f1 * f1 + f2 * f2);
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ index 08645bd03..580843686 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 27cfc6654..d62174e9c 100644
|
||||
index 2cada09ce..a69a69859 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 {
|
||||
@@ -84,6 +84,15 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -46,17 +46,17 @@ index 27cfc6654..d62174e9c 100644
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public EntityHuman(World world, GameProfile gameprofile) {
|
||||
public EntityHuman(World world, BlockPosition blockposition, GameProfile gameprofile) {
|
||||
super(EntityTypes.PLAYER, world);
|
||||
this.bV = ItemStack.a;
|
||||
this.bS = ItemStack.b;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index b781aa3ae..d7ce31284 100644
|
||||
index c047d8ff1..6fbbe515c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1646,8 +1646,51 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -1755,8 +1755,54 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
public void resetIdleTimer() {
|
||||
this.cj = SystemUtils.getMonotonicMillis();
|
||||
this.ch = SystemUtils.getMonotonicMillis();
|
||||
+ setAfk(false); // Purpur
|
||||
}
|
||||
|
||||
@@ -68,8 +68,10 @@ index b781aa3ae..d7ce31284 100644
|
||||
+ if (this.isAfk == setAfk) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ String msg = setAfk ? net.pl3x.purpur.PurpurConfig.afkBroadcastAway : net.pl3x.purpur.PurpurConfig.afkBroadcastBack;
|
||||
+
|
||||
+ net.pl3x.purpur.event.PlayerAFKEvent event = new net.pl3x.purpur.event.PlayerAFKEvent(getBukkitEntity(), setAfk, world.purpurConfig.idleTimeoutKick, LocaleLanguage.getInstance().translateKey("idle.timeout.broadcast." + (setAfk ? "away" : "back")), !Bukkit.isPrimaryThread());
|
||||
+ net.pl3x.purpur.event.PlayerAFKEvent event = new net.pl3x.purpur.event.PlayerAFKEvent(getBukkitEntity(), setAfk, world.purpurConfig.idleTimeoutKick, msg, !Bukkit.isPrimaryThread());
|
||||
+ if (!event.callEvent() || event.shouldKick()) {
|
||||
+ return;
|
||||
+ }
|
||||
@@ -80,8 +82,9 @@ index b781aa3ae..d7ce31284 100644
|
||||
+ resetIdleTimer();
|
||||
+ }
|
||||
+
|
||||
+ if (event.getBroadcastMsg() != null && !event.getBroadcastMsg().isEmpty()) {
|
||||
+ server.getPlayerList().sendAll(new PacketPlayOutChat(new ChatMessage(event.getBroadcastMsg(), getScoreboardDisplayName())));
|
||||
+ msg = event.getBroadcastMsg();
|
||||
+ if (msg != null && !msg.isEmpty()) {
|
||||
+ server.getPlayerList().sendAll(new PacketPlayOutChat(new ChatMessage(msg, getScoreboardDisplayName()), ChatMessageType.SYSTEM, SystemUtils.getNullUUID()));
|
||||
+ }
|
||||
+
|
||||
+ if (world.purpurConfig.idleTimeoutUpdateTabList) {
|
||||
@@ -97,8 +100,8 @@ index b781aa3ae..d7ce31284 100644
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCollidable(boolean ignoreClimbing) {
|
||||
+ return !isAfk() && super.isCollidable(ignoreClimbing);
|
||||
+ public boolean isCollidable() {
|
||||
+ return !isAfk() && super.isCollidable();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@@ -106,12 +109,12 @@ index b781aa3ae..d7ce31284 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 e0d97d2c8..e1a7926d7 100644
|
||||
index 267a6baae..d3ea51c27 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
@@ -150,28 +150,18 @@ public interface IEntityAccess {
|
||||
return entityhuman;
|
||||
@@ -143,28 +143,18 @@ public interface IEntityAccess {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
- default boolean isPlayerNearby(double d0, double d1, double d2, double d3) {
|
||||
- Iterator iterator = this.getPlayers().iterator();
|
||||
@@ -128,7 +131,7 @@ index e0d97d2c8..e1a7926d7 100644
|
||||
- }
|
||||
-
|
||||
- entityhuman = (EntityHuman) iterator.next();
|
||||
- } while (!IEntitySelector.f.test(entityhuman));
|
||||
- } while (!IEntitySelector.g.test(entityhuman));
|
||||
- } while (!IEntitySelector.b.test(entityhuman));
|
||||
-
|
||||
- d4 = entityhuman.g(d0, d1, d2);
|
||||
@@ -151,7 +154,7 @@ index e0d97d2c8..e1a7926d7 100644
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
index 1398c47a2..0bf1a14b7 100644
|
||||
index a52dd0c02..9b4795f3b 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;
|
||||
@@ -162,19 +165,19 @@ index 1398c47a2..0bf1a14b7 100644
|
||||
public static final Predicate<EntityLiving> b = EntityLiving::isAlive;
|
||||
public static final Predicate<Entity> c = (entity) -> {
|
||||
return entity.isAlive() && !entity.isVehicle() && !entity.isPassenger();
|
||||
@@ -24,6 +25,7 @@ public final class IEntitySelector {
|
||||
@@ -27,6 +28,7 @@ public final class IEntitySelector {
|
||||
return !entity.isSpectator();
|
||||
};
|
||||
public static Predicate<EntityHuman> isInsomniac = (player) -> MathHelper.clamp(((EntityPlayer) player).getStatisticManager().getStatisticValue(StatisticList.CUSTOM.get(StatisticList.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Paper
|
||||
+ 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;
|
||||
// Paper start
|
||||
public static final Predicate<Entity> affectsSpawning = (entity) -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 8a5059b4f..148beb1b6 100644
|
||||
index 5765e0f04..48a03c44f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -233,6 +233,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -232,6 +232,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)) {
|
||||
@@ -185,18 +188,18 @@ index 8a5059b4f..148beb1b6 100644
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
|
||||
}
|
||||
@@ -456,6 +462,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -448,6 +454,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ()) this.player.resetIdleTimer(); // Purpur
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur
|
||||
+
|
||||
// Skip the first time we do this
|
||||
if (true) { // Spigot - don't skip any move events
|
||||
Location oldTo = to.clone();
|
||||
@@ -1112,7 +1120,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -1117,7 +1125,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
||||
if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot
|
||||
flag1 = true;
|
||||
@@ -205,21 +208,21 @@ index 8a5059b4f..148beb1b6 100644
|
||||
}
|
||||
|
||||
this.player.setLocation(d4, d5, d6, f, f1);
|
||||
@@ -1158,6 +1166,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
@@ -1156,6 +1164,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur
|
||||
+
|
||||
// Skip the first time we do this
|
||||
if (from.getX() != Double.MAX_VALUE) {
|
||||
Location oldTo = to.clone();
|
||||
// Skip the first time we do this
|
||||
if (from.getX() != Double.MAX_VALUE) {
|
||||
Location oldTo = to.clone();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index edf24791b..156c87ed4 100644
|
||||
index f24c4def3..093fa8074 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -846,7 +846,7 @@ public class WorldServer extends World {
|
||||
}
|
||||
@@ -425,7 +425,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> {
|
||||
- return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit
|
||||
@@ -227,7 +230,7 @@ index edf24791b..156c87ed4 100644
|
||||
})) {
|
||||
// CraftBukkit start
|
||||
long l = this.worldData.getDayTime() + 24000L;
|
||||
@@ -1165,7 +1165,7 @@ public class WorldServer extends World {
|
||||
@@ -745,7 +745,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -236,33 +239,57 @@ index edf24791b..156c87ed4 100644
|
||||
++i;
|
||||
} 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 d6405b2ec..41dd1b861 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -138,6 +138,17 @@ public class PurpurWorldConfig {
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index fc38163b1..cc08ad33e 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;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
+import net.minecraft.server.LocaleLanguage;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.pl3x.purpur.command.PurpurCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -129,6 +130,13 @@ public class PurpurConfig {
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
|
||||
+ public static String afkBroadcastAway = "§e§o%s is now AFK";
|
||||
+ public static String afkBroadcastBack = "§e§o%s is no longer AFK";
|
||||
+ private static void messages() {
|
||||
+ afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
|
||||
+ afkBroadcastBack = getString("settings.messages.afk-broadcast-back", afkBroadcastBack);
|
||||
+ }
|
||||
+
|
||||
public static String timingsUrl = "https://timings.pl3x.net";
|
||||
private static void timingsSettings() {
|
||||
timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index eda37fa43..5fa333037 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -64,4 +64,15 @@ public class PurpurWorldConfig {
|
||||
PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
+
|
||||
+ public boolean idleTimeoutKick = true;
|
||||
+ public boolean idleTimeoutTickNearbyEntities = true;
|
||||
+ public boolean idleTimeoutCountAsSleeping = false;
|
||||
+ public boolean idleTimeoutUpdateTabList = false;
|
||||
+ private void idleTimeoutSettings() {
|
||||
+ private void playerIdleTimeoutSettings() {
|
||||
+ 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);
|
||||
+ }
|
||||
+
|
||||
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 141003ca7..e15c12387 100644
|
||||
index 97a24b4df..3bd2ffc20 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2086,4 +2086,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2128,4 +2128,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return spigot;
|
||||
}
|
||||
// Spigot end
|
||||
@@ -285,7 +312,7 @@ index 141003ca7..e15c12387 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index f735217e7..818f8070c 100644
|
||||
index f78e44e05..da4c49daf 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -207,6 +207,7 @@ public class ActivationRange
|
||||
@@ -296,17 +323,6 @@ index f735217e7..818f8070c 100644
|
||||
maxBB = player.getBoundingBox().grow( maxRange, 256, maxRange );
|
||||
ActivationType.MISC.boundingBox = player.getBoundingBox().grow( miscActivationRange, 256, miscActivationRange );
|
||||
ActivationType.RAIDER.boundingBox = player.getBoundingBox().grow( raiderActivationRange, 256, raiderActivationRange );
|
||||
diff --git a/src/main/resources/purpur.lang b/src/main/resources/purpur.lang
|
||||
index 7125c0477..e925e1374 100644
|
||||
--- a/src/main/resources/purpur.lang
|
||||
+++ b/src/main/resources/purpur.lang
|
||||
@@ -1,3 +1,5 @@
|
||||
{
|
||||
- "cannot.ride.mob": "You cannot mount that mob"
|
||||
+ "cannot.ride.mob": "You cannot mount that mob",
|
||||
+ "idle.timeout.broadcast.away": "§e§o%s is now AFK",
|
||||
+ "idle.timeout.broadcast.back": "§e§o%s is no longer AFK"
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From fabde23890d8301331617afb56b2285ee9ec1765 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 18 Feb 2020 20:38:34 -0600
|
||||
Subject: [PATCH] Host our own timings
|
||||
|
||||
---
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 333c880bf..2673de821 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -127,4 +127,8 @@ public class PurpurConfig {
|
||||
config.addDefault(path, def);
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
+
|
||||
+ private static void timingsSettings() {
|
||||
+ getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
From 1ff4358c48066bbe6694b68332dd8a7c3088a4bf Mon Sep 17 00:00:00 2001
|
||||
From fb7aa2524aa13598c3a498a60c44795a2647522f Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 26 May 2019 15:19:14 -0500
|
||||
Subject: [PATCH] Bring back server name
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/DedicatedServerProperties.java | 1 +
|
||||
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 5 +++++
|
||||
2 files changed, 6 insertions(+)
|
||||
.../net/minecraft/server/DedicatedServerProperties.java | 1 +
|
||||
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 +++++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
|
||||
index 0c3ec8357..309f5562b 100644
|
||||
index 6786fd094..8a9be3fdb 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
|
||||
@@ -10,6 +10,7 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
|
||||
@@ -21,21 +21,21 @@ index 0c3ec8357..309f5562b 100644
|
||||
public final boolean spawnNpcs = this.getBoolean("spawn-npcs", true);
|
||||
public final boolean pvp = this.getBoolean("pvp", true);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 97159dfe1..0483ec062 100644
|
||||
index 6c602ef79..39aa8c336 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2301,6 +2301,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2356,4 +2356,11 @@ public final class CraftServer implements Server {
|
||||
return mobGoals;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
// Purpur start
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public String getServerName() {
|
||||
+ return getProperties().serverName;
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public boolean isLagging() {
|
||||
return getServer().lagging;
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
From 9fd9d6cc9145840f9407ba06cac930d39d480d94 Mon Sep 17 00:00:00 2001
|
||||
From 8cabdcc1fff88ba9e699619de4a6898a2c3ab69d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 21 Mar 2020 11:47:39 -0500
|
||||
Subject: [PATCH] Configurable server mod name
|
||||
@@ -9,24 +9,24 @@ Subject: [PATCH] Configurable server mod name
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d9e5eda9b..d91d3a82c 100644
|
||||
index 0d0998b06..377cd8812 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1648,7 +1648,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1446,7 +1446,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
- return "Purpur"; // Purpur // Tuinity // Paper // Spigot // CraftBukkit
|
||||
+ return net.pl3x.purpur.PurpurConfig.serverModName; // Purpur // Tuinity // Paper // Spigot // CraftBukkit
|
||||
- return "Purpur"; // Purpur // Paper // Spigot // CraftBukkit
|
||||
+ return net.pl3x.purpur.PurpurConfig.serverModName; // Purpur // Paper // Spigot // CraftBukkit
|
||||
}
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index fe38b3ce9..a729e7d20 100644
|
||||
index cc08ad33e..3d779b0dc 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -181,6 +181,11 @@ public class PurpurConfig {
|
||||
slimeBlocksNotPushable = getBoolean("settings.blocks.slime.not-movable-by-piston", slimeBlocksNotPushable);
|
||||
@@ -137,6 +137,11 @@ public class PurpurConfig {
|
||||
afkBroadcastBack = getString("settings.messages.afk-broadcast-back", afkBroadcastBack);
|
||||
}
|
||||
|
||||
+ public static String serverModName = "Purpur";
|
||||
@@ -34,9 +34,9 @@ index fe38b3ce9..a729e7d20 100644
|
||||
+ serverModName = getString("settings.server-mod-name", serverModName);
|
||||
+ }
|
||||
+
|
||||
public static String timingsUrl = "https://timings.pl3x.net";
|
||||
private static void timingsSettings() {
|
||||
getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
}
|
||||
timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From ff8ebf864e0f3f5d70b43bfbe7353e347897442b 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)
|
||||
|
||||
---
|
||||
.../net/minecraft/server/AdvancementDataPlayer.java | 1 +
|
||||
.../java/net/minecraft/server/GenericAttributes.java | 1 +
|
||||
.../minecraft/server/WorldGenFeatureConfigured.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 11 +++++++++++
|
||||
.../org/bukkit/craftbukkit/legacy/CraftLegacy.java | 1 +
|
||||
5 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
index c41e13847..44331cea7 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
@@ -162,6 +162,7 @@ public class AdvancementDataPlayer {
|
||||
if (advancement == null) {
|
||||
// CraftBukkit start
|
||||
if (entry.getKey().getNamespace().equals("minecraft")) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressIgnoredAdvancementWarnings) // Purpur
|
||||
AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e);
|
||||
}
|
||||
// CraftBukkit end
|
||||
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 73402f2b5..1c2320cc5 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java
|
||||
@@ -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 2673de821..d6f82d119 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -128,6 +128,17 @@ public class PurpurConfig {
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
|
||||
+ public static boolean loggerSuppressUnknownAttributeWarnings = false;
|
||||
+ public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||
+ public static boolean loggerSuppressWorldGenFeatureDeserializationError = false;
|
||||
+ public static boolean loggerSuppressIgnoredAdvancementWarnings = 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);
|
||||
+ loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
+ }
|
||||
+
|
||||
private static void timingsSettings() {
|
||||
getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index 049e9f98d..1d179cd5b 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.26.2
|
||||
|
||||
@@ -1,34 +1,32 @@
|
||||
From 7922b68914319be86e725f89951217ee05ab2b59 Mon Sep 17 00:00:00 2001
|
||||
From cf295f5a020f34fbf464fb820db12df399df7586 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 5 May 2019 12:58:45 -0500
|
||||
Subject: [PATCH] Implement LivingEntity safeFallDistance
|
||||
Subject: [PATCH] LivingEntity safeFallDistance
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityGiantZombie.java | 3 +++
|
||||
.../java/net/minecraft/server/EntityGiantZombie.java | 1 +
|
||||
.../net/minecraft/server/EntityHorseAbstract.java | 2 +-
|
||||
src/main/java/net/minecraft/server/EntityLiving.java | 3 ++-
|
||||
src/main/java/net/minecraft/server/EntityLiving.java | 7 ++++---
|
||||
.../bukkit/craftbukkit/entity/CraftLivingEntity.java | 12 ++++++++++++
|
||||
4 files changed, 18 insertions(+), 2 deletions(-)
|
||||
4 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index 4296aaa07..a2e3e6001 100644
|
||||
index 603fe5caa..37618126f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -5,6 +5,9 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
@@ -4,6 +4,7 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
setStepHeight(world.purpurConfig.giantStepHeight); // Purpur
|
||||
+ // Purpur start
|
||||
+ this.safeFallDistance = 10.0F;
|
||||
+ // Purpur end
|
||||
+ this.safeFallDistance = 10.0F; // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
index 0ecdea671..e099ef9a0 100644
|
||||
index 364697e01..ee7a2fedd 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
@@ -222,7 +222,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
||||
@@ -210,7 +210,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
||||
|
||||
@Override
|
||||
protected int e(float f, float f1) {
|
||||
@@ -38,18 +36,29 @@ index 0ecdea671..e099ef9a0 100644
|
||||
|
||||
protected int getChestSlots() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 288942e9d..28e555d6e 100644
|
||||
index 7a2140e4b..732a3f21d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -125,6 +125,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -132,6 +132,7 @@ public abstract class EntityLiving extends Entity {
|
||||
// CraftBukkit start
|
||||
public int expToDrop;
|
||||
public int maxAirTicks = 300;
|
||||
+ public float safeFallDistance = 3.0F; // Purpur
|
||||
boolean forceDrops;
|
||||
ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||
@@ -1546,7 +1547,7 @@ public abstract class EntityLiving extends Entity {
|
||||
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||
@@ -226,8 +227,8 @@ public abstract class EntityLiving extends Entity {
|
||||
this.cQ();
|
||||
}
|
||||
|
||||
- if (!this.world.isClientSide && this.fallDistance > 3.0F && flag) {
|
||||
- float f = (float) MathHelper.f(this.fallDistance - 3.0F);
|
||||
+ if (!this.world.isClientSide && this.fallDistance > this.safeFallDistance && flag) { // Purpur
|
||||
+ float f = (float) MathHelper.f(this.fallDistance - this.safeFallDistance); // Purpur
|
||||
|
||||
if (!iblockdata.isAir()) {
|
||||
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||
@@ -1681,7 +1682,7 @@ public abstract class EntityLiving extends Entity {
|
||||
MobEffect mobeffect = this.getEffect(MobEffects.JUMP);
|
||||
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
|
||||
|
||||
@@ -57,12 +66,12 @@ index 288942e9d..28e555d6e 100644
|
||||
+ return MathHelper.f((f - this.safeFallDistance - f2) * f1); // Purpur
|
||||
}
|
||||
|
||||
protected void cZ() {
|
||||
protected void playBlockStepSound() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index a461ac361..4874c2242 100644
|
||||
index 3777aba5f..2a82a2bb7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -739,4 +739,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -752,4 +752,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
|
||||
// Paper end
|
||||
@@ -1,58 +0,0 @@
|
||||
From 7ad6f9948748ee7bc32a5f8682016e0d47b27a80 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
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/IChatBaseComponent.java | 2 ++
|
||||
src/main/java/net/minecraft/server/ItemStack.java | 1 +
|
||||
src/main/java/net/minecraft/server/NBTTagString.java | 1 +
|
||||
3 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
index fb97c51bb..50ed4001d 100644
|
||||
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
@@ -145,6 +145,7 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
|
||||
return this;
|
||||
}
|
||||
|
||||
+ default IChatBaseComponent setFormat(EnumChatFormat enumchatformat) { return a(enumchatformat); } // Purpur - OBFHELPER
|
||||
default IChatBaseComponent a(EnumChatFormat enumchatformat) {
|
||||
ChatModifier chatmodifier = this.getChatModifier();
|
||||
|
||||
@@ -431,6 +432,7 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
|
||||
return jsonobject;
|
||||
}
|
||||
|
||||
+ public static String toJson(IChatBaseComponent ichatbasecomponent) { return a(ichatbasecomponent); } // Purpur - OBFHELPER
|
||||
public static String a(IChatBaseComponent ichatbasecomponent) {
|
||||
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 ea60880c6..413b888a0 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -596,6 +596,7 @@ public final class ItemStack {
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
+ public NBTTagCompound getOrCreateSubTag(String s) { return a(s); } // Purpur - OBFHELPER
|
||||
public NBTTagCompound a(String s) {
|
||||
if (this.tag != null && this.tag.hasKeyOfType(s, 10)) {
|
||||
return this.tag.getCompound(s);
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTTagString.java b/src/main/java/net/minecraft/server/NBTTagString.java
|
||||
index bea4a0b80..c6481c7ff 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTTagString.java
|
||||
+++ b/src/main/java/net/minecraft/server/NBTTagString.java
|
||||
@@ -40,6 +40,7 @@ public class NBTTagString implements NBTBase {
|
||||
this.data = s;
|
||||
}
|
||||
|
||||
+ public static NBTTagString create(String s) { return a(s); } // Purpur - OBFHELPER
|
||||
public static NBTTagString a(String s) {
|
||||
return s.isEmpty() ? NBTTagString.b : new NBTTagString(s);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
From 3783ea32482a168cacafaf3dd37e311a2ac4d2eb Mon Sep 17 00:00:00 2001
|
||||
From 74be5db066f9d9d2bf3105b9f718361ad3c67ec6 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 1 Feb 2020 22:22:16 -0600
|
||||
Subject: [PATCH] Add moon phase API
|
||||
Subject: [PATCH] MoonPhase API
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 32d4aa0f4..e55be5271 100644
|
||||
index fb24b9d07..192c99db1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2477,6 +2477,14 @@ public class CraftWorld implements World {
|
||||
|
||||
return new CraftDragonBattle(((WorldProviderTheEnd) worldProvider).o()); // PAIL rename getDragonBattle
|
||||
@@ -2604,4 +2604,11 @@ public class CraftWorld implements World {
|
||||
return spigot;
|
||||
}
|
||||
// Spigot end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
@@ -22,10 +22,7 @@ index 32d4aa0f4..e55be5271 100644
|
||||
+ return net.pl3x.purpur.MoonPhase.getPhase(getFullTime() / 24000L);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// Paper start
|
||||
@Override
|
||||
public CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) {
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
From 227bedf9b854210d5b7cd9408ca62f7547ff0170 Mon Sep 17 00:00:00 2001
|
||||
From 66165fa04ec062dbe138f99824d32840512a43c1 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
|
||||
Subject: [PATCH] Lagging threshold
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/MinecraftServer.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 +++++++
|
||||
3 files changed, 14 insertions(+)
|
||||
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 5 +++++
|
||||
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 da8c98356..3568e076e 100644
|
||||
index 377cd8812..822798741 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -184,6 +184,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -166,6 +166,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
public static final int TICK_TIME = 1000000000 / TPS;
|
||||
private static final int SAMPLE_INTERVAL = 20; // Paper
|
||||
public final double[] recentTps = new double[ 3 ];
|
||||
@@ -21,20 +21,20 @@ index da8c98356..3568e076e 100644
|
||||
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
|
||||
// Spigot end
|
||||
|
||||
@@ -952,6 +953,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -984,6 +985,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
recentTps[1] = tps5.getAverage();
|
||||
recentTps[2] = tps15.getAverage();
|
||||
// Paper end
|
||||
+ lagging = recentTps[0] < net.pl3x.purpur.PurpurConfig.laggingThreshold; // Purpur
|
||||
tickSection = curTime;
|
||||
}
|
||||
// Tuinity - replace logic
|
||||
midTickChunksTasksRan = 0; // Paper
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index d3e1c8c40..ab20fa2fa 100644
|
||||
index 3d779b0dc..d8b826f6b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -139,6 +139,11 @@ public class PurpurConfig {
|
||||
loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
@@ -147,6 +147,11 @@ public class PurpurConfig {
|
||||
timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
}
|
||||
|
||||
+ public static double laggingThreshold = 19.0D;
|
||||
@@ -42,24 +42,23 @@ index d3e1c8c40..ab20fa2fa 100644
|
||||
+ laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
+ }
|
||||
+
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
public static boolean barrelSixRows = false;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index e3a012800..97159dfe1 100644
|
||||
index 39aa8c336..bca0487ad 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2299,4 +2299,11 @@ public final class CraftServer implements Server {
|
||||
return mobGoals;
|
||||
@@ -2362,5 +2362,10 @@ public final class CraftServer implements Server {
|
||||
public String getServerName() {
|
||||
return getProperties().serverName;
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean isLagging() {
|
||||
+ return getServer().lagging;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
// Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
@@ -1,129 +0,0 @@
|
||||
From 4b620999fe1c124f14cfcad42fcf1d9c4af85953 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] Give giants AI
|
||||
|
||||
---
|
||||
.../minecraft/server/EntityGiantZombie.java | 47 +++++++++++++++++--
|
||||
.../minecraft/server/EntityInsentient.java | 2 +
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 10 ++++
|
||||
3 files changed, 55 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index ff8a41a53..4296aaa07 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -23,6 +23,45 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
return world.purpurConfig.giantRequireShiftToMount;
|
||||
}
|
||||
|
||||
+ 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(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));
|
||||
+ 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
|
||||
+ public GroupDataEntity prepare(GeneratorAccess world, DifficultyDamageScaler difficulty, EnumMobSpawn enummobspawn, GroupDataEntity groupDataEntity, NBTTagCompound nbt) {
|
||||
+ GroupDataEntity groupData = super.prepare(world, difficulty, enummobspawn, groupDataEntity, nbt);
|
||||
+ if (groupData == null) {
|
||||
+ setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ setEnchantmentBasedOnDifficulty(difficulty);
|
||||
+ }
|
||||
+ return groupData;
|
||||
+ }
|
||||
+
|
||||
+ @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));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public float getJumpHeight() {
|
||||
// make giants jump as high as everything else relative to their size
|
||||
@@ -39,13 +78,13 @@ 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
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index cbbbc875b..fbca42909 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -867,6 +867,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return f;
|
||||
}
|
||||
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { a(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void a(DifficultyDamageScaler difficultydamagescaler) {
|
||||
if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) {
|
||||
int i = this.random.nextInt(2);
|
||||
@@ -974,6 +975,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
+ protected void setEnchantmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { b(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void b(DifficultyDamageScaler difficultydamagescaler) {
|
||||
float f = difficultydamagescaler.d();
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 69f99a993..7cf7ae3dc 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -255,12 +255,22 @@ 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 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);
|
||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
}
|
||||
|
||||
public boolean guardianRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 061042c1a14095bb5264328ecf40c63c20212dd6 Mon Sep 17 00:00:00 2001
|
||||
From 38fdad1ea7b019df25e4e4d00c6f0776795bc7e1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 16:36:55 -0500
|
||||
Subject: [PATCH] Implement ItemFactory#getMonsterEgg
|
||||
Subject: [PATCH] ItemFactory#getMonsterEgg
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/ItemMonsterEgg.java | 2 +-
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH] Implement ItemFactory#getMonsterEgg
|
||||
2 files changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
index 24af4c11d..8ef2c3223 100644
|
||||
index 6d8321080..793e42072 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
@@ -8,7 +8,7 @@ import javax.annotation.Nullable;
|
||||
@@ -9,7 +9,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class ItemMonsterEgg extends Item {
|
||||
|
||||
@@ -22,10 +22,10 @@ index 24af4c11d..8ef2c3223 100644
|
||||
private final int c;
|
||||
private final EntityTypes<?> d;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index 23d775645..29161032c 100644
|
||||
index 0d62f3ae9..53038d096 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -354,4 +354,18 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -345,4 +345,18 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
return nms != null ? net.minecraft.server.LocaleLanguage.getInstance().translateKey(nms.getItem().getName()) : null;
|
||||
}
|
||||
// Paper end
|
||||
@@ -1,51 +0,0 @@
|
||||
From 329d09c1593e86d9267736552d421f226208abda 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 AI settings
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityIllagerIllusioner.java | 6 +++---
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 6 ++++++
|
||||
2 files changed, 9 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..13545a8ef 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
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 7cf7ae3dc..96a66926f 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -299,10 +299,16 @@ public class PurpurWorldConfig {
|
||||
public boolean illusionerRidable = false;
|
||||
public boolean illusionerRidableInWater = false;
|
||||
public boolean illusionerRequireShiftToMount = true;
|
||||
+ 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);
|
||||
+ 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.26.2
|
||||
|
||||
98
patches/server/0015-PlayerSetSpawnerTypeWithEggEvent.patch
Normal file
98
patches/server/0015-PlayerSetSpawnerTypeWithEggEvent.patch
Normal file
@@ -0,0 +1,98 @@
|
||||
From 00f1a7cbcc9ae0a4f2ad78b44287a34d81ed54e7 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 18:21:00 -0500
|
||||
Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityTypes.java | 22 +++++++++++++++++++
|
||||
.../net/minecraft/server/ItemMonsterEgg.java | 16 ++++++++++++++
|
||||
2 files changed, 38 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index 18a806ebb..7f2dcc1de 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -142,10 +142,21 @@ public class EntityTypes<T extends Entity> {
|
||||
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public static EntityTypes getFromBukkitType(org.bukkit.entity.EntityType bukkitType) {
|
||||
+ return getFromKey(new MinecraftKey(bukkitType.getKey().toString()));
|
||||
+ }
|
||||
+
|
||||
+ public static EntityTypes getFromKey(MinecraftKey key) {
|
||||
+ return IRegistry.ENTITY_TYPE.get(key);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public static MinecraftKey getName(EntityTypes<?> entitytypes) {
|
||||
return IRegistry.ENTITY_TYPE.getKey(entitytypes);
|
||||
}
|
||||
|
||||
+ public static Optional<EntityTypes<?>> getType(String name) { return a(name); } // Purpur - OBFHELPER
|
||||
public static Optional<EntityTypes<?>> a(String s) {
|
||||
return IRegistry.ENTITY_TYPE.getOptional(MinecraftKey.a(s));
|
||||
}
|
||||
@@ -270,6 +281,16 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bf;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public String getName() {
|
||||
+ return IRegistry.ENTITY_TYPE.getKey(this).getKey();
|
||||
+ }
|
||||
+
|
||||
+ public String getTranslatedName() {
|
||||
+ return getNameComponent().getString();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public String f() {
|
||||
if (this.bn == null) {
|
||||
this.bn = SystemUtils.a("entity", IRegistry.ENTITY_TYPE.getKey(this));
|
||||
@@ -278,6 +299,7 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bn;
|
||||
}
|
||||
|
||||
+ public IChatBaseComponent getNameComponent() { return g(); } // Purpur - OBFHELPER
|
||||
public IChatBaseComponent g() {
|
||||
if (this.bo == null) {
|
||||
this.bo = new ChatMessage(this.f());
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
index 793e42072..cf4c12ff8 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
@@ -7,6 +7,13 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+// Purpur start
|
||||
+import net.pl3x.purpur.event.PlayerSetSpawnerTypeWithEggEvent;
|
||||
+import org.bukkit.block.CreatureSpawner;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.entity.Player;
|
||||
+// Purpur end
|
||||
+
|
||||
public class ItemMonsterEgg extends Item {
|
||||
|
||||
public static final Map<EntityTypes<?>, ItemMonsterEgg> a = Maps.newIdentityHashMap(); // Purpur - private -> public
|
||||
@@ -41,6 +48,15 @@ public class ItemMonsterEgg extends Item {
|
||||
MobSpawnerAbstract mobspawnerabstract = ((TileEntityMobSpawner) tileentity).getSpawner();
|
||||
EntityTypes<?> entitytypes = this.a(itemstack.getTag());
|
||||
|
||||
+ // Purpur start
|
||||
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ PlayerSetSpawnerTypeWithEggEvent event = new PlayerSetSpawnerTypeWithEggEvent((Player) itemactioncontext.b.getBukkitEntity(), bukkitBlock, (CreatureSpawner) bukkitBlock.getState(), EntityType.fromName(entitytypes.getName()));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return EnumInteractionResult.FAIL;
|
||||
+ }
|
||||
+ entitytypes = EntityTypes.getFromBukkitType(event.getEntityType());
|
||||
+ // Purpur end
|
||||
+
|
||||
mobspawnerabstract.setMobName(entitytypes);
|
||||
tileentity.update();
|
||||
world.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From ff08fe5bfa4a978c4db1e6e039d4eadea593d3f0 Mon Sep 17 00:00:00 2001
|
||||
From ebc3f075549750efdaf6d045a951b5082b1aa9c0 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 20 Jul 2013 22:40:56 -0400
|
||||
Subject: [PATCH] EMC - MonsterEggSpawn Event
|
||||
Subject: [PATCH] EMC - MonsterEggSpawnEvent
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityTypes.java | 28 ++++++++++++++++++-
|
||||
1 file changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index 8e8d392a1..ff11baa7c 100644
|
||||
index 7f2dcc1de..5aea85595 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -163,19 +163,45 @@ public class EntityTypes<T extends Entity> {
|
||||
@@ -176,19 +176,45 @@ public class EntityTypes<T extends Entity> {
|
||||
|
||||
@Nullable
|
||||
public Entity spawnCreature(World world, @Nullable ItemStack itemstack, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
|
||||
@@ -1,7 +1,7 @@
|
||||
From f47732a9410ca8fffaa03331ac3deb642af7e1ed Mon Sep 17 00:00:00 2001
|
||||
From f78891becd000d9c7787bc38deb9d35aa797405b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 7 Oct 2019 00:15:37 -0500
|
||||
Subject: [PATCH] Add API for Villager#resetOffers()
|
||||
Subject: [PATCH] Villager#resetOffers
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityVillagerAbstract.java | 8 ++++++++
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH] Add API for Villager#resetOffers()
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
index 463528532..5fbd13512 100644
|
||||
index 81823b5d5..beb84a2ab 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
@@ -84,6 +84,13 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
@@ -86,6 +86,13 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
return this.tradingPlayer != null;
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ index 463528532..5fbd13512 100644
|
||||
@Override
|
||||
public MerchantRecipeList getOffers() {
|
||||
if (this.trades == null) {
|
||||
@@ -225,6 +232,7 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
@@ -208,6 +215,7 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
return this.world;
|
||||
}
|
||||
|
||||
+ protected void updateTrades() { eC(); } // Purpur
|
||||
protected abstract void eC();
|
||||
+ protected void updateTrades() { eW(); } // Purpur
|
||||
protected abstract void eW();
|
||||
|
||||
protected void a(MerchantRecipeList merchantrecipelist, VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption, int i) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
||||
27
patches/server/0018-World-getPlacementBlockData.patch
Normal file
27
patches/server/0018-World-getPlacementBlockData.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
From ccf75c0f071428349a26221eb9c05d22d6c11466 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 8 Feb 2020 23:30:17 -0600
|
||||
Subject: [PATCH] World#getPlacementBlockData
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 192c99db1..be2d2040c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2610,5 +2610,10 @@ public class CraftWorld implements World {
|
||||
public net.pl3x.purpur.MoonPhase getMoonPhase() {
|
||||
return net.pl3x.purpur.MoonPhase.getPhase(getFullTime() / 24000L);
|
||||
}
|
||||
+
|
||||
+ public BlockData getPlacementBlockData(BlockData blockdata, Location location) {
|
||||
+ IBlockData validData = net.minecraft.server.Block.getValidBlockForPosition(((CraftBlockData) blockdata).getState(), getHandle(), net.minecraft.server.MCUtil.toBlockPosition(location));
|
||||
+ return CraftBlockData.fromData(validData == null ? Blocks.AIR.getBlockData() : validData);
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
From c673dd6d4a16db19278e99bd2355469d93c2a79f 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] Cat spawning options
|
||||
|
||||
---
|
||||
.../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..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 {
|
||||
if (this.a > 0) {
|
||||
return 0;
|
||||
} else {
|
||||
- this.a = 1200;
|
||||
+ this.a = worldserver.purpurConfig.catSpawnDelay; // Purpur
|
||||
EntityPlayer entityplayer = worldserver.k();
|
||||
|
||||
if (entityplayer == null) {
|
||||
@@ -49,10 +49,14 @@ public class MobSpawnerCat {
|
||||
}
|
||||
|
||||
private int a(WorldServer worldserver, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
-
|
||||
- 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 end
|
||||
|
||||
if (list.size() < 5) {
|
||||
return this.a(blockposition, (World) worldserver);
|
||||
@@ -63,8 +67,13 @@ public class MobSpawnerCat {
|
||||
}
|
||||
|
||||
private int a(World world, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
- 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;
|
||||
+ }
|
||||
+ List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
|
||||
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 4aaf75fcf..12fbdf65c 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -101,10 +101,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() {
|
||||
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.26.2
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From 8d2281f398ecd5a18ce82bbe36815336b45564ca Mon Sep 17 00:00:00 2001
|
||||
From ad5c59131a490f3a1acf7e51ec0a25698f1d5d40 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 02:25:16 -0500
|
||||
Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
||||
Subject: [PATCH] LivingEntity#playPickupItemAnimation
|
||||
|
||||
---
|
||||
.../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 4874c2242..d8207b322 100644
|
||||
index 2a82a2bb7..a415707e9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -750,5 +750,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -763,5 +763,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public void setSafeFallDistance(float safeFallDistance) {
|
||||
getHandle().safeFallDistance = safeFallDistance;
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
From 8e48776996b8bb36d3834d576e20a70ffd0f332b Mon Sep 17 00:00:00 2001
|
||||
From 31aa2e07a779236b98b8415007409eed934d8452 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 02:35:35 -0500
|
||||
Subject: [PATCH] Add getPlayer to SkeletonHorseTrapEvent
|
||||
Subject: [PATCH] SkeletonHorseTrapEvent#getPlayer
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/PathfinderGoalHorseTrap.java | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||
index 37626f925..f8fd2d99c 100644
|
||||
index b37e4aa37..4d8c4ac07 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||
@@ -2,7 +2,8 @@ package net.minecraft.server;
|
||||
@@ -33,9 +33,9 @@ index 37626f925..f8fd2d99c 100644
|
||||
public void e() {
|
||||
- if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.a.getBukkitEntity()).callEvent()) return; // Paper
|
||||
+ if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.a.getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity()).callEvent()) return; // Paper // Purpur
|
||||
DifficultyDamageScaler difficultydamagescaler = this.a.world.getDamageScaler(new BlockPosition(this.a));
|
||||
DifficultyDamageScaler difficultydamagescaler = this.a.world.getDamageScaler(this.a.getChunkCoordinates());
|
||||
|
||||
this.a.r(false);
|
||||
this.a.t(false);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 4ccb3f307363426180c14b91fd024e297f003f8e Mon Sep 17 00:00:00 2001
|
||||
From 8a99e19fa0556853736568a269dd892342449daf Mon Sep 17 00:00:00 2001
|
||||
From: KennyTV <kennytv@t-online.de>
|
||||
Date: Mon, 20 Apr 2020 13:57:06 +0200
|
||||
Subject: [PATCH] PaperPR - PlayerItemCooldownEvent
|
||||
@@ -1,34 +1,26 @@
|
||||
From ba39fe270c169902970625051d27f30b23d54dc9 Mon Sep 17 00:00:00 2001
|
||||
From c61f071c2eb1be7789fc51fc08b363eacf5e0473 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 11 Feb 2020 21:56:48 -0600
|
||||
Subject: [PATCH] Implement EntityMoveEvent
|
||||
Subject: [PATCH] EntityMoveEvent
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityLiving.java | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
.../java/net/minecraft/server/EntityLiving.java | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 28e555d6e..387f74fe1 100644
|
||||
index 732a3f21d..f917cd5df 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -17,6 +17,7 @@ import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
+import net.pl3x.purpur.event.entity.EntityMoveEvent; // Purpur
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -2648,6 +2649,20 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2790,6 +2790,20 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.collideNearby();
|
||||
this.world.getMethodProfiler().exit();
|
||||
+ // Purpur start
|
||||
+ if (EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
||||
+ if (net.pl3x.purpur.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
||||
+ if (lastX != locX() || lastY != locY() || lastZ != locZ() || lastYaw != yaw || lastPitch != pitch) {
|
||||
+ Location from = new Location(world.getWorld(), lastX, lastY, lastZ, lastYaw, lastPitch);
|
||||
+ Location to = new Location (world.getWorld(), locX(), locY(), locZ(), yaw, pitch);
|
||||
+ EntityMoveEvent event = new EntityMoveEvent(getBukkitLivingEntity(), from, to.clone());
|
||||
+ net.pl3x.purpur.event.entity.EntityMoveEvent event = new net.pl3x.purpur.event.entity.EntityMoveEvent(getBukkitLivingEntity(), from, to.clone());
|
||||
+ if (!event.callEvent()) {
|
||||
+ setLocation(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch());
|
||||
+ } else if (!to.equals(event.getTo())) {
|
||||
@@ -37,9 +29,9 @@ index 28e555d6e..387f74fe1 100644
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
private void n() {
|
||||
if (!this.world.isClientSide && this.dN() && this.aC()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
From 2cafa9014b47d301c4f70ca2503bc8398c260a18 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
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityMushroomCow.java | 8 +++++++-
|
||||
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 53bc31287..bf835aaf9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
@@ -114,7 +114,13 @@ public class EntityMushroomCow extends EntityCow {
|
||||
|
||||
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
|
||||
entitycow.setHealth(this.getHealth());
|
||||
- entitycow.aI = this.aI;
|
||||
+ // Purpur start - correctly copy rotation
|
||||
+ entitycow.copyPositionRotation(this);
|
||||
+ entitycow.setRenderYawOffset(this.getRenderYawOffset());
|
||||
+ entitycow.setHeadRotation(this.getHeadRotation());
|
||||
+ entitycow.lastYaw = this.lastYaw;
|
||||
+ entitycow.lastPitch = this.lastPitch;
|
||||
+ // Purpur end
|
||||
if (this.hasCustomName()) {
|
||||
entitycow.setCustomName(this.getCustomName());
|
||||
entitycow.setCustomNameVisible(this.getCustomNameVisible());
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 3e5f9a68fcae710e4090815afb8f635865e12f0b Mon Sep 17 00:00:00 2001
|
||||
From 0d8728d2c77181579b7efcc4ca6d588d45f1615a Mon Sep 17 00:00:00 2001
|
||||
From: Eearslya Sleiarion <eearslya@gmail.com>
|
||||
Date: Mon, 24 Jun 2019 21:27:32 -0700
|
||||
Subject: [PATCH] PaperPR - Add BellRingEvent
|
||||
@@ -8,19 +8,19 @@ Subject: [PATCH] PaperPR - Add BellRingEvent
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockBell.java b/src/main/java/net/minecraft/server/BlockBell.java
|
||||
index dbdbfb8ad..0bbd1e159 100644
|
||||
index 2ef899c76..7db4e22c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockBell.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockBell.java
|
||||
@@ -45,7 +45,7 @@ public class BlockBell extends BlockTileEntity {
|
||||
Entity entity1 = ((EntityArrow) entity).getShooter();
|
||||
EntityHuman entityhuman = entity1 instanceof EntityHuman ? (EntityHuman) entity1 : null;
|
||||
|
||||
- this.a(world, iblockdata, movingobjectpositionblock, entityhuman, true);
|
||||
+ this.handleBellRing(world, iblockdata, movingobjectpositionblock, entityhuman, true, entity); // Purpur
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class BlockBell extends BlockTileEntity {
|
||||
Entity entity = iprojectile.getShooter();
|
||||
EntityHuman entityhuman = entity instanceof EntityHuman ? (EntityHuman) entity : null;
|
||||
|
||||
- this.a(world, iblockdata, movingobjectpositionblock, entityhuman, true);
|
||||
+ this.handleBellRing(world, iblockdata, movingobjectpositionblock, entityhuman, true, entity); // Purpur
|
||||
}
|
||||
@@ -56,11 +56,23 @@ public class BlockBell extends BlockTileEntity {
|
||||
|
||||
@Override
|
||||
@@ -53,11 +53,23 @@ public class BlockBell extends BlockTileEntity {
|
||||
}
|
||||
|
||||
public boolean a(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, @Nullable EntityHuman entityhuman, boolean flag) {
|
||||
@@ -37,7 +37,7 @@ index dbdbfb8ad..0bbd1e159 100644
|
||||
if (flag1) {
|
||||
+ // Purpur start - BellRingEvent
|
||||
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ if (!new com.destroystokyo.paper.event.block.BellRingEvent(block, (org.bukkit.entity.Entity) entity.getBukkitEntity()).callEvent()) {
|
||||
+ if (!new com.destroystokyo.paper.event.block.BellRingEvent(block, entity.getBukkitEntity()).callEvent()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
@@ -1,52 +0,0 @@
|
||||
From 1807f5647ff8b32508f3af2d41c656d755f46f39 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 091f30727..85692500b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -413,9 +413,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.26.2
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
From 7c51cf494632ddcecb2ee18c559a9930f3b4a681 Mon Sep 17 00:00:00 2001
|
||||
From 475fd521ac59a8425121d35cf70eb47039c89dab Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 2 May 2020 20:55:44 -0500
|
||||
Subject: [PATCH] Player invulnerabilities
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityPlayer.java | 22 +++++++++++++++++--
|
||||
.../net/minecraft/server/EntityPlayer.java | 21 +++++++++++++++++--
|
||||
.../minecraft/server/PlayerConnection.java | 1 +
|
||||
.../java/net/minecraft/server/PlayerList.java | 2 ++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
|
||||
.../craftbukkit/entity/CraftPlayer.java | 15 +++++++++++++
|
||||
5 files changed, 42 insertions(+), 2 deletions(-)
|
||||
5 files changed, 44 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 3e0e49dbb..e73b33721 100644
|
||||
index 6fbbe515c..c627ea053 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -137,6 +137,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -141,6 +141,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.canPickUpLoot = true;
|
||||
this.maxHealthCache = this.getMaxHealth();
|
||||
this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
|
||||
@@ -24,7 +24,7 @@ index 3e0e49dbb..e73b33721 100644
|
||||
}
|
||||
// Paper start
|
||||
public BlockPosition getPointInFront(double inFront) {
|
||||
@@ -748,6 +750,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -804,6 +806,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
}
|
||||
|
||||
@@ -37,25 +37,24 @@ index 3e0e49dbb..e73b33721 100644
|
||||
@Override
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable(damagesource)) {
|
||||
@@ -755,7 +763,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -811,7 +819,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
} else {
|
||||
boolean flag = this.server.m() && this.canPvP() && "fall".equals(damagesource.translationIndex);
|
||||
boolean flag = this.server.j() && this.canPvP() && "fall".equals(damagesource.translationIndex);
|
||||
|
||||
- if (!flag && this.invulnerableTicks > 0 && damagesource != DamageSource.OUT_OF_WORLD) {
|
||||
+ if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur
|
||||
return false;
|
||||
} else {
|
||||
if (damagesource instanceof EntityDamageSource) {
|
||||
@@ -1022,6 +1030,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -1057,6 +1065,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver.getWorld());
|
||||
this.world.getServer().getPluginManager().callEvent(changeEvent);
|
||||
// CraftBukkit end
|
||||
+
|
||||
+ this.invulnerableTicks = worldserver.purpurConfig.playerSpawnInvulnerableTicks; // Purpur
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -2010,9 +2020,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -2152,9 +2161,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
@Override
|
||||
public boolean isFrozen() { // Paper - protected > public
|
||||
@@ -75,10 +74,10 @@ index 3e0e49dbb..e73b33721 100644
|
||||
public Scoreboard getScoreboard() {
|
||||
return getBukkitEntity().getScoreboard().getHandle();
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 82faee937..86715ff3c 100644
|
||||
index 48a03c44f..85016aa76 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1548,6 +1548,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -1563,6 +1563,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer());
|
||||
// Paper start
|
||||
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()];
|
||||
@@ -87,10 +86,10 @@ index 82faee937..86715ff3c 100644
|
||||
this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), packStatus));
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index af2cdbf4d..5cacea602 100644
|
||||
index 3c5ba8f2f..5807e77da 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -828,6 +828,8 @@ public abstract class PlayerList {
|
||||
@@ -869,6 +869,8 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -100,32 +99,26 @@ index af2cdbf4d..5cacea602 100644
|
||||
return entityplayer1;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index efdc176e6..81969d2dc 100644
|
||||
index 5fa333037..bd9b82dad 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -209,6 +209,8 @@ public class PurpurWorldConfig {
|
||||
public boolean milkCuresBadOmen = true;
|
||||
public String playerDeathExpDropEquation = "expLevel * 7";
|
||||
public int playerDeathExpDropMax = 100;
|
||||
@@ -75,4 +75,11 @@ public class PurpurWorldConfig {
|
||||
idleTimeoutCountAsSleeping = getBoolean("gameplay-mechanics.player.idle-timeout.count-as-sleeping", idleTimeoutCountAsSleeping);
|
||||
idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
|
||||
}
|
||||
+
|
||||
+ public int playerSpawnInvulnerableTicks = 60;
|
||||
+ public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
||||
public boolean playerSleepOnlyWithCondition = false;
|
||||
public String playerSleepCondition = "time >= 12541 && time <= 23458";
|
||||
public boolean useBetterMending = false;
|
||||
@@ -254,6 +256,8 @@ public class PurpurWorldConfig {
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
playerDeathExpDropEquation = getString("gameplay-mechanics.player.exp-dropped-on-death.equation", playerDeathExpDropEquation);
|
||||
playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax);
|
||||
+ private void playerInvulnerabilities() {
|
||||
+ playerSpawnInvulnerableTicks = getInt("gameplay-mechanics.player.spawn-invulnerable-ticks", playerSpawnInvulnerableTicks);
|
||||
+ playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
playerSleepOnlyWithCondition = getBoolean("gameplay-mechanics.player.sleep.only-with-condition", playerSleepOnlyWithCondition);
|
||||
playerSleepCondition = getString("gameplay-mechanics.player.sleep.condition", playerSleepCondition);
|
||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index e15c12387..137699c3e 100644
|
||||
index 3bd2ffc20..9b1c4d932 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2102,5 +2102,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2144,5 +2144,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void resetIdleTimer() {
|
||||
getHandle().resetIdleTimer();
|
||||
}
|
||||
@@ -1,53 +1,45 @@
|
||||
From aff14f5361f3b98c2bf66fa61d766e1db14af17e Mon Sep 17 00:00:00 2001
|
||||
From 44cafc5974e016c61841d8fd29e480e8605416b0 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 19 Apr 2020 00:17:56 -0500
|
||||
Subject: [PATCH] More anvil controls
|
||||
Subject: [PATCH] Anvil API
|
||||
|
||||
---
|
||||
.../net/minecraft/server/ContainerAnvil.java | 31 +++++++++++++++++--
|
||||
.../inventory/CraftInventoryAnvil.java | 24 +++++++++++++-
|
||||
2 files changed, 51 insertions(+), 4 deletions(-)
|
||||
.../net/minecraft/server/ContainerAnvil.java | 29 +++++++++++++++++--
|
||||
.../inventory/CraftInventoryAnvil.java | 24 ++++++++++++++-
|
||||
2 files changed, 49 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
index 286b930dd..d418c0441 100644
|
||||
index 24631b2bc..126effe5b 100644
|
||||
--- a/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
+++ b/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
@@ -8,6 +8,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
+import org.bukkit.inventory.AnvilInventory;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ContainerAnvil extends Container {
|
||||
@@ -25,6 +26,8 @@ public class ContainerAnvil extends Container {
|
||||
private int lastLevelCost;
|
||||
@@ -20,6 +20,8 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
public int maximumRepairCost = 40;
|
||||
private CraftInventoryView bukkitEntity;
|
||||
private PlayerInventory playerInventory;
|
||||
// CraftBukkit end
|
||||
+ public boolean bypassCost = false; // Purpur
|
||||
+ public boolean canDoUnsafeEnchants = false; // Purpur
|
||||
// CraftBukkit end
|
||||
|
||||
public ContainerAnvil(int i, PlayerInventory playerinventory) {
|
||||
@@ -56,12 +59,14 @@ public class ContainerAnvil extends Container {
|
||||
this(i, playerinventory, ContainerAccess.a);
|
||||
@@ -38,12 +40,14 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
@Override
|
||||
public boolean isAllowed(EntityHuman entityhuman) {
|
||||
- return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= ContainerAnvil.this.levelCost.get()) && ContainerAnvil.this.levelCost.get() > 0 && this.hasItem();
|
||||
+ return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= ContainerAnvil.this.levelCost.get()) && (bypassCost || ContainerAnvil.this.levelCost.get() > 0) && this.hasItem(); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack a(EntityHuman entityhuman, ItemStack itemstack) {
|
||||
+ if (net.pl3x.purpur.event.inventory.AnvilTakeResultEvent.getHandlerList().getRegisteredListeners().length > 0) new net.pl3x.purpur.event.inventory.AnvilTakeResultEvent(entityhuman.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)).callEvent(); // Purpur
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ if (bypassCost) ((EntityPlayer) entityhuman).lastSentExp = -1; else // Purpur
|
||||
entityhuman.levelDown(-ContainerAnvil.this.levelCost.get());
|
||||
}
|
||||
|
||||
@@ -136,6 +141,12 @@ public class ContainerAnvil extends Container {
|
||||
@Override
|
||||
protected boolean b(EntityHuman entityhuman, boolean flag) {
|
||||
- return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= this.levelCost.get()) && this.levelCost.get() > 0;
|
||||
+ return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= this.levelCost.get()) && (bypassCost || this.levelCost.get() > 0); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack a(EntityHuman entityhuman, ItemStack itemstack) {
|
||||
+ if (net.pl3x.purpur.event.inventory.AnvilTakeResultEvent.getHandlerList().getRegisteredListeners().length > 0) new net.pl3x.purpur.event.inventory.AnvilTakeResultEvent(entityhuman.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)).callEvent(); // Purpur
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ if (bypassCost) ((EntityPlayer) entityhuman).lastSentExp = -1; else // Purpur
|
||||
entityhuman.levelDown(-this.levelCost.get());
|
||||
}
|
||||
|
||||
@@ -94,6 +98,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
@Override
|
||||
public void e() {
|
||||
+ // Purpur start
|
||||
+ bypassCost = false;
|
||||
@@ -58,7 +50,7 @@ index 286b930dd..d418c0441 100644
|
||||
ItemStack itemstack = this.repairInventory.getItem(0);
|
||||
|
||||
this.levelCost.set(1);
|
||||
@@ -212,7 +223,7 @@ public class ContainerAnvil extends Container {
|
||||
@@ -170,7 +180,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
int i2 = (Integer) map1.get(enchantment);
|
||||
|
||||
i2 = l1 == i2 ? i2 + 1 : Math.max(i2, l1);
|
||||
@@ -67,7 +59,7 @@ index 286b930dd..d418c0441 100644
|
||||
|
||||
if (this.player.abilities.canInstantlyBuild || itemstack.getItem() == Items.ENCHANTED_BOOK) {
|
||||
flag3 = true;
|
||||
@@ -224,7 +235,7 @@ public class ContainerAnvil extends Container {
|
||||
@@ -182,7 +192,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
Enchantment enchantment1 = (Enchantment) iterator1.next();
|
||||
|
||||
if (enchantment1 != enchantment && !enchantment.isCompatible(enchantment1)) {
|
||||
@@ -76,7 +68,7 @@ index 286b930dd..d418c0441 100644
|
||||
++i;
|
||||
}
|
||||
}
|
||||
@@ -295,6 +306,13 @@ public class ContainerAnvil extends Container {
|
||||
@@ -253,6 +263,13 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
this.levelCost.set(maximumRepairCost - 1); // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -88,9 +80,9 @@ index 286b930dd..d418c0441 100644
|
||||
+ // Purpur end
|
||||
+
|
||||
if (this.levelCost.get() >= maximumRepairCost && !this.player.abilities.canInstantlyBuild) { // CraftBukkit
|
||||
itemstack1 = ItemStack.a;
|
||||
itemstack1 = ItemStack.b;
|
||||
}
|
||||
@@ -316,6 +334,12 @@ public class ContainerAnvil extends Container {
|
||||
@@ -274,6 +291,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), itemstack1); // CraftBukkit
|
||||
this.c();
|
||||
@@ -103,14 +95,6 @@ index 286b930dd..d418c0441 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,6 +373,7 @@ public class ContainerAnvil extends Container {
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
if (i == 2) {
|
||||
+ if (net.pl3x.purpur.event.inventory.AnvilTakeResultEvent.getHandlerList().getRegisteredListeners().length > 0) new net.pl3x.purpur.event.inventory.AnvilTakeResultEvent(entityhuman.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)).callEvent(); // Purpur
|
||||
if (!this.a(itemstack1, 3, 39, true)) {
|
||||
return ItemStack.a;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
|
||||
index 9374c2706..d45f356be 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
|
||||
@@ -1,63 +1,60 @@
|
||||
From d24813dc8ea3cdfc744c0cf5c9a0e50e6e0ca301 Mon Sep 17 00:00:00 2001
|
||||
From c748533f4bbafc0c16603882168e2cbf46960287 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
|
||||
Subject: [PATCH] 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(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.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 5b0de0d9d..843f22260 100644
|
||||
index bf019043a..7925c8991 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
|
||||
@@ -58,6 +58,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
}, MemoryModuleType.MEETING_POINT, (entityvillager, villageplacetype) -> {
|
||||
return villageplacetype == VillagePlaceType.r;
|
||||
return villageplacetype == VillagePlaceType.s;
|
||||
});
|
||||
+ 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
|
||||
@@ -70,6 +71,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
this.getNavigation().d(true);
|
||||
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
|
||||
+ this.brainTickOffset = getRandom().nextInt(100); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -180,6 +182,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@Override
|
||||
@@ -166,6 +168,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
protected void mobTick() { mobTick(false); }
|
||||
protected void mobTick(boolean inactive) {
|
||||
// Paper end
|
||||
this.world.getMethodProfiler().enter("brain");
|
||||
this.world.getMethodProfiler().enter("villagerBrain");
|
||||
+ // Purpur start
|
||||
+ boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
+ if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick)
|
||||
+ // Purpur end
|
||||
if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
|
||||
this.world.getMethodProfiler().exit();
|
||||
if (!this.et() && this.bB > 0) {
|
||||
if (this.bM) {
|
||||
this.bM = false;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9c60855d6..f1ed653b3 100644
|
||||
index bd9b82dad..8f8e61442 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -737,10 +737,14 @@ public class PurpurWorldConfig {
|
||||
public boolean villagerRidable = false;
|
||||
public boolean villagerRidableInWater = false;
|
||||
public boolean villagerRequireShiftToMount = true;
|
||||
@@ -82,4 +82,11 @@ public class PurpurWorldConfig {
|
||||
playerSpawnInvulnerableTicks = getInt("gameplay-mechanics.player.spawn-invulnerable-ticks", playerSpawnInvulnerableTicks);
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
+
|
||||
+ 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);
|
||||
+ private void villagerSettings() {
|
||||
+ villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
+ villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
}
|
||||
|
||||
public boolean villagerTraderRidable = false;
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
From 6e1fb8864c1acffb17aa73a8d86d2090c574f2b1 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 | 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 687efa022..ead334607 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 {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Predicate<Entity> b = IEntitySelector.a.and(IEntitySelector.a(0.0D, 128.0D, 0.0D, 192.0D));
|
||||
public final BossBattleServer bossBattle;
|
||||
- public final WorldServer d; // CraftBukkit PAIL private -> public, rename world
|
||||
+ public final WorldServer d; public WorldServer getWorld() { return d; } // Purpur - OBFHELPER
|
||||
private final List<Integer> e;
|
||||
private final ShapeDetector f;
|
||||
private int g;
|
||||
@@ -358,7 +358,7 @@ public class EnderDragonBattle {
|
||||
this.bossBattle.setVisible(false);
|
||||
this.a(true);
|
||||
this.n();
|
||||
- if (!this.l) {
|
||||
+ 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 56b67c408..cc6f8563b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -206,11 +206,13 @@ public class PurpurWorldConfig {
|
||||
public boolean enderDragonRidableInWater = false;
|
||||
public boolean enderDragonRequireShiftToMount = true;
|
||||
public double enderDragonMaxY = 256D;
|
||||
+ public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
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.26.2
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
From ac25e2c7e75e91a4b246439af0fe5d213b369c34 Mon Sep 17 00:00:00 2001
|
||||
From 753e40b5abc1fde5f33910bd9b5a77898f44ea0d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 11 Oct 2019 00:17:39 -0500
|
||||
Subject: [PATCH] Alternative Keepalive Handling
|
||||
|
||||
---
|
||||
.../server/PacketPlayInKeepAlive.java | 1 +
|
||||
.../minecraft/server/PlayerConnection.java | 27 +++++++++++++++++++
|
||||
.../minecraft/server/PlayerConnection.java | 26 +++++++++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 5 ++++
|
||||
3 files changed, 33 insertions(+)
|
||||
3 files changed, 32 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayInKeepAlive.java b/src/main/java/net/minecraft/server/PacketPlayInKeepAlive.java
|
||||
index 8e93f1540..470f92c4f 100644
|
||||
@@ -22,7 +22,7 @@ index 8e93f1540..470f92c4f 100644
|
||||
return this.a;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 148beb1b6..82faee937 100644
|
||||
index 85016aa76..d2d96eacc 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -75,6 +75,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -55,13 +55,12 @@ index 148beb1b6..82faee937 100644
|
||||
if (this.isPendingPing()) {
|
||||
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
|
||||
PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info
|
||||
@@ -2683,6 +2699,17 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -2704,6 +2720,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
||||
@Override
|
||||
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.useAlternateKeepAlive) {
|
||||
+ PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, player.getWorldServer()); // This SHOULD be on the main thread...
|
||||
+ long id = packetplayinkeepalive.getId();
|
||||
+ if (keepAlives.size() > 0 && keepAlives.contains(id)) {
|
||||
+ int ping = (int) (SystemUtils.getMonotonicMillis() - id);
|
||||
@@ -74,10 +73,10 @@ index 148beb1b6..82faee937 100644
|
||||
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
|
||||
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 72ad9dce7..ed2a31277 100644
|
||||
index d8b826f6b..571917ffa 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -144,6 +144,11 @@ public class PurpurConfig {
|
||||
@@ -152,6 +152,11 @@ public class PurpurConfig {
|
||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
}
|
||||
|
||||
@@ -86,9 +85,9 @@ index 72ad9dce7..ed2a31277 100644
|
||||
+ useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
|
||||
+ }
|
||||
+
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
public static boolean barrelSixRows = false;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
From bc8027e2ac0110d889bc31b125cbff05b13b7e70 Mon Sep 17 00:00:00 2001
|
||||
From 836c6dcd9b9cb396daeec8ddd59834f431bf1275 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 | 34 +++++++++++++++++++
|
||||
.../net/minecraft/server/EntityTypes.java | 12 +++++++
|
||||
3 files changed, 47 insertions(+)
|
||||
.../net/minecraft/server/BlockMobSpawner.java | 35 +++++++++++++++++++
|
||||
.../net/minecraft/server/ItemSpawner.java | 23 ++++++++++++
|
||||
src/main/java/net/minecraft/server/Items.java | 2 +-
|
||||
4 files changed, 60 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index 66244a9d0..9c7faa2bd 100644
|
||||
index 81725611d..c7232047c 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -502,6 +502,7 @@ public class Block implements IMaterial {
|
||||
@@ -226,6 +226,7 @@ public class Block extends BlockBase implements IMaterial {
|
||||
iblockdata.dropNaturally(world, blockposition, itemstack);
|
||||
}
|
||||
|
||||
@@ -22,7 +24,7 @@ index 66244a9d0..9c7faa2bd 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 5296fdf16..69d04f6cb 100644
|
||||
index 16f9fb8e5..cf059e982 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 {
|
||||
@@ -66,47 +68,56 @@ index 5296fdf16..69d04f6cb 100644
|
||||
@Override
|
||||
public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
||||
super.dropNaturally(iblockdata, world, blockposition, itemstack);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index 5a7494947..8e8d392a1 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> {
|
||||
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_a.a(s));
|
||||
}
|
||||
@@ -23,6 +57,7 @@ public class BlockMobSpawner extends BlockTileEntity {
|
||||
|
||||
+ // Purpur start
|
||||
+ public static EntityTypes getFromKey(MinecraftKey key) {
|
||||
+ return IRegistry.ENTITY_TYPE.get(key);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
@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/ItemSpawner.java b/src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
new file mode 100644
|
||||
index 000000000..7dc68ffe9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
@@ -0,0 +1,23 @@
|
||||
+package net.minecraft.server;
|
||||
+
|
||||
public static MinecraftKey getName(EntityTypes<?> entitytypes) {
|
||||
return IRegistry.ENTITY_TYPE.getKey(entitytypes);
|
||||
}
|
||||
|
||||
+ public static Optional<EntityTypes<?>> getType(String name) { return a(name); } // Purpur - OBFHELPER
|
||||
public static Optional<EntityTypes<?>> a(String s) {
|
||||
return IRegistry.ENTITY_TYPE.getOptional(MinecraftKey.a(s));
|
||||
}
|
||||
@@ -263,6 +270,10 @@ public class EntityTypes<T extends Entity> {
|
||||
public String getName() {
|
||||
return IRegistry.ENTITY_TYPE.getKey(this).getKey();
|
||||
}
|
||||
+
|
||||
+ public String getTranslatedName() {
|
||||
+ return getNameComponent().getString();
|
||||
+public class ItemSpawner extends ItemBlock {
|
||||
+ public ItemSpawner(Block block, Info info) {
|
||||
+ super(block, info);
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
public String f() {
|
||||
@@ -273,6 +284,7 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bg;
|
||||
}
|
||||
|
||||
+ public IChatBaseComponent getNameComponent() { return g(); } // Purpur - OBFHELPER
|
||||
public IChatBaseComponent g() {
|
||||
if (this.bh == null) {
|
||||
this.bh = new ChatMessage(this.f(), new Object[0]);
|
||||
+
|
||||
+ @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 89a9eec99..619c40b27 100644
|
||||
--- a/src/main/java/net/minecraft/server/Items.java
|
||||
+++ b/src/main/java/net/minecraft/server/Items.java
|
||||
@@ -180,7 +180,7 @@ public class Items {
|
||||
public static final Item ct = a(Blocks.PURPUR_BLOCK, CreativeModeTab.b);
|
||||
public static final Item cu = a(Blocks.PURPUR_PILLAR, CreativeModeTab.b);
|
||||
public static final Item cv = a(Blocks.PURPUR_STAIRS, CreativeModeTab.b);
|
||||
- public static final Item cw = a(Blocks.SPAWNER);
|
||||
+ public static final Item cw = a(Blocks.SPAWNER, new ItemSpawner(Blocks.SPAWNER, new Item.Info().a(EnumItemRarity.EPIC))); // Purpur
|
||||
public static final Item cx = a(Blocks.OAK_STAIRS, CreativeModeTab.b);
|
||||
public static final Item cy = a(Blocks.CHEST, CreativeModeTab.c);
|
||||
public static final Item cz = a(Blocks.DIAMOND_ORE, CreativeModeTab.b);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From b9d6a9418690fed6b75e7f4ca46dcc7a9fa94200 Mon Sep 17 00:00:00 2001
|
||||
From 6bfbeb52d059e6241fbd31cb1c909fc4f4cd4e98 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 21 Feb 2020 17:04:51 -0600
|
||||
Subject: [PATCH] MC-125757 Fix - Always increment arrow despawn counter
|
||||
@@ -8,33 +8,30 @@ Subject: [PATCH] MC-125757 Fix - Always increment arrow despawn counter
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
index ae44f878f..4ab857853 100644
|
||||
index 6195a45e3..8ee76ca4b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
@@ -154,6 +154,8 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
@@ -124,11 +124,13 @@ public abstract class EntityArrow extends IProjectile {
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
+ this.checkDespawnCounter(); // Purpur - moved from below - MC-125757
|
||||
+
|
||||
if (this.inGround && !flag) {
|
||||
if (this.aq != iblockdata && this.world.a(this.getBoundingBox().g(0.06D))) {
|
||||
this.inGround = false;
|
||||
@@ -161,7 +163,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
this.despawnCounter = 0;
|
||||
this.as = 0;
|
||||
if (this.an != iblockdata && this.u()) {
|
||||
this.z();
|
||||
} else if (!this.world.isClientSide) {
|
||||
- this.i();
|
||||
+ // this.i(); // Purpur moved up - MC-125757
|
||||
- this.h();
|
||||
+ // this.h(); // Purpur - moved up MC-125757
|
||||
}
|
||||
|
||||
++this.d;
|
||||
@@ -282,6 +284,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
++this.c;
|
||||
@@ -254,6 +256,7 @@ public abstract class EntityArrow extends IProjectile {
|
||||
|
||||
}
|
||||
|
||||
+ protected void checkDespawnCounter() { i(); } // Purpur - OBFHELPER
|
||||
protected void i() {
|
||||
protected void h() {
|
||||
++this.despawnCounter;
|
||||
if (this.despawnCounter >= (fromPlayer == PickupStatus.CREATIVE_ONLY ? world.paperConfig.creativeArrowDespawnRate : (fromPlayer == PickupStatus.DISALLOWED ? world.paperConfig.nonPlayerArrowDespawnRate : ((this instanceof EntityThrownTrident) ? world.spigotConfig.tridentDespawnRate : world.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init?
|
||||
--
|
||||
@@ -1,4 +1,4 @@
|
||||
From c127ee26dc42f88155087b8dcdf7b61c067088ec Mon Sep 17 00:00:00 2001
|
||||
From 3cdc8d59eb0d60369650ba50ff81fb65b9f5ecc3 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] MC-168772 Fix - Add turtle egg block options
|
||||
@@ -9,14 +9,14 @@ Subject: [PATCH] MC-168772 Fix - Add turtle egg block options
|
||||
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
|
||||
index 553c8affa..92cca6c44 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 {
|
||||
@@ -163,6 +163,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);
|
||||
- return !(entity instanceof EntityTurtle) && !(entity instanceof EntityBat) ? (!(entity instanceof EntityLiving) ? false : entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) : false;
|
||||
+ // Purpur start - fix MC-168772
|
||||
+ if (entity instanceof EntityTurtle) {
|
||||
+ return false;
|
||||
@@ -38,11 +38,11 @@ index cb36334e4..aa83ef169 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 81969d2dc..296274896 100644
|
||||
index 8f8e61442..3367cfd47 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -191,6 +191,15 @@ public class PurpurWorldConfig {
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
@@ -83,6 +83,15 @@ public class PurpurWorldConfig {
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
+ public boolean turtleEggsBreakFromExpOrbs = true;
|
||||
@@ -54,9 +54,9 @@ index 81969d2dc..296274896 100644
|
||||
+ turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
+ }
|
||||
+
|
||||
public boolean boatEjectPlayersOnLand = false;
|
||||
public float armorstandStepHeight = 0.0F;
|
||||
public boolean controllableMinecarts = false;
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From fbb5d60cfb97f9a166ecea0361abdbcb72385ee7 Mon Sep 17 00:00:00 2001
|
||||
From eabe6232aad2e846f11e6082b5d9510ad3aa658c 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] MC-4 Fix - Item position desync
|
||||
@@ -6,28 +6,28 @@ Subject: [PATCH] MC-4 Fix - Item position desync
|
||||
---
|
||||
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 | 2 ++
|
||||
3 files changed, 10 insertions(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
3 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index adf7c9180..20d98c206 100644
|
||||
index f75c09d44..10cae053b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -132,6 +132,12 @@ public class EntityTrackerEntry {
|
||||
@@ -133,6 +133,12 @@ public class EntityTrackerEntry {
|
||||
double vec3d_dz = this.tracker.locZ() - 2.44140625E-4D*(this.zLoc);
|
||||
boolean flag1 = (vec3d_dx * vec3d_dx + vec3d_dy * vec3d_dy + vec3d_dz * vec3d_dz) >= 7.62939453125E-6D;
|
||||
// Paper end - reduce allocation of Vec3D here
|
||||
+ // Purpur start - fixes MC-4
|
||||
+ // Purpur start - fix MC-4
|
||||
+ if (net.pl3x.purpur.PurpurConfig.fixItemPositionDesync && this.tracker instanceof EntityItem) {
|
||||
+ Vec3D loc = PacketPlayOutEntity.decrypt(PacketPlayOutEntity.encrypt(tracker.locX()), PacketPlayOutEntity.encrypt(tracker.locY()), PacketPlayOutEntity.encrypt(tracker.locZ()));
|
||||
+ tracker.setPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ // Purpur end - fix MC-4
|
||||
Packet<?> packet1 = null;
|
||||
boolean flag2 = flag1 || this.tickCounter % 60 == 0;
|
||||
boolean flag3 = Math.abs(i - this.yRot) >= 1 || Math.abs(j - this.xRot) >= 1;
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
index 5b1d95935..0010448e3 100644
|
||||
index e5da2b19c..6d9d52e4f 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,20 +44,19 @@ index 5b1d95935..0010448e3 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 68bad6a13..ab88636ca 100644
|
||||
index 571917ffa..4ac6fa44b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -163,8 +163,10 @@ public class PurpurConfig {
|
||||
@@ -175,4 +175,9 @@ public class PurpurConfig {
|
||||
InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
+
|
||||
+ public static boolean fixItemPositionDesync = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
+ private static void fixItemPositionDesync() {
|
||||
+ fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
}
|
||||
|
||||
public static boolean barrelSixRows = false;
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 630e9dc4596781fdc3a496147184301aac82dd31 Mon Sep 17 00:00:00 2001
|
||||
From 7627086a8214c93b0a9c2e61981377aeb30553c1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 28 Mar 2020 01:51:32 -0500
|
||||
Subject: [PATCH] Fix vanilla command permission handler
|
||||
@@ -0,0 +1,54 @@
|
||||
From f6bc74d6d724638fe97b923a0caa06deced56b92 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/AdvancementDataPlayer.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 7 +++++++
|
||||
.../java/org/bukkit/craftbukkit/legacy/CraftLegacy.java | 1 +
|
||||
3 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
index 57b9d1344..c89e843e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
@@ -165,6 +165,7 @@ public class AdvancementDataPlayer {
|
||||
if (advancement == null) {
|
||||
// CraftBukkit start
|
||||
if (entry.getKey().getNamespace().equals("minecraft")) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressIgnoredAdvancementWarnings) // Purpur
|
||||
AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.f);
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 4ac6fa44b..b520cd28b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -180,4 +180,11 @@ public class PurpurConfig {
|
||||
private static void fixItemPositionDesync() {
|
||||
fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
}
|
||||
+
|
||||
+ public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||
+ public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
||||
+ private static void loggerSettings() {
|
||||
+ loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
+ loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index b14333ce9..d25204f7d 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.26.2
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
From 9b77d9886cde434034d95d1dd086971e27e85222 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] 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 ++++++++++++++
|
||||
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 685538793..aaaa98318 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2799,10 +2799,19 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
public boolean hasLineOfSight(Entity entity) {
|
||||
if (this.world != entity.world) return false; // CraftBukkit - SPIGOT-5675, SPIGOT-5798, MC-149563
|
||||
- Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ());
|
||||
- Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ());
|
||||
+ // Purpur start
|
||||
+ return hasLineOfSight(entity.locX(), entity.getHeadY(), entity.locZ());
|
||||
+ }
|
||||
+
|
||||
+ public boolean hasLineOfSight(TileEntity te) {
|
||||
+ 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 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 b56b021b4..fcc5a5c23 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
@@ -92,6 +92,7 @@ public class EntityPotion extends EntityProjectile {
|
||||
} else {
|
||||
this.a(list, movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY ? ((MovingObjectPositionEntity) movingobjectposition).getEntity() : null);
|
||||
}
|
||||
+ splashCampfires(list); // Purpur
|
||||
}
|
||||
|
||||
int i = potionregistry.b() ? 2007 : 2002;
|
||||
@@ -101,6 +102,31 @@ public class EntityPotion extends EntityProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ private void splashCampfires(List<MobEffect> list) {
|
||||
+ AxisAlignedBB aabb = getBoundingBox().grow(4.0D, 2.0D, 4.0D);
|
||||
+ for (int x = (int) aabb.minX; x <= aabb.maxX; x++) {
|
||||
+ for (int z = (int) aabb.minZ; z <= aabb.maxZ; z++) {
|
||||
+ for (int y = (int) aabb.minY; y <= aabb.maxY; y++) {
|
||||
+ BlockPosition pos = new BlockPosition(x, y, z);
|
||||
+ TileEntity te = world.getTileEntity(pos);
|
||||
+ if (te instanceof TileEntityCampfire) {
|
||||
+ 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.getX(), te.position.getY() + 1, te.position.getZ(), 1, 0.5, 0.5, 0.5, 0, true);
|
||||
+ }
|
||||
+ ((TileEntityCampfire) te).splashed = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
private void splash() {
|
||||
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..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
|
||||
private final NonNullList<ItemStack> items;
|
||||
public final int[] cookingTimes;
|
||||
public final int[] cookingTotalTimes;
|
||||
+ public boolean splashed = false; // Purpur
|
||||
|
||||
public TileEntityCampfire() {
|
||||
super(TileEntityTypes.CAMPFIRE);
|
||||
@@ -34,6 +35,27 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
|
||||
} else {
|
||||
if (flag) {
|
||||
+ // Purpur start
|
||||
+ if ((splashed || !world.purpurConfig.campfireRequireRegenPotion) && world.purpurConfig.campfireRegenInterval > 0 && world.getTime() % world.purpurConfig.campfireRegenInterval == 0L) {
|
||||
+ 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.getEntitiesByClass(EntityHuman.class, new AxisAlignedBB(position).grow(range)).forEach(entityhuman -> {
|
||||
+ boolean noLineOfSign = true;
|
||||
+ if (!signalBoost && world.purpurConfig.campfireRegenRequireLineOfSight) {
|
||||
+ noLineOfSign = false;
|
||||
+ }
|
||||
+ if (signalBoost && world.purpurConfig.campfireRegenBoostRequireLineOfSight) {
|
||||
+ noLineOfSign = false;
|
||||
+ }
|
||||
+ if (noLineOfSign || entityhuman.hasLineOfSight(this)) {
|
||||
+ entityhuman.addEffect(regeneration);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.h();
|
||||
} else {
|
||||
for (int i = 0; i < this.items.size(); ++i) {
|
||||
@@ -41,6 +63,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
this.cookingTimes[i] = MathHelper.clamp(this.cookingTimes[i] - 2, 0, this.cookingTotalTimes[i]);
|
||||
}
|
||||
}
|
||||
+ splashed = false; // Purpur
|
||||
}
|
||||
|
||||
}
|
||||
@@ -137,6 +160,12 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
System.arraycopy(aint, 0, this.cookingTotalTimes, 0, Math.min(this.cookingTotalTimes.length, aint.length));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (nbttagcompound.hasKey("Purpur.splashed")) {
|
||||
+ splashed = nbttagcompound.getBoolean("Purpur.splashed");
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,6 +173,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
this.d(nbttagcompound);
|
||||
nbttagcompound.setIntArray("CookingTimes", this.cookingTimes);
|
||||
nbttagcompound.setIntArray("CookingTotalTimes", this.cookingTotalTimes);
|
||||
+ nbttagcompound.setBoolean("Purpur.splashed", splashed); // Purpur
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 94744c78b..d8d95d787 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -71,6 +71,29 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
|
||||
+ public int campfireRegenInterval = 0;
|
||||
+ public int campfireRegenDuration = 80;
|
||||
+ public int campfireRegenRange = 5;
|
||||
+ public int campfireRegenAmp = 0;
|
||||
+ public boolean campfireRegenRequireLineOfSight = true;
|
||||
+ public int campfireRegenBoostDuration = 0;
|
||||
+ public int campfireRegenBoostRange = 10;
|
||||
+ public int campfireRegenBoostAmp = 1;
|
||||
+ public boolean campfireRegenBoostRequireLineOfSight = false;
|
||||
+ public boolean campfireRequireRegenPotion = true;
|
||||
+ 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.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2094c83c3f1ac0a54a44a83a97dd93640767160f Mon Sep 17 00:00:00 2001
|
||||
From 1926ac0f3c9733e80ebe5b761edc0b805bc59ed0 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,14 +8,14 @@ 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 77b9ce301..b007840a5 100644
|
||||
index 8879c6421..2434a5af8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -259,7 +259,7 @@ public class Main {
|
||||
@@ -252,7 +252,7 @@ public class Main {
|
||||
System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
|
||||
}
|
||||
|
||||
- if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||
- if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||
+ if (false) { // Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { // Purpur
|
||||
Date buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||
|
||||
200
patches/server/0035-Giants-AI-settings.patch
Normal file
200
patches/server/0035-Giants-AI-settings.patch
Normal file
@@ -0,0 +1,200 @@
|
||||
From 44ff3cae556ebd8727d61cfc675f6d482b69fed6 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||
Subject: [PATCH] Giants AI settings
|
||||
|
||||
---
|
||||
.../minecraft/server/AttributeMapBase.java | 4 +-
|
||||
.../java/net/minecraft/server/Entity.java | 2 +-
|
||||
.../minecraft/server/EntityGiantZombie.java | 63 ++++++++++++++++++-
|
||||
.../minecraft/server/EntityInsentient.java | 6 +-
|
||||
.../net/minecraft/server/EntityLiving.java | 2 +-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 17 +++++
|
||||
6 files changed, 87 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AttributeMapBase.java b/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
index c57e23e16..772079a27 100644
|
||||
--- a/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
@@ -41,8 +41,8 @@ public class AttributeMapBase {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- public AttributeModifiable a(AttributeBase attributebase) {
|
||||
+ @Nullable public AttributeModifiable getAttribute(AttributeBase attributebase) { return a(attributebase); } // Purpur - OBFHELPER
|
||||
+ @Nullable public AttributeModifiable a(AttributeBase attributebase) {
|
||||
return (AttributeModifiable) this.b.computeIfAbsent(attributebase, (attributebase1) -> {
|
||||
return this.d.a(this::a, attributebase1);
|
||||
});
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 3709f3386..ee36c537d 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -136,7 +136,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
public double D;
|
||||
public double E;
|
||||
public double F;
|
||||
- public float G;
|
||||
+ public float G; public void setStepHeight(float stepHeight) { this.G = stepHeight; } // Purpur - OBFHELPER
|
||||
public boolean noclip;
|
||||
public float I;
|
||||
protected final Random random;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index 37618126f..4b8edc8df 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -4,7 +4,10 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
- this.safeFallDistance = 10.0F; // Purpur
|
||||
+ // Purpur start
|
||||
+ this.safeFallDistance = 10.0F;
|
||||
+ setStepHeight(world.purpurConfig.giantStepHeight);
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -18,6 +21,62 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
@Override
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
- return iworldreader.y(blockposition) - 0.5F;
|
||||
+ return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initPathfinder() {
|
||||
+ if (world.purpurConfig.giantHaveAI) {
|
||||
+ this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
+ 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));
|
||||
+ if (world.purpurConfig.giantHaveHostileAI) {
|
||||
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ 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
|
||||
+ protected void initAttributes(World world) {
|
||||
+ if (world != null) {
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.giantMaxHealth);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.giantMovementSpeed);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.ATTACK_DAMAGE).setValue(world.purpurConfig.giantAttackDamage);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess world, DifficultyDamageScaler difficulty, EnumMobSpawn enummobspawn, GroupDataEntity groupDataEntity, NBTTagCompound nbt) {
|
||||
+ GroupDataEntity groupData = super.prepare(world, difficulty, enummobspawn, groupDataEntity, nbt);
|
||||
+ if (groupData == null) {
|
||||
+ setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ setEnchantmentBasedOnDifficulty(difficulty);
|
||||
+ }
|
||||
+ return groupData;
|
||||
+ }
|
||||
+
|
||||
+ @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));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float getJumpHeight() {
|
||||
+ // make giants jump as high as everything else relative to their size
|
||||
+ // 1.0 makes bottom of feet about as high as their waist when they jump
|
||||
+ return world.purpurConfig.giantJumpHeight;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 605bbf017..93714e5d9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -939,6 +939,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return f;
|
||||
}
|
||||
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { a(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void a(DifficultyDamageScaler difficultydamagescaler) {
|
||||
if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) {
|
||||
int i = this.random.nextInt(2);
|
||||
@@ -1046,6 +1047,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
+ protected void setEnchantmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { b(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void b(DifficultyDamageScaler difficultydamagescaler) {
|
||||
float f = difficultydamagescaler.d();
|
||||
|
||||
@@ -1078,10 +1080,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
} else {
|
||||
this.setLeftHanded(false);
|
||||
}
|
||||
-
|
||||
+ initAttributes(world.getMinecraftWorld()); // Purpur
|
||||
return groupdataentity;
|
||||
}
|
||||
|
||||
+ protected void initAttributes(World world) {} // Purpur
|
||||
+
|
||||
public boolean es() {
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index f917cd5df..03477c6e9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2150,7 +2150,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.enderTeleportTo(vec3d.x, vec3d.y, vec3d.z);
|
||||
}
|
||||
|
||||
- protected float dI() {
|
||||
+ protected float dI() { return getJumpHeight(); } public float getJumpHeight() { // Purpur - OBFHELPER
|
||||
return 0.42F * this.getBlockJumpFactor();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 3367cfd47..2db2dd26d 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -92,6 +92,23 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ 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 giantHaveAI = false;
|
||||
+ public boolean giantHaveHostileAI = false;
|
||||
+ private void giantSettings() {
|
||||
+ 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);
|
||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
From e95433c37c07dd0343e1336c9a49661974ddc28f 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 9c7faa2bd..97e553b38 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -395,7 +395,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 8c84431e5..a761b2c73 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 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);
|
||||
@@ -92,6 +93,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.26.2
|
||||
|
||||
55
patches/server/0036-Illusioners-AI-settings.patch
Normal file
55
patches/server/0036-Illusioners-AI-settings.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From 441173477d957d8b8af8f86d72cb50e22c99bfb8 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 AI settings
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityIllagerIllusioner.java | 11 +++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 9 +++++++++
|
||||
2 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
index 76fd0513f..1a5b9a0f0 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
@@ -40,6 +40,17 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
return EntityMonster.eS().a(GenericAttributes.MOVEMENT_SPEED, 0.5D).a(GenericAttributes.FOLLOW_RANGE, 18.0D).a(GenericAttributes.MAX_HEALTH, 32.0D);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initAttributes(World world) {
|
||||
+ if (world != null) {
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.illusionerMovementSpeed);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.FOLLOW_RANGE).setValue(world.purpurConfig.illusionerFollowRange);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.illusionerMaxHealth);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
||||
this.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.BOW));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 2db2dd26d..d79a7e242 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -109,6 +109,15 @@ public class PurpurWorldConfig {
|
||||
giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
}
|
||||
|
||||
+ public double illusionerMaxHealth = 32.0D;
|
||||
+ public double illusionerMovementSpeed = 0.5D;
|
||||
+ public double illusionerFollowRange = 18.0D;
|
||||
+ private void illusionerSettings() {
|
||||
+ illusionerMaxHealth = getDouble("mobs.illusioner.max-health", illusionerMaxHealth);
|
||||
+ illusionerMovementSpeed = getDouble("mobs.illusioner.movement-speed", illusionerMovementSpeed);
|
||||
+ illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
From dd79210dd48515873533b7a50d14eab5db537495 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 a761b2c73..d6405b2ec 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -82,6 +82,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);
|
||||
@@ -94,6 +95,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.26.2
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
From cae7ca5f7ee6a31f421a401abed8141b9037c9a3 Mon Sep 17 00:00:00 2001
|
||||
From 08672f6e86a74640abb8a9b29f440da692558a85 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 7 Jul 2019 19:52:16 -0500
|
||||
Subject: [PATCH] Zombie horse naturally spawn
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/WorldServer.java | 18 ++++++++++++------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 14 insertions(+), 6 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 17 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 24cd10c96..edf24791b 100644
|
||||
index 093fa8074..7955a079b 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1038,12 +1038,18 @@ public class WorldServer extends World {
|
||||
@@ -622,12 +622,18 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
|
||||
|
||||
if (flag1) {
|
||||
- EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this);
|
||||
-
|
||||
- entityhorseskeleton.r(true);
|
||||
- entityhorseskeleton.t(true);
|
||||
- entityhorseskeleton.setAgeRaw(0);
|
||||
- entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
- this.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
@@ -36,23 +36,21 @@ index 24cd10c96..edf24791b 100644
|
||||
+ // 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
|
||||
EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a((World) this);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 96a66926f..4c7469b90 100644
|
||||
index d79a7e242..3dad7bded 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -657,9 +657,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);
|
||||
@@ -124,4 +124,9 @@ public class PurpurWorldConfig {
|
||||
villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
}
|
||||
|
||||
public boolean zombiePigmanRidable = false;
|
||||
+
|
||||
+ public double zombieHorseSpawnChance = 0.0D;
|
||||
+ private void zombieHorseSettings() {
|
||||
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
From 2de0a875233bb6be5ed54394ac9cba44a7b32764 Mon Sep 17 00:00:00 2001
|
||||
From 4e0bfa3879efb2558a9e2139c4fd0f5554b59a45 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(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
index 48fd8e716..ce366f401 100644
|
||||
index 5e7f3af37..ec5287fa5 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);
|
||||
@@ -275,4 +275,15 @@ public class EntityCreeper extends EntityMonster {
|
||||
public void setCausedHeadDrop() {
|
||||
++this.bz;
|
||||
}
|
||||
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, GroupDataEntity groupdataentity, NBTTagCompound nbttagcompound) {
|
||||
@@ -26,27 +27,23 @@ index 48fd8e716..ce366f401 100644
|
||||
+ 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 4c7469b90..bbae44ddb 100644
|
||||
index 3dad7bded..d9c4ffbe8 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -148,10 +148,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);
|
||||
@@ -92,6 +92,11 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
public boolean dolphinRidable = false;
|
||||
+ public double creeperChargedChance = 0.0D;
|
||||
+ private void creeperSettings() {
|
||||
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
+ }
|
||||
+
|
||||
public float giantStepHeight = 2.0F;
|
||||
public float giantJumpHeight = 1.0F;
|
||||
public double giantMaxHealth = 100.0D;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
From aeb5f32f4179df8b3e0eace094ed06a31e65b87c Mon Sep 17 00:00:00 2001
|
||||
From 65ded2f0ce2ede0d1b623971d998474e1b52c791 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(+)
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
|
||||
2 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
index 9040ab1c5..0232226f0 100644
|
||||
index 00c9233f8..1be0f943b 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 {
|
||||
@@ -297,6 +297,10 @@ public class EntityRabbit extends EntityAnimal {
|
||||
if (!this.hasCustomName()) {
|
||||
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bx), new Object[0]));
|
||||
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bw)));
|
||||
}
|
||||
+ // Purpur start
|
||||
+ } else if (i == 98) {
|
||||
@@ -22,8 +22,8 @@ index 9040ab1c5..0232226f0 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
this.datawatcher.set(EntityRabbit.bw, i);
|
||||
@@ -385,6 +389,16 @@ public class EntityRabbit extends EntityAnimal {
|
||||
this.datawatcher.set(EntityRabbit.bv, i);
|
||||
@@ -318,6 +322,16 @@ public class EntityRabbit extends EntityAnimal {
|
||||
}
|
||||
|
||||
private int a(GeneratorAccess generatoraccess) {
|
||||
@@ -36,29 +36,28 @@ index 9040ab1c5..0232226f0 100644
|
||||
+ return 98;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
BiomeBase biomebase = generatoraccess.getBiome(new BlockPosition(this));
|
||||
+
|
||||
BiomeBase biomebase = generatoraccess.getBiome(this.getChunkCoordinates());
|
||||
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 bbae44ddb..4aaf75fcf 100644
|
||||
index d9c4ffbe8..9e144a369 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -440,10 +440,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);
|
||||
@@ -123,6 +123,13 @@ public class PurpurWorldConfig {
|
||||
illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
}
|
||||
|
||||
public boolean ravagerRidable = false;
|
||||
+ public double rabbitNaturalToast = 0.0D;
|
||||
+ public double rabbitNaturalKiller = 0.0D;
|
||||
+ private void rabbitSettings() {
|
||||
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
||||
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 8dc9cf85d82ebcfb89d97fb0bd172bb58794b9d4 Mon Sep 17 00:00:00 2001
|
||||
From d465dcaf5f07f171e1293db0e0066c7120d7fe19 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 4bb21c48b..30f16db02 100644
|
||||
index da804a990..6b32bc233 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 {
|
||||
@@ -1,42 +1,41 @@
|
||||
From 2379deeae65cfb447a5c515621504e1092df675f Mon Sep 17 00:00:00 2001
|
||||
From a74080199c03418349b2f1857905c2349fce12c4 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(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.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 288a043fb..0cc3b8eb0 100644
|
||||
index e38a675be..ab0731c2a 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 {
|
||||
@@ -24,6 +24,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable {
|
||||
|
||||
@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));
|
||||
this.goalSelector.a(2, new PathfinderGoalStrollVillage(this, 0.6D, false));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f098a36b5..a07781929 100644
|
||||
index 9e144a369..c89d2221b 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);
|
||||
@@ -123,6 +123,11 @@ public class PurpurWorldConfig {
|
||||
illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
}
|
||||
|
||||
public boolean llamaRidable = false;
|
||||
+ public boolean ironGolemCanSwim = false;
|
||||
+ private void ironGolemSettings() {
|
||||
+ ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
+ }
|
||||
+
|
||||
public double rabbitNaturalToast = 0.0D;
|
||||
public double rabbitNaturalKiller = 0.0D;
|
||||
private void rabbitSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 610bf17eeaba736705cb6223e21e9f03327de3b3 Mon Sep 17 00:00:00 2001
|
||||
From 2e265fe093ff3fefc0579df66571791c61b4e0e4 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,10 +10,10 @@ 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 1bd703848..adf7c9180 100644
|
||||
index 10cae053b..509df9bab 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -170,6 +170,7 @@ public class EntityTrackerEntry {
|
||||
@@ -177,6 +177,7 @@ public class EntityTrackerEntry {
|
||||
this.o = 0;
|
||||
packet1 = new PacketPlayOutEntityTeleport(this.tracker);
|
||||
}
|
||||
@@ -21,7 +21,7 @@ index 1bd703848..adf7c9180 100644
|
||||
}
|
||||
|
||||
if ((this.e || this.tracker.impulse || this.tracker instanceof EntityLiving && ((EntityLiving) this.tracker).isGliding()) && this.tickCounter > 0) {
|
||||
@@ -256,6 +257,22 @@ public class EntityTrackerEntry {
|
||||
@@ -263,6 +264,22 @@ public class EntityTrackerEntry {
|
||||
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ index 1bd703848..adf7c9180 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 e5da2b19c..5b1d95935 100644
|
||||
index 6d9d52e4f..0010448e3 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,11 +66,11 @@ index e5da2b19c..5b1d95935 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 d6f82d119..d3e1c8c40 100644
|
||||
index b520cd28b..e8a0438ec 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -139,6 +139,11 @@ public class PurpurConfig {
|
||||
loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
@@ -176,6 +176,11 @@ public class PurpurConfig {
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
|
||||
+ public static boolean dontSendUselessEntityPackets = false;
|
||||
@@ -78,9 +78,9 @@ index d6f82d119..d3e1c8c40 100644
|
||||
+ dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
+ }
|
||||
+
|
||||
private static void timingsSettings() {
|
||||
getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
}
|
||||
public static boolean fixItemPositionDesync = false;
|
||||
private static void fixItemPositionDesync() {
|
||||
fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
From 5b624aa8deb3cfbba28a2f8dbee3ac28b61afad6 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 | 33 +++++++++++++++++--
|
||||
src/main/java/net/minecraft/server/Items.java | 4 +--
|
||||
.../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 4f53090d3..13afd7bcd 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFox.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
@@ -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(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);
|
||||
@@ -277,6 +282,7 @@ public class EntityFox extends EntityAnimal {
|
||||
|
||||
public void setFoxType(EntityFox.Type entityfox_type) {
|
||||
this.datawatcher.set(EntityFox.bw, entityfox_type.c());
|
||||
+ initializePathFinderGoals(); // Purpur - fix API bug not updating pathfinders on type change
|
||||
}
|
||||
|
||||
private List<UUID> eE() {
|
||||
@@ -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.whiteTulip()) {
|
||||
+ setFoxType(Type.SNOW);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ } else if (getFoxType() == Type.SNOW && itemstack.getItem() == Items.orangeTulip()) {
|
||||
+ setFoxType(Type.RED);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return super.a(entityhuman, enumhand);
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
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 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 {
|
||||
public static final Item aX = a(Blocks.ALLIUM, CreativeModeTab.c);
|
||||
public static final Item aY = a(Blocks.AZURE_BLUET, CreativeModeTab.c);
|
||||
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 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 b76a8c5be..a2fce0c63 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -335,10 +335,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 ghastRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
From 48d14d7c57478a6af1c85d20a59ebef69b43ec9e 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] Pillager limits and leaders chance
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/ChunkProviderGenerate.java | 1 +
|
||||
.../java/net/minecraft/server/EntityMonsterPatrolling.java | 7 ++++++-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 6 ++++++
|
||||
3 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||
index 70f43c515..fa08b8e1a 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
|
||||
}
|
||||
} else if (enumcreaturetype == EnumCreatureType.MONSTER) {
|
||||
if (WorldGenerator.PILLAGER_OUTPOST.a(this.a, blockposition)) {
|
||||
+ if (getWorld().purpurConfig.pillagerLimitOutpostSpawns <= 0 || getWorld().getEntitiesByClass(EntityPillager.class, new AxisAlignedBB(blockposition).grow(128)).size() < getWorld().purpurConfig.pillagerLimitOutpostSpawns) // Purpur
|
||||
return WorldGenerator.PILLAGER_OUTPOST.e();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMonsterPatrolling.java b/src/main/java/net/minecraft/server/EntityMonsterPatrolling.java
|
||||
index f44334b9e..70559714a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMonsterPatrolling.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMonsterPatrolling.java
|
||||
@@ -49,6 +49,7 @@ public abstract class EntityMonsterPatrolling extends EntityMonster {
|
||||
return -0.45D;
|
||||
}
|
||||
|
||||
+ public boolean canBeLeader() { return this.es(); } // Purpur
|
||||
public boolean es() {
|
||||
return true;
|
||||
}
|
||||
@@ -56,7 +57,11 @@ public abstract class EntityMonsterPatrolling extends EntityMonster {
|
||||
@Nullable
|
||||
@Override
|
||||
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
||||
- if (enummobspawn != EnumMobSpawn.PATROL && enummobspawn != EnumMobSpawn.EVENT && enummobspawn != EnumMobSpawn.STRUCTURE && this.random.nextFloat() < 0.06F && this.es()) {
|
||||
+ // Purpur start
|
||||
+ World world = generatoraccess.getMinecraftWorld();
|
||||
+ if (this.canBeLeader() && enummobspawn != EnumMobSpawn.PATROL && enummobspawn != EnumMobSpawn.EVENT && enummobspawn != EnumMobSpawn.STRUCTURE && this.random.nextFloat() < world.purpurConfig.pillagerLeaderChance) {
|
||||
+ if (world.purpurConfig.pillagerLeaderRangeCheck <= 0 || (this instanceof EntityPillager && world.getEntitiesByClass(EntityPillager.class, new AxisAlignedBB(new BlockPosition(this)).grow(world.purpurConfig.pillagerLeaderRangeCheck)).size() == 0))
|
||||
+ // Purpur end
|
||||
this.patrolLeader = true;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index a2fce0c63..299b080c8 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -525,10 +525,16 @@ public class PurpurWorldConfig {
|
||||
public boolean pillagerRidable = false;
|
||||
public boolean pillagerRidableInWater = false;
|
||||
public boolean pillagerRequireShiftToMount = true;
|
||||
+ public int pillagerLimitOutpostSpawns = 0;
|
||||
+ public float pillagerLeaderChance = 0.06F;
|
||||
+ public int pillagerLeaderRangeCheck = 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);
|
||||
+ pillagerLeaderChance = (float) getDouble("mobs.pillager.leader.chance", pillagerLeaderChance);
|
||||
+ pillagerLeaderRangeCheck = getInt("mobs.pillager.leader.range-check-for-other-leaders", pillagerLeaderRangeCheck);
|
||||
}
|
||||
|
||||
public boolean polarBearRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
110
patches/server/0043-Tulips-change-fox-type.patch
Normal file
110
patches/server/0043-Tulips-change-fox-type.patch
Normal file
@@ -0,0 +1,110 @@
|
||||
From d544c399255148396c6f85f93a1dc42826115de5 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 | 33 +++++++++++++++++--
|
||||
src/main/java/net/minecraft/server/Items.java | 4 +--
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++
|
||||
3 files changed, 37 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
index e6275a9fe..90b01adbe 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFox.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
@@ -37,9 +37,9 @@ public class EntityFox extends EntityAnimal {
|
||||
private static final Predicate<Entity> bC = (entity) -> {
|
||||
return !entity.bt() && IEntitySelector.e.test(entity);
|
||||
};
|
||||
- private PathfinderGoal bD;
|
||||
- private PathfinderGoal bE;
|
||||
- private PathfinderGoal bF;
|
||||
+ private PathfinderGoal bD; private PathfinderGoal attackAnimalGoal() { return bD; } // Purpur - OBFHELPER
|
||||
+ private PathfinderGoal bE; private PathfinderGoal attackTurtleGoal() { return bE; } // Purpur - OBFHELPER
|
||||
+ private PathfinderGoal bF; private PathfinderGoal attackFishGoal() { return bF; } // Purpur - OBFHELPER
|
||||
private float bG;
|
||||
private float bH;
|
||||
private float bI;
|
||||
@@ -227,6 +227,11 @@ public class EntityFox extends EntityAnimal {
|
||||
}
|
||||
|
||||
private void initializePathFinderGoals() {
|
||||
+ // Purpur start - do not add duplicate goals
|
||||
+ 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.bD);
|
||||
this.targetSelector.a(4, this.bE);
|
||||
@@ -259,6 +264,7 @@ public class EntityFox extends EntityAnimal {
|
||||
|
||||
public void setFoxType(EntityFox.Type entityfox_type) {
|
||||
this.datawatcher.set(EntityFox.bv, entityfox_type.c());
|
||||
+ initializePathFinderGoals(); // Purpur - fix API bug not updating pathfinders on type change
|
||||
}
|
||||
|
||||
private List<UUID> fb() {
|
||||
@@ -575,6 +581,27 @@ public class EntityFox extends EntityAnimal {
|
||||
return this.fb().contains(uuid);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
+ if (world.purpurConfig.foxTypeChangesWithTulips) {
|
||||
+ ItemStack itemstack = entityhuman.b(enumhand);
|
||||
+ if (getFoxType() == Type.RED && itemstack.getItem() == Items.whiteTulip()) {
|
||||
+ setFoxType(Type.SNOW);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ } else if (getFoxType() == Type.SNOW && itemstack.getItem() == Items.orangeTulip()) {
|
||||
+ setFoxType(Type.RED);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ }
|
||||
+ return super.b(entityhuman, enumhand);
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { // Paper
|
||||
ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND).cloneItemStack(); // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java
|
||||
index 619c40b27..b5305eaa9 100644
|
||||
--- a/src/main/java/net/minecraft/server/Items.java
|
||||
+++ b/src/main/java/net/minecraft/server/Items.java
|
||||
@@ -119,8 +119,8 @@ public class Items {
|
||||
public static final Item bk = a(Blocks.ALLIUM, CreativeModeTab.c);
|
||||
public static final Item bl = a(Blocks.AZURE_BLUET, CreativeModeTab.c);
|
||||
public static final Item bm = a(Blocks.RED_TULIP, CreativeModeTab.c);
|
||||
- public static final Item bn = a(Blocks.ORANGE_TULIP, CreativeModeTab.c);
|
||||
- public static final Item bo = a(Blocks.WHITE_TULIP, CreativeModeTab.c);
|
||||
+ public static final Item bn = a(Blocks.ORANGE_TULIP, CreativeModeTab.c); public static Item orangeTulip() { return bn; } // Purpur - OBFHELPER
|
||||
+ public static final Item bo = a(Blocks.WHITE_TULIP, CreativeModeTab.c); public static Item whiteTulip() { return bo; } // Purpur - OBFHELPER
|
||||
public static final Item bp = a(Blocks.PINK_TULIP, CreativeModeTab.c);
|
||||
public static final Item bq = a(Blocks.OXEYE_DAISY, CreativeModeTab.c);
|
||||
public static final Item br = 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 c89d2221b..8d620b4ef 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -97,6 +97,11 @@ public class PurpurWorldConfig {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
+ public boolean foxTypeChangesWithTulips = false;
|
||||
+ private void foxSettings() {
|
||||
+ foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
+ }
|
||||
+
|
||||
public float giantStepHeight = 2.0F;
|
||||
public float giantJumpHeight = 1.0F;
|
||||
public double giantMaxHealth = 100.0D;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
From 1ee64e547cf37152de6744d3774470e7a29f945e Mon Sep 17 00:00:00 2001
|
||||
From de732dfe84607cb98f4cda698738c786db24a793 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Mar 2020 19:46:44 -0500
|
||||
Subject: [PATCH] Breedable Polar Bears
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityPolarBear.java | 30 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 ++++
|
||||
2 files changed, 34 insertions(+), 1 deletion(-)
|
||||
.../net/minecraft/server/EntityPolarBear.java | 34 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 12 +++++++
|
||||
2 files changed, 45 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java
|
||||
index 0a3906bde..42fef3aba 100644
|
||||
index 69e5c1aed..6506e0055 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPolarBear.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java
|
||||
@@ -32,6 +32,28 @@ public class EntityPolarBear extends EntityAnimal {
|
||||
public boolean requireShiftToMount() {
|
||||
return world.purpurConfig.polarBearRequireShiftToMount;
|
||||
@@ -28,15 +28,45 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable {
|
||||
|
||||
@Override
|
||||
public boolean k(ItemStack itemstack) {
|
||||
- return false;
|
||||
+ return world.purpurConfig.polarBearBreedableItem != null && itemstack.getItem() == world.purpurConfig.polarBearBreedableItem; // Purpur;
|
||||
}
|
||||
+
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean mate(EntityAnimal entityanimal) {
|
||||
+ if (entityanimal == this) {
|
||||
@@ -38,20 +42,12 @@ index 0a3906bde..42fef3aba 100644
|
||||
+ return this.isInLove() && polarbear.isInLove();
|
||||
+ }
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
@@ -41,7 +63,7 @@ public class EntityPolarBear extends EntityAnimal {
|
||||
|
||||
@Override
|
||||
public boolean i(ItemStack itemstack) {
|
||||
- return false;
|
||||
+ return world.purpurConfig.polarBearBreedableItem != null && itemstack.getItem() == world.purpurConfig.polarBearBreedableItem; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,6 +73,12 @@ public class EntityPolarBear extends EntityAnimal {
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
protected void initPathfinder() {
|
||||
super.initPathfinder();
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(1, new EntityPolarBear.c());
|
||||
this.goalSelector.a(1, new EntityPolarBear.d());
|
||||
+ // Purpur start
|
||||
@@ -63,26 +59,49 @@ index 0a3906bde..42fef3aba 100644
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 1.0D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
@@ -178,10 +208,12 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable {
|
||||
return flag;
|
||||
}
|
||||
|
||||
+ public boolean isStanding() { return eN(); } // Purpur - OBFHELPER
|
||||
public boolean eN() {
|
||||
return (Boolean) this.datawatcher.get(EntityPolarBear.bv);
|
||||
}
|
||||
|
||||
+ public void setStanding(boolean standing) { t(standing); } // Purpur - OBFHELPER
|
||||
public void t(boolean flag) {
|
||||
this.datawatcher.set(EntityPolarBear.bv, flag);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 01b8fffe1..ced9edf82 100644
|
||||
index 8d620b4ef..12e263d21 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -666,10 +666,15 @@ public class PurpurWorldConfig {
|
||||
public boolean polarBearRidable = false;
|
||||
public boolean polarBearRidableInWater = false;
|
||||
public boolean polarBearRequireShiftToMount = true;
|
||||
@@ -1,6 +1,10 @@
|
||||
package net.pl3x.purpur;
|
||||
|
||||
import com.destroystokyo.paper.PaperWorldConfig;
|
||||
+import net.minecraft.server.IRegistry;
|
||||
+import net.minecraft.server.Item;
|
||||
+import net.minecraft.server.Items;
|
||||
+import net.minecraft.server.MinecraftKey;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.spigotmc.SpigotWorldConfig;
|
||||
|
||||
@@ -133,6 +137,14 @@ public class PurpurWorldConfig {
|
||||
ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
}
|
||||
|
||||
+ public String polarBearBreedableItemString = "";
|
||||
+ public Item polarBearBreedableItem = null;
|
||||
private void polarBearSettings() {
|
||||
polarBearRidable = getBoolean("mobs.polar_bear.ridable", polarBearRidable);
|
||||
polarBearRidableInWater = getBoolean("mobs.polar_bear.ridable-in-water", polarBearRidableInWater);
|
||||
polarBearRequireShiftToMount = getBoolean("mobs.polar_bear.require-shift-to-mount", polarBearRequireShiftToMount);
|
||||
+ private void polarBearSettings() {
|
||||
+ polarBearBreedableItemString = getString("mobs.polar_bear.breedable-item", polarBearBreedableItemString);
|
||||
+ Item item = IRegistry.ITEM.get(new MinecraftKey(polarBearBreedableItemString));
|
||||
+ if (item != Items.AIR) polarBearBreedableItem = item;
|
||||
}
|
||||
|
||||
public boolean pufferfishRidable = false;
|
||||
+ }
|
||||
+
|
||||
public double rabbitNaturalToast = 0.0D;
|
||||
public double rabbitNaturalKiller = 0.0D;
|
||||
private void rabbitSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user