Hi all, I am making a region plugin and I requite the corners to be marked by a block (can be defined in config but would be coloured wool) However I only want them visable to the player, therefore I believe this would start going into packets if im right? What would be the way to start doing this because the region will change size so i would need to move the position of these blocks. The way i want them to be moved is clicked on then click in the new position, is this possible? Cheers
NoLiver92 Yes. But keep in mind that if the player tries to break this block, regardless of whether the event was cancelled, the block will change back to what it is on the server side (or disappear if the block was actually broken, obviously).
FisheyLP wow thats alot simpler, last time i worked on bukkit that wasnt there. ok another quick question when a plater goes to place/brak a block in someone elses region, which is the best way to detect if they are in a region or not? The way i thought of was to get everybodys regions and check if it is within it, if not move to the next one but this server could have hundreds of players, this woild take time in my opinion. is there a better way of doing it? Thats understood, if i assigned metadata to the block underneath it - i could then see when it was broken by detecting the metadata? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
I would loop through every player and then loop through every regions and then through every location in the region and round the coordinates. Next check if the player is in the region
NoLiver92 I would think (depending on the size of the regions) that looping through 10K would not take longer than a second. You'll be fine with a couple hundred. As far as I can think, looping through all regions is the only way to do it.
Thats what I thought, I just wanted to check. This is depreciated, so theres a better way of doing it EDIT by Moderator: merged posts, please use the edit button instead of double posting.