use of io.github.bananapuncher714.crafters.example.objects.CustomItemDisplay in project PublicCrafters by BananaPuncher714.
the class CraftingListener method onCraftDisplayUpdateEvent.
@EventHandler
public void onCraftDisplayUpdateEvent(CraftDisplayUpdateEvent event) {
CraftDisplay craftDisplay = event.getDisplay();
ItemDisplay display = craftDisplay.getItemDisplays().get(4);
if (display == null) {
return;
}
Material result = craftDisplay.getInventory().getResult().getType();
if ((result != Material.DIAMOND_CHESTPLATE && display instanceof CustomItemDisplay) || (!(display instanceof CustomItemDisplay) && display.getItem().getType() == Material.DIAMOND && result == Material.DIAMOND_CHESTPLATE)) {
event.getDisplay().update(1, 1, true);
}
}
Aggregations