This repository has been archived by the owner on Jun 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Upstream and Sidestream(s) (Paper/Purpur) (#404)
* Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 088fa6f28 [Auto] Updated Upstream (Bukkit/CraftBukkit/Spigot) Purpur Changes: a8c9e3d Add unsafe Entity serialization API (#139) 631520c Add ender crystal explosion options (#168) 3880ddf Config to always tame in Creative (#166) 9ae031c Updated Upstream (Paper) 006e47f Fix #167 `persistent-droppable-entity-display-names` renames lead on named mobs ec81b87 Update Gradle to 6.8.2 * Updated Upstream and Sidestream(s) (Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Purpur Changes: b15a2e9 Add ghast allow-griefing option * Updated Upstream and Sidestream(s) (Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Purpur Changes: 9537c77 Add phantom allow-griefing option
- Loading branch information
1 parent
f295cbb
commit 9f3986a
Showing
85 changed files
with
964 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Paper
updated
36 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
patches/Purpur/patches/api/0037-Add-unsafe-Entity-serialization-API.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Mariell Hoversholm <[email protected]> | ||
Date: Sat, 9 Jan 2021 21:21:27 +0100 | ||
Subject: [PATCH] Add unsafe Entity serialization API | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java | ||
index 97b9ade0e771eae663fb42f91e15545034d58fc9..0c9d3c8a28a791fe26bb1c014b568e955eca0e8f 100644 | ||
--- a/src/main/java/org/bukkit/UnsafeValues.java | ||
+++ b/src/main/java/org/bukkit/UnsafeValues.java | ||
@@ -135,4 +135,28 @@ public interface UnsafeValues { | ||
public int nextEntityId(); | ||
|
||
// Paper end | ||
+ | ||
+ // Purpur start | ||
+ | ||
+ /** | ||
+ * Serialize entity to byte array | ||
+ * | ||
+ * @param entity entity to serialize | ||
+ * @return serialized entity | ||
+ */ | ||
+ byte[] serializeEntity(org.bukkit.entity.Entity entity); | ||
+ | ||
+ /** | ||
+ * Deserialize an entity from byte array | ||
+ * <p> | ||
+ * The entity is not automatically spawned in the world. You will have to spawn | ||
+ * the entity yourself with {@link org.bukkit.entity.Entity#spawnAt(Location)} or | ||
+ * {@link org.bukkit.entity.Entity#spawnAt(Location, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason)} | ||
+ * | ||
+ * @param data serialized entity | ||
+ * @param world world entity belongs in | ||
+ * @return deserialized entity | ||
+ */ | ||
+ org.bukkit.entity.Entity deserializeEntity(byte[] data, org.bukkit.World world); | ||
+ // Purpur end | ||
} | ||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java | ||
index 08dbe8208fad174f03a0e08c26bb48a0729ec0ce..2b7e8c7f24b2d9dd49db901f6279b8b5930a3006 100644 | ||
--- a/src/main/java/org/bukkit/entity/Entity.java | ||
+++ b/src/main/java/org/bukkit/entity/Entity.java | ||
@@ -745,5 +745,24 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent | ||
* @return True if ridable in water | ||
*/ | ||
boolean isRidableInWater(); | ||
+ | ||
+ /** | ||
+ * Spawn this entity in the world at the given {@link Location} with the default spawn reason. | ||
+ * | ||
+ * @param location The location at which to spawn the entity. | ||
+ * @return Whether the entity was successfully spawned. | ||
+ */ | ||
+ default boolean spawnAt(@NotNull Location location) { | ||
+ return spawnAt(location, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Spawn this entity in the world at the given {@link Location} with the reason given. | ||
+ * | ||
+ * @param location The location at which to spawn the entity. | ||
+ * @param spawnReason The reason for which the entity was spawned. | ||
+ * @return Whether the entity was successfully spawned. | ||
+ */ | ||
+ boolean spawnAt(@NotNull Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason); | ||
// Purpur end | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.