Skip to content

Commit

Permalink
Update guis to latest 1.21 build
Browse files Browse the repository at this point in the history
Updates the beacon, enchanting table, and stonecutter guis to support the latest build of 1.21
  • Loading branch information
stefvanschie committed Aug 14, 2024
1 parent 3b7fbb5 commit ff2f992
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventory;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryBeacon;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryView;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_21_R1.inventory.view.CraftBeaconView;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryHolder;
import org.jetbrains.annotations.Contract;
Expand Down Expand Up @@ -130,7 +130,7 @@ private class ContainerBeaconImpl extends BeaconMenu {
* The internal bukkit entity for this container beacon
*/
@Nullable
private CraftInventoryView bukkitEntity;
private CraftBeaconView bukkitEntity;

/**
* Field for accessing the beacon field
Expand Down Expand Up @@ -163,7 +163,7 @@ public ContainerBeaconImpl(@NotNull ServerPlayer serverPlayer, @Nullable org.buk

@NotNull
@Override
public CraftInventoryView getBukkitView() {
public CraftBeaconView getBukkitView() {
if (bukkitEntity == null) {
try {
CraftInventory inventory = new CraftInventoryBeacon((Container) beaconField.get(this)) {
Expand All @@ -175,7 +175,7 @@ public InventoryHolder getHolder() {
}
};

bukkitEntity = new CraftInventoryView(player, inventory, this);
this.bukkitEntity = new CraftBeaconView(player, inventory, this);
} catch (IllegalAccessException exception) {
throw new RuntimeException(exception);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventory;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryEnchanting;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryView;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_21_R1.inventory.view.CraftEnchantmentView;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryHolder;
import org.jetbrains.annotations.Contract;
Expand Down Expand Up @@ -144,7 +144,7 @@ private class ContainerEnchantingTableImpl extends EnchantmentMenu {
* The internal bukkit entity for this container enchanting table
*/
@Nullable
private CraftInventoryView bukkitEntity;
private CraftEnchantmentView bukkitEntity;

/**
* Field for accessing the enchant slots field
Expand Down Expand Up @@ -181,7 +181,7 @@ public ContainerEnchantingTableImpl(@NotNull ServerPlayer serverPlayer,

@NotNull
@Override
public CraftInventoryView getBukkitView() {
public CraftEnchantmentView getBukkitView() {
if (bukkitEntity == null) {
try {
CraftInventory inventory = new CraftInventoryEnchanting((Container) enchantSlotsField.get(this)) {
Expand All @@ -193,7 +193,7 @@ public InventoryHolder getHolder() {
}
};

bukkitEntity = new CraftInventoryView(player, inventory, this);
this.bukkitEntity = new CraftEnchantmentView(player, inventory, this);
} catch (IllegalAccessException exception) {
exception.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventory;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryStonecutter;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryView;
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_21_R1.inventory.view.CraftStonecutterView;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryHolder;
import org.jetbrains.annotations.Contract;
Expand Down Expand Up @@ -143,7 +143,7 @@ private class ContainerStonecutterImpl extends StonecutterMenu {
* The internal bukkit entity for this container enchanting table
*/
@Nullable
private CraftInventoryView bukkitEntity;
private CraftStonecutterView bukkitEntity;

/**
* Field for accessing the result inventory field
Expand Down Expand Up @@ -173,7 +173,7 @@ public ContainerStonecutterImpl(@NotNull ServerPlayer entityPlayer,

@NotNull
@Override
public CraftInventoryView getBukkitView() {
public CraftStonecutterView getBukkitView() {
if (bukkitEntity == null) {
CraftInventory inventory = new CraftInventoryStonecutter(this.container, getResultInventory()) {
@NotNull
Expand All @@ -184,7 +184,7 @@ public InventoryHolder getHolder() {
}
};

bukkitEntity = new CraftInventoryView(player, inventory, this);
this.bukkitEntity = new CraftStonecutterView(player, inventory, this);
}

return bukkitEntity;
Expand Down

0 comments on commit ff2f992

Please sign in to comment.