From a08000eee42787807926d182b53d426037769e67 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 21 Oct 2024 15:41:11 -0500 Subject: [PATCH] crash fixes - fixed a crash on world load related to linking -fixed a crash related to item metadata. --- src/main/java/train/common/core/handlers/LinkHandler.java | 2 +- src/main/java/train/common/items/ItemRollingStock.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/train/common/core/handlers/LinkHandler.java b/src/main/java/train/common/core/handlers/LinkHandler.java index c9d2399e2..ce579978c 100644 --- a/src/main/java/train/common/core/handlers/LinkHandler.java +++ b/src/main/java/train/common/core/handlers/LinkHandler.java @@ -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)) { diff --git a/src/main/java/train/common/items/ItemRollingStock.java b/src/main/java/train/common/items/ItemRollingStock.java index dbfbaead1..c293977f0 100644 --- a/src/main/java/train/common/items/ItemRollingStock.java +++ b/src/main/java/train/common/items/ItemRollingStock.java @@ -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){