Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -11,7 +11,7 @@
public class ContainerAnvil extends ContainerAnvilAbstract {
public static final int INPUT_SLOT = 0;
@@ -44,6 +48,11 @@
@@ -45,6 +49,11 @@
private static final int ADDITIONAL_SLOT_X_PLACEMENT = 76;
private static final int RESULT_SLOT_X_PLACEMENT = 134;
private static final int SLOT_Y_PLACEMENT = 47;
@@ -23,7 +23,7 @@
public ContainerAnvil(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.NULL);
@@ -71,7 +80,7 @@
@@ -72,7 +81,7 @@
@Override
protected boolean mayPickup(EntityHuman entityhuman, boolean flag) {
@@ -38,11 +38,11 @@
- this.cost.set(0);
+ this.cost.set(DEFAULT_DENIED_COST); // CraftBukkit - use a variable for set a cost for denied item
this.inputSlots.setItem(0, ItemStack.EMPTY);
this.access.execute((world, blockposition) -> {
IBlockData iblockdata = world.getBlockState(blockposition);
@@ -141,8 +150,8 @@
if (itemstack1.isDamageableItem() && itemstack1.getItem().isValidRepairItem(itemstack, itemstack2)) {
@@ -143,8 +152,8 @@
if (itemstack1.isDamageableItem() && itemstack.isValidRepairItem(itemstack2)) {
k = Math.min(itemstack1.getDamageValue(), itemstack1.getMaxDamage() / 4);
if (k <= 0) {
- this.resultSlots.setItem(0, ItemStack.EMPTY);
@@ -52,7 +52,7 @@
return;
}
@@ -156,8 +165,8 @@
@@ -158,8 +167,8 @@
this.repairItemCountCost = i1;
} else {
if (!flag && (!itemstack1.is(itemstack2.getItem()) || !itemstack1.isDamageableItem())) {
@@ -63,7 +63,7 @@
return;
}
@@ -231,8 +240,8 @@
@@ -233,8 +242,8 @@
}
if (flag2 && !flag1) {
@@ -74,14 +74,17 @@
return;
}
}
@@ -257,11 +266,11 @@
itemstack1 = ItemStack.EMPTY;
@@ -260,14 +269,14 @@
}
- if (b0 == i && b0 > 0 && this.cost.get() >= 40) {
- this.cost.set(39);
+ if (b0 == i && b0 > 0 && this.cost.get() >= maximumRepairCost) { // CraftBukkit
+ this.cost.set(maximumRepairCost - 1); // CraftBukkit
if (b0 == i && b0 > 0) {
- if (this.cost.get() >= 40) {
- this.cost.set(39);
+ if (this.cost.get() >= maximumRepairCost) { // CraftBukkit
+ this.cost.set(maximumRepairCost - 1); // CraftBukkit
}
this.onlyRenaming = true;
}
- if (this.cost.get() >= 40 && !this.player.getAbilities().instabuild) {
@@ -89,7 +92,7 @@
itemstack1 = ItemStack.EMPTY;
}
@@ -279,11 +288,12 @@
@@ -285,11 +294,12 @@
EnchantmentManager.setEnchantments(itemstack1, itemenchantments_a.toImmutable());
}
@@ -105,7 +108,7 @@
}
}
@@ -323,4 +333,19 @@
@@ -329,4 +339,19 @@
public int getCost() {
return this.cost.get();
}