Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ public InteractionResult onBlockDispense(
return InteractionResult.PASS;
}
Item type = stackToDispense.getItem();
switch (type.toString().toUpperCase().substring(type.toString().indexOf(":"))) {
switch (BuiltInRegistries.ITEM.getKey(type).getPath().toUpperCase()) {
case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX",
"YELLOW_SHULKER_BOX", "LIME_SHULKER_BOX", "PINK_SHULKER_BOX", "GRAY_SHULKER_BOX", "LIGHT_GRAY_SHULKER_BOX",
"CYAN_SHULKER_BOX", "PURPLE_SHULKER_BOX", "BLUE_SHULKER_BOX", "BROWN_SHULKER_BOX", "GREEN_SHULKER_BOX",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1456,8 +1456,8 @@ public InteractionResult onTrample(
return InteractionResultHolder.pass(ItemStack.EMPTY);
}*/

public InteractionResult onBucketEmpty(Player player, Level level, BlockPos blockPos, BlockHitResult hitResult) {
if (player.getUseItem().getItem() instanceof BucketItem bucketItem && player instanceof ServerPlayer serverPlayer) {
public InteractionResult onBucketEmpty(@Nullable Player player, Level level, BlockPos blockPos, BlockHitResult hitResult) {
if (player instanceof ServerPlayer serverPlayer && player.getUseItem().getItem() instanceof BucketItem bucketItem) {
Direction direction = hitResult.getDirection();
// Note: a month after Bukkit 1.14.4 released, they added the API method
// PlayerBucketEmptyEvent#getBlock(), which returns the block the
Expand Down