mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 15:24:46 +00:00
Magic Packet Fixes
This commit is contained in:
1 parent
c2fa74c541
commit
4e6d6b7082
13 files changed
+177
-54
No files matched your search
@@ -2,6 +2,8 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.constants.EnumDiagramLayout;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
@@ -10,14 +12,17 @@ import java.util.HashMap;
|
||||
*/
|
||||
public class MagicCycle {
|
||||
public int id = -1;
|
||||
public String title = "";
|
||||
public String name = "";
|
||||
public String displayName = "";
|
||||
public EnumDiagramLayout layout = EnumDiagramLayout.CIRCULAR;
|
||||
public HashMap<Integer, MagicAssociation> associations = new HashMap<>();
|
||||
|
||||
public MagicCycle() {}
|
||||
|
||||
public void readNBT(NBTTagCompound compound) {
|
||||
id = compound.getInteger("CategoryID");
|
||||
title = compound.getString("Title");
|
||||
name = compound.getString("Name");
|
||||
displayName = compound.getString("DisplayName");
|
||||
layout = EnumDiagramLayout.values()[compound.getInteger("Layout")];
|
||||
associations.clear();
|
||||
NBTTagList list = compound.getTagList("Associations", 10); // compound tags
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
@@ -32,7 +37,9 @@ public class MagicCycle {
|
||||
|
||||
public void writeNBT(NBTTagCompound compound) {
|
||||
compound.setInteger("CategoryID", id);
|
||||
compound.setString("Title", title);
|
||||
compound.setString("Title", name);
|
||||
compound.setString("DisplayName", displayName);
|
||||
compound.setInteger("Layout", layout.ordinal());
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (MagicAssociation assoc : associations.values()) {
|
||||
NBTTagCompound assocTag = new NBTTagCompound();
|
||||
@@ -43,4 +50,40 @@ public class MagicCycle {
|
||||
}
|
||||
compound.setTag("Associations", list);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public EnumDiagramLayout getLayout() {
|
||||
return layout;
|
||||
}
|
||||
|
||||
public void setLayout(EnumDiagramLayout layout) {
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
public HashMap<Integer, MagicAssociation> getAssociations() {
|
||||
return associations;
|
||||
}
|
||||
|
||||
public void setAssociations(HashMap<Integer, MagicAssociation> associations) {
|
||||
this.associations = associations;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user