Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Oct 2, 2024
1 parent 40d189f commit 8c40f73
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 67 deletions.
4 changes: 2 additions & 2 deletions patches/api/0005-SPARKLYPOWER-Add-custom-blocks.patch
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ index be212b4fbeabab32a4dab6ae554768c368efaa88..fc885e551b1e8393569ec1391ee3decd

/**
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 54704da43cf9c429f3914f0580246dde99aa93c0..04ba1fa0eea60a8f01c89942cc8f3f8250192a72 100644
index de469f32dd9a01e0e2fde016044a783dde0c5b98..ea13aabe6e8cdf07698f96dc5264531e8a254529 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -3676,6 +3676,22 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -3678,6 +3678,22 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
BIG_DRIPLEAF_STEM(13167, Dripleaf.class),
POTTED_AZALEA_BUSH(20430),
POTTED_FLOWERING_AZALEA_BUSH(10609),
Expand Down
15 changes: 8 additions & 7 deletions patches/server/0003-Rewrite-framed-map-tracker-ticking.patch
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ index 5b7245cd99593ee90e17c97e0104f3aba9ae05ea..03432d084f8ed0cb7716d612b35f7409
itemstack.consume(1, player);
}
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 17f33c83c6033564d6bf4fbd388b0b847c68adb3..6bcb565cd60b60be9255ef537591ee821caab7b5 100644
index 6794466051dd4b725d579b2136c37844995a648e..95b2078d24c83e56760bc8be404df603a15b37c5 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -80,6 +80,16 @@ public class MapItemSavedData extends SavedData {
Expand All @@ -122,23 +122,24 @@ index 17f33c83c6033564d6bf4fbd388b0b847c68adb3..6bcb565cd60b60be9255ef537591ee82

// CraftBukkit start
public final CraftMapView mapView;
@@ -352,6 +362,7 @@ public class MapItemSavedData extends SavedData {
@@ -351,7 +361,7 @@ public class MapItemSavedData extends SavedData {
--this.trackedDecorationCount;
}

this.setDecorationsDirty();
- if (mapicon != null) this.setDecorationsDirty(); // Paper - only mark dirty if a change occurs
+ if (mapicon != null && mapicon.renderOnFrame()) this.dirtyFrameDecorations = true; // Paper
}

public static void addTargetDecoration(ItemStack stack, BlockPos pos, String id, Holder<MapDecorationType> decorationType) {
@@ -433,6 +444,7 @@ public class MapItemSavedData extends SavedData {
@@ -433,6 +443,7 @@ public class MapItemSavedData extends SavedData {
}

this.setDecorationsDirty();
+ if (mapicon.renderOnFrame()) this.dirtyFrameDecorations = true; // Paper
}

}
@@ -446,6 +458,20 @@ public class MapItemSavedData extends SavedData {
@@ -446,6 +457,20 @@ public class MapItemSavedData extends SavedData {

public void setColorsDirty(int x, int z) {
this.setDirty();
Expand All @@ -159,15 +160,15 @@ index 17f33c83c6033564d6bf4fbd388b0b847c68adb3..6bcb565cd60b60be9255ef537591ee82
Iterator iterator = this.carriedBy.iterator();

while (iterator.hasNext()) {
@@ -528,6 +554,7 @@ public class MapItemSavedData extends SavedData {
@@ -528,6 +553,7 @@ public class MapItemSavedData extends SavedData {
public void removedFromFrame(BlockPos pos, int id) {
this.removeDecoration(MapItemSavedData.getFrameKey(id));
this.frameMarkers.remove(MapFrame.frameId(pos));
+ this.dirtyFrameDecorations = true; // Paper
}

public boolean updateColor(int x, int z, byte color) {
@@ -589,6 +616,93 @@ public class MapItemSavedData extends SavedData {
@@ -589,6 +615,93 @@ public class MapItemSavedData extends SavedData {
return "frame-" + id;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ index c03608fec96b51e1867f43d8f42e5aefb1520e46..15b21fa3907db1b77ed5b5d1050a37f4
throw new IllegalStateException("Ticking retired scheduler");
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 23ddd26af762c1cd7fb3920669abb96b3213ab37..7f2e25b2ebb8fb698a4adb12d77670e126549405 100644
index 696d075ca2883f3c37e35f983c4d020e5db89d16..1a7daaebdfd616e1417eb6aade727ca23fa77b18 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -323,7 +323,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -322,7 +322,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
Expand All @@ -86,7 +86,7 @@ index 23ddd26af762c1cd7fb3920669abb96b3213ab37..7f2e25b2ebb8fb698a4adb12d77670e1
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> { // Paper - rewrite chunk system
@@ -1727,6 +1728,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1725,6 +1726,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
Expand All @@ -105,7 +105,7 @@ index 23ddd26af762c1cd7fb3920669abb96b3213ab37..7f2e25b2ebb8fb698a4adb12d77670e1
getAllLevels().forEach(level -> {
for (final Entity entity : level.moonrise$getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
if (entity.isRemoved()) {
@@ -1738,6 +1751,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1736,6 +1749,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
});
Expand All @@ -115,7 +115,7 @@ index 23ddd26af762c1cd7fb3920669abb96b3213ab37..7f2e25b2ebb8fb698a4adb12d77670e1
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
this.profiler.push("commandFunctions");
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index cd789c235acf740ec29c30b180e7fbe1a140caa9..e3da31426e5fe2cf3b0c3cc6b665503cc88665a5 100644
index 89c8713d2c2206d1b0d8c0a392c9d13b3e736f0c..0495941a51c1dafa796c7f08a77d34bc377d3774 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -71,7 +71,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0010-Spooky-month-optimizations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Caches when Bat's spooky season starts and ends, and when Skeleton and Zombies h
Avoids unnecessary date checks, even tho that this shouldn't really improve performance that much... unless you have a lot of bats/zombies/skeletons spawning.

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7f2e25b2ebb8fb698a4adb12d77670e126549405..b198e2b7a1a96972ecf761e1713085d618aadead 100644
index 1a7daaebdfd616e1417eb6aade727ca23fa77b18..3ad7a0a6b698ed2ff040fe1015b59e897a173811 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -324,7 +324,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -323,7 +323,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile boolean abnormalExit = false; // Paper
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
Expand Down Expand Up @@ -89,10 +89,10 @@ index 3b5cf6ffb74d11bea5eb21bd66d679734ff5000c..97bdeb56fee6fb4ae924973730e34dbf
this.armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F;
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 2280004638fd19ed018cb3e77d53a018b34ec516..fb15112f920174d7ea6a3bd683418772c0910780 100644
index 2b43337ac63d051718a2074fcc46e128a1d65129..896e253f349b0cf21fda0d798aca8a70942c8f86 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -553,10 +553,11 @@ public class Zombie extends Monster {
@@ -550,10 +550,11 @@ public class Zombie extends Monster {

if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
LocalDate localdate = LocalDate.now();
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0011-Optimize-canSee-checks.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ This seems stupid, but it does seem that it improves the performance a bit, and
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.

diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 1e0a6e5a3c907ab55ee6f2780a7d43bd455f2b7b..15bc677119ae394e0334e2570bc01d774fe1a264 100644
index af8cb316ac169aa8d98a88765b85bb013b9ba961..250f8ba3c77830ea0978fdeeb7748336ca150939 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1257,7 +1257,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1258,7 +1258,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end - Configurable entity tracking range by Y

// CraftBukkit start - respect vanish API
Expand All @@ -27,7 +27,7 @@ index 1e0a6e5a3c907ab55ee6f2780a7d43bd455f2b7b..15bc677119ae394e0334e2570bc01d77
}
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a0d5082590ee03060f0dbb4770d196efc316c328..00c6e2ab7e79750a7eef8d25c03caa787b011b14 100644
index 42d7660efe5baa6f796f2a7606686c765b6f2478..d047114737164e12491223bc68a141efc1c389fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -200,7 +200,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Expand All @@ -39,7 +39,7 @@ index a0d5082590ee03060f0dbb4770d196efc316c328..00c6e2ab7e79750a7eef8d25c03caa78
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0;
@@ -2248,9 +2248,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2252,9 +2252,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

@Override
public boolean canSee(org.bukkit.entity.Entity entity) {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0015-Track-how-much-MSPT-each-world-used.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..601198a33adb29316b0617d5390d1620
}

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b198e2b7a1a96972ecf761e1713085d618aadead..1633d2b2816d3cf958f13d2613812f582b2d1591 100644
index 3ad7a0a6b698ed2ff040fe1015b59e897a173811..f91374c44c392f9d28799fbf3538f99258d727b4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1819,7 +1819,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1817,7 +1817,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

try {
worldserver.timings.doTick.startTiming(); // Spigot
Expand All @@ -77,7 +77,7 @@ index b198e2b7a1a96972ecf761e1713085d618aadead..1633d2b2816d3cf958f13d2613812f58
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 2fe9d9b38c01d04416843fdd48d3e33899b7de63..f162a3639f55d20bb691e34b60a7c8c55a99daf6 100644
index f9abf63e12ea930275121b470e4e4906cff0fc12..7d3d46d693a0d0dd1c1932c29b18e98555d4e3da 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -497,6 +497,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0020-Add-CraftItemRecipeEvent.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Add CraftItemRecipeEvent
Used when a player OR a crafter block crafts an item, as an alternative to PrepareItemCraftEvent and CraftItemEvent, because both events are not triggered when a item is crafted from a crafter

diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b13057c0792067cc6b0abdf0d64a9be2cc9389a4..56911919c531d2a4d5e89fbc628160617295b0bb 100644
index befeaac4786760f6847a5945da2296a3e68dbb17..d918f1fc104795be2a04c1f57265d27e20e9df09 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3180,6 +3180,21 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3192,6 +3192,21 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} else {
event = new CraftItemEvent(recipe, inventory, type, packet.getSlotNum(), click, action);
}
Expand Down Expand Up @@ -50,7 +50,7 @@ index deb5b4fab94618c08a51e432c33e49b1627bd717..703fbeafc78889cbfea292847678207d
world.levelEvent(1050, pos, 0);
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 44bec90466967933b5322a8ca8b5e86e0c96d443..6d166a6662ed2badfdc9cb42ca4374dc8d640404 100644
index b2760b9a66c1bcb848d43582c3a913c6fb43102b..beddb6a64e0ba5112d369794a066ca6b9f2ac303 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1467,6 +1467,24 @@ public class CraftEventFactory {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0021-Allow-item-version-downgrades.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Allow item version downgrades
The server WON'T convert the item data from a newer version to an older version, so proceed with caution

diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 28dbe30a98a6730839949bc9a6a90b78619ff84d..48e0c6fec6f847ce030ec79655d866be47364c73 100644
index f78744b6d6075f584d9a88612661854f3f04aed1..395f98cf320e40cae0c2561bcc243e503def2dcd 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -75,6 +75,7 @@ import org.bukkit.potion.PotionType;
Expand All @@ -26,7 +26,7 @@ index 28dbe30a98a6730839949bc9a6a90b78619ff84d..48e0c6fec6f847ce030ec79655d866be

// Fastpath up to date materials
if (version == this.getDataVersion()) {
@@ -559,7 +560,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -588,7 +589,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
throw new RuntimeException(ex);
}
int dataVersion = compound.getInt("DataVersion");
Expand Down
Loading

0 comments on commit 8c40f73

Please sign in to comment.