Solved Look for block with x and z location and make circle

Discussion in 'Plugin Development' started by Dreeass, Jul 5, 2013.

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


    What I'm trying to do is look for all of the blocks in a vertical line, if the block is the same as the given block, draw a circle. When the circleMaterial and circleCenterMaterial objects are null, use the material stored in the HashMap to reset back to the materials there were before.

    Code: click here. Here is the output.

    This is what I'm using to test with, what happens is that only the block I selected changes to the surroundBlock material. There is a lapis block in the middle of every floor.
    What happens is that it changes the first time but when it has to reset those circles, it only resets the center of every circle.
  2. Offline


    .distance() is very slow because of the square root. use
    l.distanceSquared(location) <= radiusSquared
    radiusSquared = radius*radius;
  3. Offline


    The server kicked me out but didn't crash this time.

    This is the output when it shuts down when I don't use your method:
    06.07 09:20:54 [Server] SEVERE
    06.07 09:20:54 [Server] SEVERE Method)
    06.07 09:20:54 [Server] SEVERE Stack:
    06.07 09:20:54 [Server] SEVERE Locked
    06.07 09:20:54 [Server] SEVERE Locked
    06.07 09:20:54 [Server] SEVERE Locked
    06.07 09:20:54 [Server] SEVERE Thread is waiting on monitor(s):
    06.07 09:20:54 [Server] SEVERE PID: 20 | Suspended: false | Native: true | State: RUNNABLE
    06.07 09:20:54 [Server] SEVERE Current Thread: Netty IO Thread - 2
    06.07 09:20:54 [Server] SEVERE ------------------------------
    06.07 09:20:54 [Server] SEVERE Current Thread State:
    06.07 09:20:54 [Server] SEVERE Spigot version: git-Spigot-979 (MC: 1.6.1)
    06.07 09:20:54 [Server] SEVERE Be sure to include ALL relevant console errors and Minecraft crash reports
    06.07 09:20:54 [Server] SEVERE Please report this to
    06.07 09:20:54 [Server] SEVERE The server has stopped responding!
    I just rewrote the whole thing and added debug, I really don't know why it's not changing the blocks.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 3, 2016
  4. Offline


    Anyone? I still can't figure it out.
  5. do you want a circle or a sphere? I haven't read all of your code yet, but this came to mind.
  6. Offline


    I want a circle on the same level as the block given in in the void method. It looks for every block on those x and z coordinates and draws a circle around the block that has been found every time.

    Edit: I have added a lot of comments to help you get through the code
    Edit2: I have added the whole class.
    Edit3: Solved, but another bug has appeared. See thread.
Thread Status:
Not open for further replies.

Share This Page