[ci skip] Add more patch identifying comments

This commit is contained in:
Nassim Jahnke
2024-01-16 12:41:40 +01:00
parent 73b42e843e
commit 22185798a5
41 changed files with 176 additions and 171 deletions

View File

@@ -13,12 +13,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public boolean canOpen(Player player) {
- return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName());
+ return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName(), this); // Paper
+ return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName(), this); // Paper - Add BlockLockCheckEvent
}
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper - Add BlockLockCheckEvent
public static boolean canUnlock(Player player, LockCode lock, Component containerName) {
+ // Paper start
+ // Paper start - Add BlockLockCheckEvent
+ return canUnlock(player, lock, containerName, null);
+ }
+ public static boolean canUnlock(Player player, LockCode lock, Component containerName, @Nullable BlockEntity blockEntity) {
@@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return true;
+ }
+ } else { // logic below is replaced by logic above
+ // Paper end
+ // Paper end - Add BlockLockCheckEvent
if (!player.isSpectator() && !lock.unlocksWith(player.getMainHandItem())) {
- player.displayClientMessage(Component.translatable("container.isLocked", containerName), true);
+ player.displayClientMessage(Component.translatable("container.isLocked", containerName), true); // Paper - diff on change
@@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} else {
return true;
}
+ } // Paper
+ } // Paper - Add BlockLockCheckEvent
}
@Nullable
@@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory, Player player) {
- return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName()) ? new BeaconMenu(syncId, playerInventory, this.dataAccess, ContainerLevelAccess.create(this.level, this.getBlockPos())) : null;
+ return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName(), this) ? new BeaconMenu(syncId, playerInventory, this.dataAccess, ContainerLevelAccess.create(this.level, this.getBlockPos())) : null;
+ return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName(), this) ? new BeaconMenu(syncId, playerInventory, this.dataAccess, ContainerLevelAccess.create(this.level, this.getBlockPos())) : null; // Paper - Add BlockLockCheckEvent
}
@Override