mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-10-02 06:44:39 +00:00
Throw meaningful exception when item not found
This commit is contained in:
parent
85111f25cb
commit
1e381a59be
|
@ -101,7 +101,12 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb {
|
|||
|
||||
@Override
|
||||
public ItemStack get(final String id) throws Exception {
|
||||
ItemData data = Objects.requireNonNull(getByName(id));
|
||||
ItemData data = getByName(id);
|
||||
|
||||
if (data == null) {
|
||||
throw new Exception(tl("unknownItemName", id));
|
||||
}
|
||||
|
||||
PotionData potionData = data.getPotionData();
|
||||
Material material = data.getMaterial();
|
||||
|
||||
|
|
Loading…
Reference in a new issue