Files
MiraiMC/patches/api/0005-Slice-Patches.patch
Etil 6d4e96dd1a Add Pufferfish patches
It includes async mob spawning (up to 15% improvement)
2021-11-13 16:53:43 +01:00

75 lines
3.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Etil <81570777+etil2jz@users.noreply.github.com>
Date: Fri, 12 Nov 2021 17:53:59 +0100
Subject: [PATCH] Slice Patches
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 4f673e9123145dc78564dc3eef0edf75795dafc2..13a387086bb30b316eb4e761dd4383cdd500e363 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2605,6 +2605,11 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* false
*/
public void setAutoSave(boolean value);
+
+ // Slice start
+ public boolean isInstance();
+ public void setInstance(boolean value);
+ // Slice end
/**
* Sets the Difficulty of the world.
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
index d5b39fb4fc16a342b5661e08df1506858168d20d..7e7a22aeacf007d08b691c3f5e0101df08d22002 100644
--- a/src/main/java/org/bukkit/scoreboard/Team.java
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
@@ -1,5 +1,6 @@
package org.bukkit.scoreboard;
+import java.util.Collection; // Slice
import java.util.Set;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
@@ -316,6 +317,20 @@ public interface Team {
* @throws IllegalStateException if this team has been unregistered
*/
void addEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentException;
+
+ // Slice start
+ /**
+ * This puts a collection of entries onto this team for the scoreboard which results in one
+ * packet for the updates rather than a packet-per-entry.
+ * <p>
+ * Entries on other teams will be removed from their respective teams.
+ *
+ * @param entries the entries to add
+ * @throws IllegalArgumentException if entries are null
+ * @throws IllegalStateException if this team has been unregistered
+ */
+ void addEntries(@NotNull Collection<String> entries) throws IllegalStateException, IllegalArgumentException;
+ // Slice end
/**
* Removes the player from this team.
@@ -339,6 +354,19 @@ public interface Team {
* @throws IllegalStateException if this team has been unregistered
*/
boolean removeEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentException;
+
+ // Slice start
+ /**
+ * Removes a collection of entries from this team which results in one
+ * packet for the updates rather than a packet-per-entry.
+ *
+ * @param entries the entries to remove
+ * @return if any of the entries were a part of this team
+ * @throws IllegalArgumentException if entry is null
+ * @throws IllegalStateException if this team has been unregistered
+ */
+ boolean removeEntries(@NotNull Collection<String> entries) throws IllegalStateException, IllegalArgumentException;
+ // Slice end
/**
* Unregisters this team from the Scoreboard