mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-26 14:25:20 +00:00
Fall back to the default icon provider if null is returned from ICraftingIconProvider, handle renamed interfaces in the crafting tree view (#306)
* Fall back to the default icon provider if null is returned from ICraftingIconProvider * Handle renamed interfaces in the crafting tree view
This commit is contained in:
1 parent
2a08134ad6
commit
fe3f2756ec
1 file changed
+12
-2
@@ -1050,7 +1050,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
}
|
||||
|
||||
if (directedTile instanceof ICraftingIconProvider) {
|
||||
return ((ICraftingIconProvider) directedTile).getMachineCraftingIcon();
|
||||
final ItemStack icon = ((ICraftingIconProvider) directedTile).getMachineCraftingIcon();
|
||||
if (icon != null) {
|
||||
if (customName != null) {
|
||||
icon.setStackDisplayName(customName);
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
|
||||
final InventoryAdaptor adaptor = InventoryAdaptor.getAdaptor(directedTile, direction.getOpposite());
|
||||
@@ -1108,7 +1114,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
|
||||
final Item item = Item.getItemFromBlock(directedBlock);
|
||||
if (item != null) {
|
||||
return new ItemStack(item);
|
||||
final ItemStack icon = new ItemStack(item);
|
||||
if (customName != null) {
|
||||
icon.setStackDisplayName(customName);
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user