mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-19 03:39:18 +00:00
Better error messages for metadynamic
This commit is contained in:
1 parent
b4be5592da
commit
9323d898ab
1 file changed
+6
-3
@@ -48,10 +48,13 @@ public class ItemMetaDynamic extends Item {
|
||||
* @return An itemstack representing the Item-Meta combination.
|
||||
*/
|
||||
public ItemStack addMeta(int meta, String name) {
|
||||
if(meta > MAX || isValid(meta)) {
|
||||
throw new IllegalArgumentException(String
|
||||
.format("Metadata too high, highest supported value is %d. Meta was %d", MAX, meta));
|
||||
if(meta > MAX) {
|
||||
throw new IllegalArgumentException(String.format("Metadata for %s too high, highest supported value is %d. Meta was %d", name, MAX, meta));
|
||||
}
|
||||
else if(isValid(meta)) {
|
||||
throw new IllegalArgumentException(String.format("Metadata for %s is already taken. Meta %d is %s", name, meta, names.get(meta)));
|
||||
}
|
||||
|
||||
if(meta > maxMeta) {
|
||||
maxMeta = meta;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user