Skip to content

Commit 3579471

Browse files
Update to Paper 26.1.1
1 parent 7b56d94 commit 3579471

5 files changed

Lines changed: 15 additions & 16 deletions

File tree

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
kotlin = "2.3.10"
3-
paper = "1.21.11-R0.1-SNAPSHOT"
3+
paper = "26.1.1.+"
44
testpaper = "1.21.11-R0.1-SNAPSHOT"
55

66
[libraries]
@@ -14,7 +14,7 @@ kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "
1414
kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
1515
mockbukkit = { module = "org.mockbukkit.mockbukkit:mockbukkit-v1.21", version = "4.106.1" }
1616
logback-classic = { module = "ch.qos.logback:logback-classic", version = "1.5.21" }
17-
paperweight-userdev-plugin = { module = "io.papermc.paperweight:paperweight-userdev", version = "2.0.0-beta.19" }
17+
paperweight-userdev-plugin = { module = "io.papermc.paperweight:paperweight-userdev", version = "2.0.0-beta.21" }
1818
test-paper-api = { module = "io.papermc.paper:paper-api", version.ref = "testpaper" }
1919

2020
[plugins]

invui/src/main/java/xyz/xenondevs/invui/internal/menu/CustomContainerMenu.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import net.minecraft.util.HashOps;
2828
import net.minecraft.world.SimpleContainer;
2929
import net.minecraft.world.inventory.AbstractContainerMenu;
30+
import net.minecraft.world.inventory.ContainerInput;
3031
import net.minecraft.world.inventory.MenuType;
3132
import net.minecraft.world.inventory.RemoteSlot;
3233
import net.minecraft.world.item.ItemStack;
@@ -497,7 +498,7 @@ protected UpdateType handleClick(ServerboundContainerClickPacket packet) {
497498
}
498499
remoteCarried.force(DIRTY_MARKER);
499500

500-
if (packet.clickType() == net.minecraft.world.inventory.ClickType.QUICK_CRAFT) {
501+
if (packet.containerInput() == ContainerInput.QUICK_CRAFT) {
501502
if (!handleDragClick(packet))
502503
return requiresFullUpdate ? UpdateType.FULL : UpdateType.DIRTY;
503504
} else {
@@ -514,7 +515,7 @@ protected UpdateType handleClick(ServerboundContainerClickPacket packet) {
514515
*/
515516
private void handleNormalClick(ServerboundContainerClickPacket packet) {
516517
int hotbarBtn = -1;
517-
ClickType clickType = switch (packet.clickType()) {
518+
ClickType clickType = switch (packet.containerInput()) {
518519
case PICKUP -> switch (packet.buttonNum()) {
519520
case 0 -> ClickType.LEFT;
520521
case 1 -> ClickType.RIGHT;

invui/src/main/java/xyz/xenondevs/invui/internal/menu/CustomMerchantMenu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private ItemStack toItemStack(@Nullable Item item) {
167167

168168
private ItemCost toItemCost(ItemStack itemStack) {
169169
return new ItemCost(
170-
itemStack.getItemHolder(),
170+
itemStack.typeHolder(),
171171
itemStack.getCount(),
172172
DataComponentExactPredicate.allOf(itemStack.getComponents()),
173173
itemStack

invui/src/main/java/xyz/xenondevs/invui/internal/menu/CustomStonecutterMenu.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
import net.minecraft.server.MinecraftServer;
1212
import net.minecraft.world.inventory.MenuType;
1313
import net.minecraft.world.item.ItemStack;
14+
import net.minecraft.world.item.ItemStackTemplate;
1415
import net.minecraft.world.item.Items;
15-
import net.minecraft.world.item.crafting.Ingredient;
16-
import net.minecraft.world.item.crafting.RecipeHolder;
17-
import net.minecraft.world.item.crafting.SelectableRecipe;
18-
import net.minecraft.world.item.crafting.StonecutterRecipe;
16+
import net.minecraft.world.item.crafting.*;
1917
import net.minecraft.world.item.crafting.display.SlotDisplay;
2018
import org.bukkit.craftbukkit.inventory.CraftItemStack;
2119
import org.jspecify.annotations.Nullable;
@@ -134,7 +132,9 @@ private void setNmsButtons(List<? extends ItemStack> buttons) {
134132
* @return The stonecutter recipes.
135133
*/
136134
private List<SelectableRecipe.SingleInputEntry<StonecutterRecipe>> createRecipes(List<? extends ItemStack> buttons) {
137-
return buttons.stream().map(button -> new SelectableRecipe.SingleInputEntry<>(
135+
return buttons.stream()
136+
.map(ItemStackTemplate::fromNonEmptyStack)
137+
.map(button -> new SelectableRecipe.SingleInputEntry<>(
138138
INGREDIENT,
139139
new SelectableRecipe<>(
140140
new SlotDisplay.ItemStackSlotDisplay(button),
@@ -143,7 +143,7 @@ private List<SelectableRecipe.SingleInputEntry<StonecutterRecipe>> createRecipes
143143
Registries.RECIPE,
144144
Identifier.fromNamespaceAndPath("invui", "fake_stonecutter_" + MathUtils.RANDOM.nextInt())
145145
),
146-
new StonecutterRecipe("", INGREDIENT, button.copy())
146+
new StonecutterRecipe(new Recipe.CommonInfo(false), INGREDIENT, button)
147147
))
148148
)
149149
)).toList();

invui/src/main/java/xyz/xenondevs/invui/internal/util/ItemUtils2.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import java.util.ArrayList;
1515
import java.util.List;
1616
import java.util.Objects;
17-
import java.util.stream.Collectors;
1817

1918
import static io.papermc.paper.datacomponent.item.BundleContents.bundleContents;
2019

@@ -198,12 +197,11 @@ public static int removeFromBundle(ItemStack bundle, ItemStack target) {
198197
var nmsBundle = CraftItemStack.unwrap(bundle);
199198
var bundleContents = nmsBundle.get(DataComponents.BUNDLE_CONTENTS);
200199
if (bundleContents != null && !bundleContents.isEmpty()) {
201-
var items = bundleContents.itemCopyStream()
202-
.collect(Collectors.toCollection(ArrayList::new));
203-
int i = Math.min(Math.max(0, bundleContents.getSelectedItem()), bundleContents.size());
200+
var items = new ArrayList<>(bundleContents.items());
201+
int i = Math.clamp(bundleContents.getSelectedItemIndex(), 0, bundleContents.size());
204202
var taken = items.remove(i);
205203
nmsBundle.set(DataComponents.BUNDLE_CONTENTS, new BundleContents(items));
206-
return CraftItemStack.asCraftMirror(taken);
204+
return CraftItemStack.asCraftMirror(taken.create());
207205
}
208206

209207
return null;

0 commit comments

Comments
 (0)