mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Explicitly disallow registering two SFItems with same ID
This commit is contained in:
parent
04bdac8462
commit
c14aba1e6b
@ -221,6 +221,7 @@ public class SlimefunItem {
|
||||
public void register(boolean slimefun) {
|
||||
this.addon = !slimefun;
|
||||
try {
|
||||
if (map_id.containsKey(this.id)) throw new IllegalArgumentException("ID " + this.id + " already exists");
|
||||
if (this.recipe.length < 9) this.recipe = new ItemStack[] {null, null, null, null, null, null, null, null, null};
|
||||
all.add(this);
|
||||
|
||||
@ -273,6 +274,7 @@ public class SlimefunItem {
|
||||
}
|
||||
} catch(Exception x) {
|
||||
System.err.println("[Slimefun] Item Registration failed: " + this.id);
|
||||
x.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user