mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 14:14:46 +00:00
Moved model scale parts into a single ModelScale class, similar to ModelRotate.
Added NPC model data interfaces to the API.
This commit is contained in:
1 parent
2ef93dd35f
commit
f0b33cf913
63 files changed
+412
-283
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package noppes.npcs.entity.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.entity.data.IModelScale;
|
||||
import noppes.npcs.api.entity.data.IModelScalePart;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelScale implements IModelScale {
|
||||
public ModelScalePart head = new ModelScalePart();
|
||||
public ModelScalePart body = new ModelScalePart();
|
||||
public ModelScalePart arms = new ModelScalePart();
|
||||
public ModelScalePart legs = new ModelScalePart();
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
|
||||
compound.setTag("HeadConfig", head.writeToNBT());
|
||||
compound.setTag("BodyConfig", body.writeToNBT());
|
||||
compound.setTag("ArmsConfig", arms.writeToNBT());
|
||||
compound.setTag("LegsConfig", legs.writeToNBT());
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
head.readFromNBT(compound.getCompoundTag("HeadConfig"));
|
||||
body.readFromNBT(compound.getCompoundTag("BodyConfig"));
|
||||
arms.readFromNBT(compound.getCompoundTag("ArmsConfig"));
|
||||
legs.readFromNBT(compound.getCompoundTag("LegsConfig"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelScalePart getPart(int part) {
|
||||
switch (ValueUtil.CorrectInt(part,0,3)) {
|
||||
case 0:
|
||||
return head;
|
||||
case 1:
|
||||
return body;
|
||||
case 2:
|
||||
return arms;
|
||||
case 3:
|
||||
return legs;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user