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 @@ -1274,6 +1274,12 @@ private static <T extends Event & Cancellable> void handleBlockRightClick(T even
return;
}

// Handle created cushions
if (item != null && Materials.isCushion(item.getType())) {
Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), EntityType.CUSHION));
return;
}

// Handle created armor stands
if (item != null && item.getType() == Material.ARMOR_STAND) {
Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), EntityType.ARMOR_STAND));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,16 @@ public static boolean isBoat(Material material) {
return Tag.ITEMS_BOATS.isTagged(material);
}

/**
* Test whether the given material is a Cushion.
*
* @param material the material
* @return true if a Cushion item
*/
public static boolean isCushion(Material material) {
return Tag.ITEMS_CUSHIONS.isTagged(material);
}

/**
* Test whether the given material is a Shulker Box.
*
Expand Down
Loading