fix: IllegalArgumentExepction in v1_21_R1's AnvilView in MC 1.21.1

The variable type got more specific it seems
This commit is contained in:
Christian Koop 2024-08-17 16:59:08 +02:00
parent 3dcf402269
commit bbeb958931
No known key found for this signature in database
GPG Key ID: 6A4A09E8ED946113

View File

@ -14,6 +14,7 @@ import net.minecraft.world.inventory.ContainerLevelAccess;
import net.minecraft.world.inventory.MenuType;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryView;
import org.bukkit.craftbukkit.v1_21_R1.inventory.view.CraftAnvilView;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
@ -59,14 +60,14 @@ public class AnvilView extends AnvilMenu implements CustomAnvil {
}
}
public CraftInventoryView getBukkitView(Player player, InventoryHolder holder) {
public CraftAnvilView getBukkitView(Player player, InventoryHolder holder) {
try {
AnvilInventoryCustom craftInventory = new AnvilInventoryCustom(holder,
new Location(this.entity.level().getWorld(), 0, 0, 0),
this.inputSlots,
this.resultSlots,
this);
CraftInventoryView view = new CraftInventoryView(player.getBukkitEntity(), craftInventory, this);
CraftAnvilView view = new CraftAnvilView(player.getBukkitEntity(), craftInventory, this);
mc_ContainerAnvil_bukkitEntity.set(this, view);
return view;