Need help with the tornado and entities

Discussion in 'Plugin Development' started by LucasEmanuel, Nov 24, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    LucasEmanuel

    Hi, some of you might of seen my thread in the resource section:
    Spawn a tornado with zero client mods

    I need your help, the tornado isn't working as it should. As some have pointed out, the tornado doesn't pick up all of the blocks, it lifts them up then they immediately fall down again, the same goes for most entities.

    It is almost as if the entity-objects change every now and then for some entities making the tornado applying to calculated velocity to something else instead of the entities it has captured. If you can spot what I'm doing wrong or if there is something else in play here, I would love your help. :)

    EDIT:
    To show an example of what I'm talking about:
     
  2. Offline

    Jogy34

    You're attempting to get the entities within a bounding box of 1x1x1 centered at the vortex block (HERE). That basically means that it's only going to get any entity that it precisely at the center of the tornado when a new vortex block spawns (otherwise it'll be too high up). I would suggest using 3's in place of the 1's for your getNearbyEntities()
     
  3. Offline

    LucasEmanuel

    Not really, I do that check every call to the tick() method, meaning, every time the block is called to calculate a new velocity, it checks if there are any blocks in front of it that it might collide with or if there are any other entities at its current position. :)
     
  4. Offline

    Jogy34


    And entity positions are found at the bottom of it's bounding box at one point in one of the corners (I believe) meaning that if the falling sand entity is one pixel away from that point in the X, Y, or Z coordinates then it won't register that there is an entity there. Specifically the Y coordinate, that will go at least one pixel up probably almost every tick meaning that it has to be when a new vortex block is spawned directly on top of some other entity that it will pick them up.
     
  5. Offline

    LucasEmanuel

    The problem isn't really that it can't find any entities, the problem is that it doesn't update their velocities properly.

    If you watch the video, you can see that it tries to lift up several cows but the immediately fall down on the ground again and then stay there, that isn't supposed to happen.
     
  6. Offline

    Jogy34

    Just try it to see if it fixes it.
     
  7. Offline

    LucasEmanuel

    I don't think you understand the problem here. The cows are lifted up, meaning that they have been registered, meaning that a new VortexBlock has been created for each and everyone of those cows that got picked up, meaning that a reference to their entity-objects have been saved in each new VortexBlock. Still their velocity aren't updating, meaning something has gone wrong, either the cows have received a new Entity-object which is highly unlikely or there is something wrong when I'm trying to update their velocity, or Minecraft have stepped in at some point and stopped my code from updating their velocity some how.

    I just figured it out. Since I was calling the tick() method in both of the constructors I never caught the new VortexBlock's that where created and added them to the ticklist. :)

    Thanks for trying to help anyway. :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
Thread Status:
Not open for further replies.

Share This Page