MLG-Fortress / PopulationDensity

The now-official repository of the PopulationDensity Bukkit plugin
https://dev.bukkit.org/projects/population-density
10 stars 10 forks source link

Posts protected but surrounding base area is not #73

Closed ichbinashh closed 4 years ago

ichbinashh commented 5 years ago

Hey, so I've just noticed that the posts themselves and any blocks at the same height are protected from any destruction but the surrounding base blocks are not. They can be destroyed by players and the blocks can be farmed as they do still regenerate upon a restart (or renaming the region).

This isn't a big problem, but I thought I should make you aware.

I'm running Paper 89, and this is my config to show it is set up to be protected - https://hastebin.com/apuyijuxuk.php

RoboMWM commented 5 years ago

what's your config.

Also need full paper version, not just build number.

ichbinashh commented 5 years ago

Paper(89) 1.14.2-R0.1-SNAPSHOT and my config is linked in the first post

RoboMWM commented 5 years ago

I believe

PostProtectionDistance default value is 5

ichbinashh commented 5 years ago

I had tried setting it 5 before posting this here and it was still giving me the same issue - my first thought was maybe it just wasn't protecting far enough but it doesn't seem to make a difference.

RoboMWM commented 5 years ago

posts themselves and any blocks at the same height are protected from any destruction but the surrounding base blocks are not.

Please explain what you mean by "post" vs "surrounding base blocks"

ichbinashh commented 5 years ago

So in my configuration, the "pillar" blocks (i.e logs and campfire) are protected and cannot be touched. The inner and outer rings (stone bricks) can be destroyed and collected, but spawn back on a reload.

RoboMWM commented 5 years ago

Hmm, and you tried larger sizes? I don't see why the logic would break on 1.14

ichbinashh commented 5 years ago

I did, yeah. I can try and test it again at some point when I get time

Cretezy commented 5 years ago

I'm also seeing this, v5.12, git-Paper-192.

Players can't place/break the glowstone and signs, nor the area over the stone bricks, but the stone bricks and any other block can be broken. I have my PostProtectionDistance set to 10

If you want to see it for yourself, either email me (GitHub profile) or Spigot (CraftThatBlock) and I'll show you in-game

RoboMWM commented 5 years ago

Ok, was able to reproduce. The issue isn't the radius, but that its protection ends 1 block too high. Which is odd, since nothing should've changed here...

RoboMWM commented 5 years ago

getHighestYBlockAt seems to have changed. It used to skip transparent blocks (as the javadocs claimed it used the server lighting code to determine this) - which means that this used to return the block below the sign. Since now the Y level the sign is at is now being returned, this will need to be adjusted to account for that.

https://github.com/MLG-Fortress/PopulationDensity/blob/5b5456d34a48d50ba18012a1d7b68026b8a9982e/src/me/ryanhamshire/PopulationDensity/BlockEventHandler.java#L315

RoboMWM commented 5 years ago

Hmm, in Paper you can specify what block is returned if you pass a HeightMap enum. I wonder what it defaults to. Can anyone spin up a test spigot server to see if PD works fine there to verify?

(Btw, in case anyone here doesn't know already, I do support Paper and will fix this for Paper - just want to know if my hypothesis is correct.)

Cretezy commented 5 years ago

I'll spin a Spigot server up later and let you know.

zedwick commented 4 years ago

I can confirm this issues is present when running a Spigot server.

As the javadocs seem to indicate this is not the expected behaviour for these methods, I have opened an issue for Spigot here: https://hub.spigotmc.org/jira/browse/SPIGOT-5523

Hopefully this will either be fixed in Spigot, or we can get confirmation that this is the new expected behaviour.