Rewards will not disable in specific worlds.
FatherWh0 opened this issue · 14 comments
The rewards for mohhunting are not disabled in worlds specified in the config. In this example I enabled debugging and tped to a world called w_area51, listed in the config under both disabled-in-world and disable-achievements-in-worlds. There I spawned and killed mobs and received rewards.
log http://pastebin.com/jiCe0d4y
config http://pastebin.com/ATTfSW91
With each kill I received the msg "MobHunting disabled in ${huntworld}, but region allows mobhunting=allow. The global region is the only one I was in and it did not have the mobhunting flag set.
server Paper 1.10.2 build 870
MobHunting 3.4.7
I also tried setting the flag mobhunting deny on the global region but still received rewards and the same msg.
http://prnt.sc/ckpmy1
http://prnt.sc/ckpney
I'm sorry for the delay. I'm quite busy at the moment and not very motivated because of the MCStats discussion.
I think I have fixed the bug, so you now can disable mobhunting in some worlds again. There is one caveat: The worldguard flag MobHunting=allow does not work in the disabled worlds at the moment. This means that you cant enable mobhunting in a limited region if you have disabled MobHunting for the hole world.
Please test newest build on my Jenkins Server
Tested out build 124. When in a disabled world I receive the msg "MobHunting is disabled in this world by the Admin" and indeed no reward is dropped. However, in enabled worlds I receive "No reward: You are in a protected region with mob-damage=deny." I did test in two enabled worlds and verified I was not in a region and no flags were set on global.
We are half-way there. lol
http://prntscr.com/cnn1qv Your work is appreciated.
I found the error. I forgot to set the default value for mob-damage when no Region was present.
I only made a small change and I think it works now.
Please try Build 125
http://jenkins.lindegaard.one:8180/job/MobHunting/
On my test server it appears to work perfectly. I'll run it live and let you know if any bugs crawl out of the woodwork.
Edit
Enabled and disabled worlds are behaving normally both for mobs and pvp. Awesome job! :)
About the caveat, instead of disabling a world in the config I wonder if it could be disabled on the global region then enabled in a specific region. I tried to test this but I see MobHunting flag is disabled atm. Just a thought. lol
MobHunting=deny should work! Its only MobHunting=allow which does not work. The thing is that I am not allowed to createa customflag MobHunting=null in WorldGuard so I have to define the default value to true or false if no region is present or the flag (mobhunting) is not created. Because of this I have to choose if MobHunting=deny or MobHunting=allow should work and I decided deny is most important.
I will contact the dev of WorldGuard but I know from previous that he is not really interested in helping me with a custom flag. :-(
I'm assuming our plugin hooks WGCustomFlags which then hooks w.e. I'm guessing the limitation to boolean values is a part of w.e. and WGCF can't help. Do I have that right?
No you dont need wgcf to use the MobHunting flag. The limitation is in WG itself. I can create a custom flag with default value true or false, but not null.
Are you a developer?
Sadly no. I'm a server administrator by trade but the last thing I coded was php.. if you call that coding.
I believe it's safe to close this ticket. Everything is working as it should. Thx for your help. :)