diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2021-08-26 18:14:38 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2021-08-26 18:14:38 +0200 |
commit | 6911f81fe51a1e0b61ac099638e9ce2039b100de (patch) | |
tree | 5253c70a1d7a6ff237f5b26efd7c6e370958cc6e /src/main/java/io | |
parent | b1fa15a4b7fc857f68b08d4ca6ba0b5a8ad21d99 (diff) | |
download | NotEnoughUpdates-6911f81fe51a1e0b61ac099638e9ce2039b100de.tar.gz NotEnoughUpdates-6911f81fe51a1e0b61ac099638e9ce2039b100de.tar.bz2 NotEnoughUpdates-6911f81fe51a1e0b61ac099638e9ce2039b100de.zip |
command block to open pv
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 08ef97a9..ea9994a7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -937,6 +937,16 @@ public class NEUEventListener { GuiChest eventGui = (GuiChest) guiScreen; ContainerChest cc = (ContainerChest) eventGui.inventorySlots; containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); + if(containerName.endsWith(" Profile")){ + Slot slot = new Slot(cc.getLowerChestInventory(), 34, cc.inventorySlots.get(34).xDisplayPosition, cc.inventorySlots.get(34).yDisplayPosition); + slot.putStack(Utils.createItemStack(Item.getItemFromBlock(Blocks.command_block), EnumChatFormatting.GREEN + "Profile Viewer", + EnumChatFormatting.YELLOW + "Click to open NEU profile viewer!")); + cc.inventorySlots.replaceAll(e -> { + if(e.getSlotIndex() == 34) + return slot; + return e; + }); + } } if(GuiCustomEnchant.getInstance().shouldOverride(containerName)) { @@ -1386,6 +1396,12 @@ public class NEUEventListener { GuiChest eventGui = (GuiChest) guiScreen; ContainerChest cc = (ContainerChest) eventGui.inventorySlots; containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); + if(containerName.endsWith(" Profile") && eventGui.getSlotUnderMouse() != null && eventGui.getSlotUnderMouse().getSlotIndex() == 34 && + Mouse.getEventButton() >= 0) { + event.setCanceled(true); + Utils.playPressSound(); + NotEnoughUpdates.INSTANCE.viewProfileRunnable.processCommand(null, new String[]{containerName.replaceAll("'s? Profile", "")}); + } } if(GuiCustomEnchant.getInstance().shouldOverride(containerName) && |