Giter Club home page Giter Club logo

Comments (4)

mg-1999 avatar mg-1999 commented on June 7, 2024

I will look into it sometime next week. Thanks for the report.

Op zo 13 dec. 2015 17:42 schreef Cem Gökmen [email protected]:

Hello,

I am using the TrainCarts plugin on a Spigot 188 server, and while I enjoy
the plugin very much and appreciate your work, I have a small problem with
it that I would like to solve

The problem is as follows: when the carts of a train are travelling (no
matter the speed) sometimes they start flipping back and forward randomly
This does not affect the motion of the entire train, but is a very ugly
visual glitch, especially when it comes to storage minecarts The handle
faces forward, then backward, then forward again, repeatedly every second

The most important result of this bug (or maybe an isolated, more severe
bug), however, is as follows: when a long train (let's say 10 carts)
powered using a furnace-minecart (either from the front, back, or middle,
no difference) makes a U-turn where the short section (the bottom of the
letter U) is shorter than the train (let's say 3 blocks), the train is
simultaneously facing two opposite directions at the same time As a result,
the direction calculation method fails, causing the furnace cart to
repeatedly switch directions of force This causes the entire train to start
going forward, backward, forward, backward; oscillating within the
U-corner, never getting out

Here is a YouTube video containing evidence of the second issue, it's very
easy to reproduce:
https://wwwyoutubecom/watch?v=9IRtlpXMZtc

I tried unsuccessfully to solve the issue, I'm really unfamiliar with the
source code and as such me fixing it would require a lot of extra time to
identify the source of the problem

Thank you for your help!
sultanskyman


Reply to this email directly or view it on GitHub
#35.

Met vriendelijk groeten,

Matthijs Giezenberg

from traincarts.

cgokmen avatar cgokmen commented on June 7, 2024

Actually, I realized that even without any other carts, the powered minecart behaves very weirdly. At the corner it keeps changing direction, and is very bugged - and also, when it is placed on the rail and fed with coal, it tends to go off in a random direction, instead of the direction you're facing like it's supposed to.

It's breaking a lot of things on the server, so if you guys have any ideas what might be causing this - I can even try to fix it myself.

from traincarts.

cgokmen avatar cgokmen commented on June 7, 2024

Alright, I have isolated the issue into two different parts of code.

The first problem is that the block in a cart (furnace, chest, etc) randomly changes direction during travel, especially on u-turns and 45-degree rails. This, however, does not affect its movement, and the direction property of the MinecartMember instance does not change, meaning it's a visual bug only, probably caused by something within the BKCommonLib library. This fix is outside my reach and I could not find the lines of code that were related to it.

The second problem is that the pushDirection property of a furnace minecart in the MinecartMemberFurnace class is incorrectly set at some turns. This is usually during turns where the minecart would eventually be facing the north/south direction. However, it doesn't make sense for a minecart to have a pushDirection property in the type of a BlockFace, when the only directions a powered minecart can push relative to the minecart's facing direction are forward, backward, and none.

As a result, I am submitting a pull request where I changed the pushDirection property to an integer that goes back and forth between -1, 0 and 1, representing reverse, no force, and forward respectively. This change also eliminates the need to update the pushDirection every time the minecart turns. With this fix, the problem of the infinite back-forward loop in the corner is also fixed.

I cannot think of any feature that would require the pushDirection to be a BlockFace like it is right now. If that is so, please review the pull request and merge it with the code. I will add to this issue any unexpected results this fix may cause, too.

from traincarts.

mg-1999 avatar mg-1999 commented on June 7, 2024

Good work! I haven't really looked deep into this but it is a nice thing to have it fixed now. Thank you.

from traincarts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.