Walking on Water

Discussion in 'Plugin Development' started by avent4dor, Oct 10, 2015.

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

    avent4dor

    As I do so that when a user tread water changes to ice, but the ice is temporary and then change the original block
     
  2. Offline

    Zombie_Striker

    @avent4dor
    1. Create an arraylist for blocks
    2. Create a runnable that will repeat after 0.25 seconds (5 ticks)
    3. Loop through all the blocks in the arraylist. This will contain all the blocks that are ice, so you would loop through them all, set the block back to stationairy/still water and than clear the array
    4. Loop through all the players online
    5. set the block under their feed (if it is water) to ice
    6. Add that block to the arraylist.
    7. ???
    8. profit
     
  3. Offline

    teej107

    whyyyyyyyy!?!?
     
    boomboompower likes this.
  4. Offline

    Hex_27

    @Zombie_Striker ALL the blocks???? I know people say I worry too much about lag that hasn't happened yet, but looping through your world's hundred thousands of blocks every time a player moves WILL LAG
     
  5. Offline

    Zombie_Striker

    @teej107
    Because those instances of the block's location need to be saved somewhere. Although it could be saved to a Collection , Map or even a config, but an arraylist is "easier" and gets the job done.


    @Hex_27
    Wrong
    All the blocks in the ARRAYLIST. Unless there are a hundred thousand players online (which then this one plugin would be the ONLY thing that would cause lag), there will just be the same amount of blocks in that arraylist as players online.
     
  6. Offline

    avent4dor


    I want something like this video, give me a code please
     
  7. Offline

    Zombie_Striker

    @avent4dor
    HA HA HA, That's not going to happen on this forum.

    And we should not have to watch a video to understand what you want.

    Also, I already gave a step-by-step process of what to do.
     
  8. Offline

    teej107

    Look at my status on my profile.
    The Plugin Requests section is what you need.
     
  9. Offline

    Zombie_Striker

    @teej107
    Then what should be used? What would be a better way of storing the location (besides arraylists and maps/collections, I have no idea what you're think of)?
     
  10. Offline

    teej107

    @Zombie_Striker What if I told you that an ArrayList is a Collection? It is! Many different Collections behave differently and have their strengths and weaknesses. I would think about sticking with a Set, preferably a HashSet.
     
    Zombie_Striker likes this.
Thread Status:
Not open for further replies.

Share This Page