mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 19:59:56 +00:00
Fix Cloning Systems
This commit is contained in:
1 parent
9d65f3d20b
commit
3859bb70cb
8 files changed
+122
-5
No files matched your search
@@ -712,6 +712,8 @@ public class CustomEffectController implements ICustomEffectHandler {
|
||||
CustomEffect original = getCustomEffects().get(originalId);
|
||||
if (original == null) return null;
|
||||
|
||||
int originalCatId = categoryManager.getItemCategory(originalId);
|
||||
|
||||
NBTTagCompound nbt = original.writeToNBT(true);
|
||||
int newId = getUnusedId();
|
||||
nbt.setInteger("ID", newId);
|
||||
@@ -723,6 +725,10 @@ public class CustomEffectController implements ICustomEffectHandler {
|
||||
while (has(name)) name += "_";
|
||||
clone.name = name;
|
||||
|
||||
if (originalCatId > CategoryManager.UNCATEGORIZED_ID) {
|
||||
categoryManager.registerItem(newId, originalCatId);
|
||||
}
|
||||
|
||||
saveEffect(clone);
|
||||
return clone;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user