Last active
September 19, 2015 01:27
-
-
Save chylex/efc86c98018067fadaec to your computer and use it in GitHub Desktop.
ItemStack block fix?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ItemStack{ | |
private final Block linkedBlock; | |
public ItemStack(Block block, ...){ | |
this(...); | |
this.block = linkedBlock; | |
} | |
public Item getItem(){ | |
if (linkedBlock != null && (delegate == null || delegate.get() == null)){ | |
delegate = new RegistryDelegate<Item>(Item.getItemFromBlock(linkedBlock)); | |
} | |
return delegate != null ? delegate.get() : null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment