mirror of
https://github.com/PaperMC/Paper.git
synced 2024-10-30 23:39:58 +01:00
bc127ea819
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: eec4aab0 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent 205213c6 SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron CraftBukkit Changes: b8c522d5 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent f04a77dc SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron d1dbcebc SPIGOT-6653: Canceling snow bucket placement removes snow from bucket 4f34a67b #891: Fix scheduler task ID overflow and duplication issues Spigot Changes: d03d7f12 BUILDTOOLS-604: Rebuild patches
35 lines
1.9 KiB
Diff
35 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Wed, 25 Nov 2020 16:33:27 -0800
|
|
Subject: [PATCH] Added PlayerLoomPatternSelectEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
|
|
index 9bcab01324612a905b21623a09109d404f8dadf7..fbe481faa504e9504bde5ed7b5098eaf847f647a 100644
|
|
--- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java
|
|
+++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
|
|
@@ -166,7 +166,22 @@ public class LoomMenu extends AbstractContainerMenu {
|
|
@Override
|
|
public boolean clickMenuButton(net.minecraft.world.entity.player.Player player, int id) {
|
|
if (id > 0 && id <= BannerPattern.AVAILABLE_PATTERNS) {
|
|
- this.selectedBannerPatternIndex.set(id);
|
|
+ // Paper start
|
|
+ int enumBannerPatternTypeOrdinal = id;
|
|
+ io.papermc.paper.event.player.PlayerLoomPatternSelectEvent event = new io.papermc.paper.event.player.PlayerLoomPatternSelectEvent((Player) player.getBukkitEntity(), ((CraftInventoryLoom) getBukkitView().getTopInventory()), org.bukkit.block.banner.PatternType.getByIdentifier(BannerPattern.values()[id].getHashname()));
|
|
+ if (!event.callEvent()) {
|
|
+ ((Player) player.getBukkitEntity()).updateInventory();
|
|
+ return false;
|
|
+ }
|
|
+ for (BannerPattern nms : BannerPattern.values()) {
|
|
+ if (event.getPatternType().getIdentifier().equals(nms.getHashname())) {
|
|
+ enumBannerPatternTypeOrdinal = nms.ordinal();
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ ((Player) player.getBukkitEntity()).updateInventory();
|
|
+ this.selectedBannerPatternIndex.set(enumBannerPatternTypeOrdinal);
|
|
+ // Paper end
|
|
this.setupResultSlot();
|
|
return true;
|
|
} else {
|