Skip to content

Commit

Permalink
fix skinning
Browse files Browse the repository at this point in the history
  • Loading branch information
EternalBlueFlame committed Nov 25, 2023
1 parent 8b1df63 commit 13ffb0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/train/common/api/AbstractTrains.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public void setColor(int color) {
if (color == -1 || !trainRecord.getLiveries().contains(getColorAsString(color))) {
color = 0;
}
entity_data.stringMap.put("color", trainRecord.getLiveries().get(color));
entity_data.putString("color", trainRecord.getLiveries().get(color));
}
dataWatcher.updateObject(12, entity_data.toXMLString());
this.getEntityData().setString("xml", entity_data.toXMLString());
Expand All @@ -364,12 +364,12 @@ public void setColor(int color) {
public void setColor(String color) {
TrainRecord trainRecord = Traincraft.instance.traincraftRegistry.findTrainRecordByItem(getCartItem().getItem());
if (trainRecord != null && trainRecord.getLiveries() != null) {
if (color.equals("-1") || trainRecord.getLiveries().contains(color)) {
if (color.equals("-1") || !trainRecord.getLiveries().contains(color)) {
color = (trainRecord.getLiveries().get(0));
}
}

entity_data.stringMap.put("color", color);
entity_data.putString("color", color);
dataWatcher.updateObject(12, entity_data.toXMLString());
this.getEntityData().setString("xml", entity_data.toXMLString());
}
Expand Down

0 comments on commit 13ffb0c

Please sign in to comment.