Skip to content

Commit

Permalink
Fix BedWars voting after one try
Browse files Browse the repository at this point in the history
Dumb no sub menu
  • Loading branch information
Fesaa committed Jul 21, 2024
1 parent 9873f27 commit 18b7cb3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class VersionedVotingLink extends VotingLink {
public ItemStack returnItemStack;
private LocalPlayer player = null;
private final Task starter = Task.builder(() -> {
this.returnItemStack = null;
this.openVotingMenu(player, this.hotbarSlotIndex);

VotePair votePair = this.getNextVotePair();
Expand Down Expand Up @@ -119,7 +120,7 @@ public void run() {
AbstractContainerMenu menu = player.containerMenu;
if (menu instanceof ChestMenu) {
Slot slot = menu.getSlot(votingInterface.returnIndex);
if (slot.getItem().getDisplayName()
if (votingInterface.returnItemStack != null && slot.getItem().getDisplayName()
.equals(votingInterface.returnItemStack.getDisplayName())) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class VersionedVotingLink extends VotingLink {
public ItemStack returnItemStack;
private LocalPlayer player = null;
private final Task starter = Task.builder(() -> {
this.returnItemStack = null;
this.openVotingMenu(player, this.hotbarSlotIndex);

VotePair votePair = this.getNextVotePair();
Expand Down Expand Up @@ -119,7 +120,7 @@ public void run() {
AbstractContainerMenu menu = player.containerMenu;
if (menu instanceof ChestMenu) {
Slot slot = menu.getSlot(votingInterface.returnIndex);
if (slot.getItem().getDisplayName()
if (votingInterface.returnItemStack != null && slot.getItem().getDisplayName()
.equals(votingInterface.returnItemStack.getDisplayName())) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class VersionedVotingLink extends VotingLink {
public ItemStack returnItemStack;
private LocalPlayer player = null;
private final Task starter = Task.builder(() -> {
this.returnItemStack = null;
this.openVotingMenu(player, this.hotbarSlotIndex);

VotePair votePair = this.getNextVotePair();
Expand Down Expand Up @@ -119,7 +120,7 @@ public void run() {
AbstractContainerMenu menu = player.containerMenu;
if (menu instanceof ChestMenu) {
Slot slot = menu.getSlot(votingInterface.returnIndex);
if (slot.getItem().getDisplayName()
if (votingInterface.returnItemStack != null && slot.getItem().getDisplayName()
.equals(votingInterface.returnItemStack.getDisplayName())) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class VersionedVotingLink extends VotingLink {
public ItemStack returnItemStack;
private LocalPlayer player = null;
private final Task starter = Task.builder(() -> {
this.returnItemStack = null;
this.openVotingMenu(player, this.hotbarSlotIndex);

VotePair votePair = this.getNextVotePair();
Expand Down Expand Up @@ -119,7 +120,7 @@ public void run() {
AbstractContainerMenu menu = player.containerMenu;
if (menu instanceof ChestMenu) {
Slot slot = menu.getSlot(votingInterface.returnIndex);
if (slot.getItem().getDisplayName()
if (votingInterface.returnItemStack != null && slot.getItem().getDisplayName()
.equals(votingInterface.returnItemStack.getDisplayName())) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class VersionedVotingLink extends VotingLink {
public ItemStack returnItemStack;
private LocalPlayer player = null;
private final Task starter = Task.builder(() -> {
this.returnItemStack = null;
this.openVotingMenu(player, this.hotbarSlotIndex);

VotePair votePair = this.getNextVotePair();
Expand Down Expand Up @@ -119,7 +120,7 @@ public void run() {
AbstractContainerMenu menu = player.containerMenu;
if (menu instanceof ChestMenu) {
Slot slot = menu.getSlot(votingInterface.returnIndex);
if (slot.getItem().getDisplayName()
if (votingInterface.returnItemStack != null && slot.getItem().getDisplayName()
.equals(votingInterface.returnItemStack.getDisplayName())) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class VersionedVotingLink extends VotingLink {
public ItemStack returnItemStack;
private LocalPlayer player = null;
private final Task starter = Task.builder(() -> {
this.returnItemStack = null;
this.openVotingMenu(player, this.hotbarSlotIndex);

VotePair votePair = this.getNextVotePair();
Expand Down Expand Up @@ -121,7 +122,7 @@ public void run() {
AbstractContainerMenu menu = player.containerMenu;
if (menu instanceof ChestMenu) {
Slot slot = menu.getSlot(votingInterface.returnIndex);
if (slot.getItem().getDisplayName()
if (votingInterface.returnItemStack != null && slot.getItem().getDisplayName()
.equals(votingInterface.returnItemStack.getDisplayName())) {
return;
}
Expand Down

0 comments on commit 18b7cb3

Please sign in to comment.