mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 20:47:59 +01:00
Fixed exception when loading tail segments
This commit is contained in:
parent
032fb2719f
commit
52038d2d0c
4 changed files with 8 additions and 8 deletions
|
@ -23,10 +23,9 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
|
|
||||||
protected Wing legacyWing;
|
protected Wing legacyWing;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelContext context) {
|
||||||
pegasus = (T)context.getModel();
|
pegasus = context.getModel();
|
||||||
leftWing = context.findByName("left_wing");
|
leftWing = context.findByName("left_wing");
|
||||||
rightWing = context.findByName("right_wing");
|
rightWing = context.findByName("right_wing");
|
||||||
legacyWing = context.findByName("legacy_right_wing");
|
legacyWing = context.findByName("legacy_right_wing");
|
||||||
|
@ -92,7 +91,7 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelContext context) {
|
||||||
pegasus = (IPegasus)context.getModel();
|
pegasus = context.getModel();
|
||||||
extended = context.findByName("extended");
|
extended = context.findByName("extended");
|
||||||
folded = context.findByName("folded");
|
folded = context.findByName("folded");
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,9 @@ public class PonySnout implements IPart, MsonModel {
|
||||||
|
|
||||||
private ICapitated<ModelPart> head;
|
private ICapitated<ModelPart> head;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelContext context) {
|
||||||
head = (ICapitated<ModelPart>)context.getModel();
|
head = context.getModel();
|
||||||
mare = context.findByName("mare");
|
mare = context.findByName("mare");
|
||||||
stallion = context.findByName("stallion");
|
stallion = context.findByName("stallion");
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,15 +22,17 @@ public class PonyTail implements IPart, MsonModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelContext context) {
|
||||||
theModel = (AbstractPonyModel<?>)context.getModel();
|
theModel = context.getModel();
|
||||||
|
|
||||||
tail = new ModelPart(theModel);
|
tail = new ModelPart(theModel);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int segments = context.getLocals().getValue("segments").get().intValue();
|
int segments = context.getLocals().getValue("segments").get().intValue();
|
||||||
|
|
||||||
|
ModelContext subContext = context.resolve(this);
|
||||||
|
|
||||||
for (int i = 0; i < segments; i++) {
|
for (int i = 0; i < segments; i++) {
|
||||||
Segment segment = context.findByName("segment_" + i);
|
Segment segment = subContext.findByName("segment_" + i);
|
||||||
segment.index = i;
|
segment.index = i;
|
||||||
tail.addChild(segment);
|
tail.addChild(segment);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class SeaponyTail implements IPart, MsonModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelContext context) {
|
||||||
model = (IPonyModel<?>)context.getModel();
|
model = context.getModel();
|
||||||
tailBase = context.findByName("base");
|
tailBase = context.findByName("base");
|
||||||
tailTip = context.findByName("tip");
|
tailTip = context.findByName("tip");
|
||||||
tailFins = context.findByName("fins");
|
tailFins = context.findByName("fins");
|
||||||
|
|
Loading…
Reference in a new issue