Update to Minecraft 1.21.4

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-12-04 03:20:00 +11:00
parent 267ae64dd6
commit 5381ea78f7
125 changed files with 1383 additions and 1093 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/ContainerBrewingStand.java
+++ b/net/minecraft/world/inventory/ContainerBrewingStand.java
@@ -16,6 +16,11 @@
@@ -17,6 +17,11 @@
import net.minecraft.world.item.alchemy.PotionContents;
import net.minecraft.world.item.alchemy.PotionRegistry;
@@ -11,8 +11,8 @@
+
public class ContainerBrewingStand extends Container {
private static final int BOTTLE_SLOT_START = 0;
@@ -32,12 +37,18 @@
static final MinecraftKey EMPTY_SLOT_FUEL = MinecraftKey.withDefaultNamespace("container/slot/brewing_fuel");
@@ -35,12 +40,18 @@
private final IContainerProperties brewingStandData;
private final Slot ingredientSlot;
@@ -31,7 +31,7 @@
checkContainerSize(iinventory, 5);
checkContainerDataCount(icontainerproperties, 2);
this.brewingStand = iinventory;
@@ -55,6 +66,7 @@
@@ -58,6 +69,7 @@
@Override
public boolean stillValid(EntityHuman entityhuman) {
@@ -39,8 +39,8 @@
return this.brewingStand.stillValid(entityhuman);
}
@@ -185,4 +197,17 @@
return itemstack.is(TagsItem.BREWING_FUEL);
@@ -198,4 +210,17 @@
return ContainerBrewingStand.EMPTY_SLOT_FUEL;
}
}
+

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/ContainerEnchantTable.java
+++ b/net/minecraft/world/inventory/ContainerEnchantTable.java
@@ -31,6 +31,19 @@
@@ -30,6 +30,19 @@
import net.minecraft.world.level.block.BlockEnchantmentTable;
import net.minecraft.world.level.block.Blocks;
@@ -19,8 +19,8 @@
+
public class ContainerEnchantTable extends Container {
static final MinecraftKey EMPTY_SLOT_LAPIS_LAZULI = MinecraftKey.withDefaultNamespace("item/empty_slot_lapis_lazuli");
@@ -41,6 +54,10 @@
static final MinecraftKey EMPTY_SLOT_LAPIS_LAZULI = MinecraftKey.withDefaultNamespace("container/slot/lapis_lazuli");
@@ -40,6 +53,10 @@
public final int[] costs;
public final int[] enchantClue;
public final int[] levelClue;
@@ -31,7 +31,7 @@
public ContainerEnchantTable(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.NULL);
@@ -54,6 +71,13 @@
@@ -53,6 +70,13 @@
super.setChanged();
ContainerEnchantTable.this.slotsChanged(this);
}
@@ -45,7 +45,7 @@
};
this.random = RandomSource.create();
this.enchantmentSeed = ContainerProperty.standalone();
@@ -61,13 +85,13 @@
@@ -60,13 +84,13 @@
this.enchantClue = new int[]{-1, -1, -1};
this.levelClue = new int[]{-1, -1, -1};
this.access = containeraccess;
@@ -61,7 +61,7 @@
@Override
public boolean mayPlace(ItemStack itemstack) {
return itemstack.is(Items.LAPIS_LAZULI);
@@ -89,6 +113,9 @@
@@ -88,6 +112,9 @@
this.addDataSlot(ContainerProperty.shared(this.levelClue, 0));
this.addDataSlot(ContainerProperty.shared(this.levelClue, 1));
this.addDataSlot(ContainerProperty.shared(this.levelClue, 2));
@@ -71,7 +71,7 @@
}
@Override
@@ -96,7 +123,7 @@
@@ -95,7 +122,7 @@
if (iinventory == this.enchantSlots) {
ItemStack itemstack = iinventory.getItem(0);
@@ -80,7 +80,7 @@
this.access.execute((world, blockposition) -> {
Registry<Holder<Enchantment>> registry = world.registryAccess().lookupOrThrow(Registries.ENCHANTMENT).asHolderIdMap();
int i = 0;
@@ -136,6 +163,41 @@
@@ -135,6 +162,41 @@
}
}
@@ -122,7 +122,7 @@
this.broadcastChanges();
});
} else {
@@ -163,21 +225,46 @@
@@ -162,21 +224,46 @@
ItemStack itemstack2 = itemstack;
List<WeightedRandomEnchant> list = this.getEnchantmentList(world.registryAccess(), itemstack, i, this.costs[i]);
@@ -175,7 +175,7 @@
itemstack1.consume(j, entityhuman);
if (itemstack1.isEmpty()) {
this.enchantSlots.setItem(1, ItemStack.EMPTY);
@@ -244,6 +331,7 @@
@@ -243,6 +330,7 @@
@Override
public boolean stillValid(EntityHuman entityhuman) {
@@ -183,7 +183,7 @@
return stillValid(this.access, entityhuman, Blocks.ENCHANTING_TABLE);
}
@@ -294,4 +382,17 @@
@@ -293,4 +381,17 @@
return itemstack;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/ContainerHorse.java
+++ b/net/minecraft/world/inventory/ContainerHorse.java
@@ -10,6 +10,11 @@
@@ -11,6 +11,11 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
@@ -11,8 +11,8 @@
+
public class ContainerHorse extends Container {
private final IInventory horseContainer;
@@ -18,13 +23,28 @@
static final MinecraftKey SADDLE_SLOT_SPRITE = MinecraftKey.withDefaultNamespace("container/slot/saddle");
@@ -22,13 +27,28 @@
private static final int SLOT_BODY_ARMOR = 1;
private static final int SLOT_HORSE_INVENTORY_START = 2;
@@ -42,12 +42,12 @@
@Override
public boolean mayPlace(ItemStack itemstack) {
return itemstack.is(Items.SADDLE) && !this.hasItem() && entityhorseabstract.isSaddleable();
@@ -35,7 +55,7 @@
return entityhorseabstract.isSaddleable();
}
@@ -46,7 +66,7 @@
});
- this.addSlot(new ArmorSlot(this, this.armorContainer, entityhorseabstract, EnumItemSlot.BODY, 0, 8, 36, (MinecraftKey) null) {
+ this.addSlot(new ArmorSlot(this.armorContainer, entityhorseabstract, EnumItemSlot.BODY, 0, 8, 36, (MinecraftKey) null) { // CraftBukkit - decompile error
MinecraftKey minecraftkey = entityhorseabstract instanceof EntityLlama ? ContainerHorse.LLAMA_ARMOR_SLOT_SPRITE : ContainerHorse.ARMOR_SLOT_SPRITE;
- this.addSlot(new ArmorSlot(this, this.armorContainer, entityhorseabstract, EnumItemSlot.BODY, 0, 8, 36, minecraftkey) {
+ this.addSlot(new ArmorSlot(this.armorContainer, entityhorseabstract, EnumItemSlot.BODY, 0, 8, 36, minecraftkey) { // CraftBukkit - decompile error
@Override
public boolean mayPlace(ItemStack itemstack) {
return entityhorseabstract.isEquippableInSlot(itemstack, EnumItemSlot.BODY);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/ContainerPlayer.java
+++ b/net/minecraft/world/inventory/ContainerPlayer.java
@@ -13,6 +13,12 @@
@@ -12,6 +12,12 @@
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.level.World;
@@ -13,7 +13,7 @@
public class ContainerPlayer extends AbstractCraftingMenu {
public static final int CONTAINER_ID = 0;
@@ -40,9 +46,15 @@
@@ -38,9 +44,15 @@
private static final EnumItemSlot[] SLOT_IDS = new EnumItemSlot[]{EnumItemSlot.HEAD, EnumItemSlot.CHEST, EnumItemSlot.LEGS, EnumItemSlot.FEET};
public final boolean active;
private final EntityHuman owner;
@@ -30,7 +30,7 @@
this.active = flag;
this.owner = entityhuman;
this.addResultSlot(entityhuman, 154, 28);
@@ -56,7 +68,7 @@
@@ -54,7 +66,7 @@
}
this.addStandardInventorySlots(playerinventory, 8, 84);
@@ -39,7 +39,7 @@
@Override
public void setByPlayer(ItemStack itemstack, ItemStack itemstack1) {
entityhuman.onEquipItem(EnumItemSlot.OFFHAND, itemstack1, itemstack);
@@ -192,4 +204,17 @@
@@ -190,4 +202,17 @@
protected EntityHuman owner() {
return this.owner;
}

View File

@@ -66,7 +66,7 @@
return stillValid(this.access, entityhuman, Blocks.STONECUTTER);
}
@@ -154,7 +185,7 @@
@@ -158,7 +189,7 @@
}
void setupResultSlot(int i) {