DevotedMC / Bastion

Minecraft plugin that allows players to place Citadel-reinforced blocks that stop block placement or enderpearl teleportation. Updated for Spigot 1.12
http://www.devotedmc.com
Other
2 stars 10 forks source link

If blocksToErode is set to some high positive value, it still allows 2 bastions to share damage #46

Open GavJenks opened 6 years ago

GavJenks commented 6 years ago

Presumably there's some sort of indexing error, using a 1 instead of a 0 or something. Or perhaps the usage of ++i instead of i++ is to blame? Not sure.

But yeah, for example, if you set blocksToErode to 10, and you put 5 bastions all overlapping each other, then it will take 2x the normal number of block placements to break them all. 1 bastion takes a normal intended amount of time to break, 2 bastions take 2x as long to break, 3 or more also take 2x as long to break.

So it's doing one iteration on the random loop "for free" for some reason.

Might or might not be the same never-actually-fixed-only-avoided issue as issue #16 in the civcraft repository here: https://github.com/Civcraft/Bastion/issues/16

ProgrammerDan commented 6 years ago

Visual inspection of the code doesn't reveal a cause, so I'll have to test this out. I rarely use anything other than -1 (for instance, civclassic's current "1000" setting is redundant and more expensive to run, he should just use -1) so for sure this code hasn't received much attention.