Railcraft

Railcraft

34M Downloads

Nether Portal minecart "ghosts"

rjenkins8142 opened this issue ยท 8 comments

commented

I'm trying to setup a nether/overworld rail system and I'm encountering a very annoying issue that I can't seem to figure out.

It seems that when carts go through a nether portal, sometimes they leave behind invisible "ghost" versions of themselves. The issue is that on the return trip, the cart will hit that "ghost" and can't go past. With solid carts on, players can't walk through the area either. (They'll bounce off.) With solid carts off / register railcraft collision handler off, players can walk through the area just fine, but carts still encounter the invisible block and rebound.

I haven't been able to reproduce this on SSP, but I can pretty easily in SMP. On server reboot, the ghost blocks are gone, but reappear when carts go through the nether portal.

It might be some sort of inter-mod interaction, my plan is to strip everything out and try with just Railcraft / Buildcraft and see if I can duplicate the problem. But if you have any hints on what I might be doing wrong, or where to look to fix the problem, that'd be great. :)

Minecraft 1.6.4, Forge 953, Railcraft version 8.2.0.11, but the same thing happened with earlier 8.1.0.something also.

commented

Please try to duplicate with vanilla as well.

commented

I was able to duplicate this with just buildcraft and railcraft loaded. I'll do additional testing tonight with a fresh config to see if it's a config setting problem.

commented

I did try to duplicate with just Vanilla and Forge 953 and I wasn't able to duplicate it.

I'll be doing more testing tonight to be 100% sure. (Both with Vanilla and Railcraft only.)

It's critical to me for this to work consistently. I'm running a "lite" server (similar to Forgecraft 3), with no item / fluid teleportation. I'm curious if Forgecraft 3 has seen any similar issues. There didn't seem to be any in Direwolf20's videos, but he sometimes glosses over issues it seems. One of the main attractions to running a pack with no item teleportation is that it would force me to use more Railcraft tracks, which I've never really had a need to use very much in the past. But the inconsistencies with the Nether Portals are becoming very frustrating. I got one set of chest carts working after building / moving / rebuilding nether portals in slightly different locations until they worked, but it's extremely frustrating to move and rebuild portals in slightly different ways while trying to work around this issue, which is seemingly random.

commented

With pure Vanilla, I can't duplicate it. But with Forge 953 + any chunkloader (Railcraft World Anchor, Chicken Chunks, Immibis' Dimension Anchor), it's pretty consistent.

The "ghost" cart appears when it enters a forced-loaded chunk, it seems. This happens both with Railcraft and without Railcraft. (Without Railcraft, players aren't obstructed by the ghost cart, just carts are, so it's a little more subtle.) I'm pretty sure it's a ghost cart because of the fact that I'm not obstructed in Vanilla or when I turn off solid carts in Railcraft.

Without a chunk loader, the ghosting doesn't appear to happen. I can push a cart back and forth between each side without any problems.

The second I add a chunk loader (on the nether side for instance), I consistently get the "ghost" cart.

Since, I can get it to happen without Railcraft loaded, I guess it isn't a Railcraft bug. Maybe a Forge one?

commented

Hmm...yes it would be a Forge issue. I only hook into the Chunkloader code, Forge does the actual implementation.

commented

I've done more testing with this. I created a small Mod with it's own collisionHandler (I've never modded before, but I did stay at a Holiday Inn Express last night).

With this, I was able to verify that it is indeed a ghost version of the cart that somehow sticks around sometimes when entering a force-chuck loaded area.

In debugging, the ghost cart does have isDead set. So two simple changes in the CollisionHandler made the bug go away. (Or at least not interfere with players or carts any longer.)

At the top of the onEntityCollision() method, I originally used a similar check to what you do:

if ((cart.worldObj.isRemote) || (other == cart.riddenByEntity) || (other.isDead))
{
    return;
}

I changed that to:

if ((cart.worldObj.isRemote) || (other == cart.riddenByEntity) || (other.isDead) || (cart.isDead))
{
    return;
}

Then in the getBoundingBox() method of the class, I also added a cart.isDead check:

public AxisAlignedBB getBoundingBox(EntityMinecart cart)
{
    if (cart == null || cart.isDead)
    {
        return null;
    }
    return cart.boundingBox;        
}

It would be great if you could include those small tweaks to your collisionHandler class. I'm pretty sure they wouldn't have any real side affects.

Let me know what you think.

commented

Sure

commented

Thanks so much for adding this!