feat(platform): support Purpur 26.3
CI / build (push) Successful in 1m43s
CI / build (pull_request) Successful in 1m52s

This commit is contained in:
dmg committed 2026-10-16 22:10:42 -04:00
1 parent 9896194932
commit 09dd5ded57
20 files changed
+91 -50

No files matched your search

@@ -25,7 +25,7 @@ public final class ManualCraftDelivery {
var outputs = records.orElseThrow().stream().map(sheets::create).toList();
var grid = (CraftingInventory) current.getTopInventory();
var inputs = grid.getMatrix();
// Purpur 2618: these are native mirrors; count changes do not call slotsChanged.
// Purpur 2651: these are native mirrors; count changes do not call slotsChanged.
for (var item : inputs) if (item != null && !item.isEmpty()) item.setAmount(item.getAmount() - plan.quantity());
if (plan.route() == ManualCraftPlan.Route.CURSOR) current.setCursor(outputs.getFirst());
else for (int index = 0; index < outputs.size(); index++) {
@@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.potion.CraftPotionEffectType;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType;
/** Read-only Purpur 2618 phase/instance proof. Never changes native maps, events or mutation flags. */
/** Read-only Purpur 2651 phase/instance proof. Never changes native maps, events or mutation flags. */
final class NativePotionState {
private static final Field TICKING = tickingField();
private static final StackWalker STACK = StackWalker.getInstance();
@@ -25,7 +25,7 @@ import net.minecraft.world.level.GameType;
import net.minecraft.world.phys.Vec3;
/**
* Display-only codec pinned to Purpur 26.2 build 2618. No packet delivery, world insertion,
* Display-only codec pinned to Purpur 26.3 build 2651. No packet delivery, world insertion,
* profile/team changes, or authoritative player mutations belong here.
*
* <p>Player reads and detached-label creation/updates belong on the server thread. Pure
@@ -445,7 +445,7 @@ public final class ProtocolPresentation implements CharacterPresentation.Output
}
}
} else if (packet instanceof ClientboundRemoveEntitiesPacket removal
&& removal.getEntityIds().contains(decision.entity())) { mask |= UNTRACKED; }
&& removal.entityIds().contains(decision.entity())) { mask |= UNTRACKED; }
else if (packet instanceof ClientboundPlayerInfoRemovePacket removal
&& removal.profileIds().contains(view.holder())) { mask |= TAB_REMOVED; }
else if (packet instanceof ClientboundRespawnPacket) { mask |= UNTRACKED; }
@@ -176,7 +176,7 @@ public final class EquipmentSessionEvents implements Listener, AutoCloseable {
int slot = player.getInventory().getHeldItemSlot();
if (reservedExchange(player, slot)) {
event.setCancelled(true);
// Purpur 2618 snapshots the proposed hand stacks BEFORE dispatch. Never let its
// Purpur 2651 snapshots the proposed hand stacks BEFORE dispatch. Never let its
// continuation write the old fantasy control over the restored ordinary stack.
if (Objects.equals(event.getMainHandItem(), player.getInventory().getItemInOffHand())
&& Objects.equals(event.getOffHandItem(), player.getInventory().getItem(slot))) {
@@ -408,7 +408,7 @@ public final class EquipmentSessionEvents implements Listener, AutoCloseable {
try {
boolean matching = draw != null && draw.item().equals(event.getItem())
&& draw.item().equals(player.getActiveItem()) && event.getTicksHeldFor() >= 0;
// Purpur 2618 reloads LivingEntity.useItem AFTER this event, then calls releaseUsing.
// Purpur 2651 reloads LivingEntity.useItem AFTER this event, then calls releaseUsing.
// Clear it first: cancelling EntityShootBowEvent alone is too late to own ammo draw.
if (special(event.getItem()) && event.getItem().equals(player.getActiveItem())) player.clearActiveItem();
if (matching) emit(player, draw.item(), draw.selected(), ControlInput.Gesture.DRAW_RELEASE,
@@ -542,7 +542,7 @@ public final class EquipmentSessionEvents implements Listener, AutoCloseable {
|| !Arrays.equals(BOX_SLOT_MAP, item.getPersistentDataContainer().get(BOX_SLOTS, PersistentDataType.INTEGER_ARRAY))
|| !(entity instanceof Player player) || !box.owner().equals(player.getUniqueId())
|| player.getInventory().getMaxStackSize() < 1) return true;
// Purpur 2618 Inventory.add(-1, stack): factory nonstackable boxes cannot merge;
// Purpur 2651 Inventory.add(-1, stack): factory nonstackable boxes cannot merge;
// getFreeSlot scans 0..35, NOT the selected slot or only main storage. Read only:
// leave native insertion to the caller, and never invent a recovery destination.
for (int slot = 0; slot < 36; slot++) {
@@ -5,7 +5,7 @@ import java.util.Objects;
import org.bukkit.inventory.PlayerInventory;
/**
* Purpur 2618 main-storage-only exchange, called on the server thread after revalidation.
* Purpur 2651 main-storage-only exchange, called on the server thread after revalidation.
* Public Craft/native accessors (as with NativeHealthLimit), no private-field access.
* Native NonNullList.set only replaces a list reference: no item copying, packet emission,
* equip notification, menu recomputation or plugin callback between the two writes.
@@ -6,7 +6,7 @@ import java.util.function.Consumer;
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
/**
* Purpur 2618 instance-local effective-value lease. Base/modifiers remain in the native
* Purpur 2651 instance-local effective-value lease. Base/modifiers remain in the native
* instance, so additions, removals, potion expiry and serialization keep their normal owners.
* The pinned dirty callback is synchronous: no polling interval can expose an external maximum.
* No global attribute/range is changed. Native compatibility tests must gate runtime upgrades.