Skip to content

Commit

Permalink
crash fixes
Browse files Browse the repository at this point in the history
- fixed a crash on world load related to linking
-fixed a crash related to item metadata.
  • Loading branch information
EternalBlueFlame committed Oct 21, 2024
1 parent 13f4e7b commit a08000e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/train/common/core/handlers/LinkHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ private boolean canCartBeAdjustedBy(Entity cart1, Entity cart2) {
* Handles the cart coupling physics
*/
private void StakePhysic(AbstractTrains cart1, AbstractTrains cart2, int linkIndex) {
if (worldObj.isRemote || cart1.ticksExisted<5 || cart2.ticksExisted<5) {
if (worldObj.isRemote || cart1.bogieFront==null || cart2.bogieFront==null) {
return;
}
if (cart2.isAttached && cart1.isAttached && areLinked(cart2, cart1)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/train/common/items/ItemRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlaye
s.append(": ");
if (getEntity() instanceof Locomotive){
s.append(t("menu.item.locomotive")+", ");
if(getEntity().getRiderOffsets()!=null && entity.getRiderOffsets().length>0){
if(getEntity().getRiderOffsets()!=null && getEntity().getRiderOffsets().length>0){
s.append(t("menu.item.passenger")+", ");
}
if(getEntity().getInventoryRows()>0){
Expand Down

0 comments on commit a08000e

Please sign in to comment.