Skip to content
This repository has been archived by the owner on Oct 21, 2018. It is now read-only.

When "edit":false, can break blocks, cannot place blocks. #27

Open
markkrueg opened this issue Feb 5, 2016 · 8 comments
Open

When "edit":false, can break blocks, cannot place blocks. #27

markkrueg opened this issue Feb 5, 2016 · 8 comments

Comments

@markkrueg
Copy link

I have a fresh world. Spawn protection is set to 0. I am not op. I am not "bob". The config.yml file is set to defaults.This is my areas.json:

[{"name":"test","flags":{"edit":false,"god":true,"touch":true},"pos1":[137,1,162],"pos2":[153,127,172],"level":"world","whitelist":["bob"]}]

When standing at 143, 67, 164 I am able to break blocks. I am not able to PvP. I am not able to place blocks.

I should not be able to break blocks when edit is false; right?

# Config file for iProtector by LDX;

# Settings for unprotected areas in worlds without specific settings:
Default:

  # Keep players from getting hurt?
  God: false

  # Keep players from editing the world?
  Edit: false

  # Keep players from touching blocks and activating things like chests?
  Touch: false

# Settings for unprotected areas in individual worlds:
Worlds:

  world:

    # Keep players from getting hurt?
    God: false

    # Keep players from editing the world?
    Edit: false

    # Keep players from touching blocks and activating things like chests?
    Touch: false
@LukeDarling
Copy link
Owner

...and now I see why people get so confused, and also a flaw in the way events are fired in PocketMine...

@LukeDarling
Copy link
Owner

The edit flag is short for "Edit protection", although this will be changed soon. If you want to disable breaking and placing blocks, you must set edit to true. As for the placing blocks, there's nothing you can do but disable touch protection. When you place a block, PocketMine fires both a BlockPlaceEvent and a PlayerInteractEvent, so if either touch or edit is enabled, you will be unable to place blocks. I'll brainstorm for a while and see if I can think of a way around this, but if there is one, it won't be simple.

P.S. Thanks for the donation, much appreciated. 😁

@markkrueg
Copy link
Author

@LDX-MCPE Thanks for your thoughts on this; and I see the issue. I also will test further and brainstorm.

The difficulty is that I will likely have protected areas where I want people to be able to tap on a sign in a shop (EconomySell) or similar actions.

The donation should have come long ago; your work is incredibly helpful to so many.

@LukeDarling
Copy link
Owner

That problem doesn't exist in reverse, you don't have to worry about things such as sign shops not working. The PlayerInteractEvent fires first, and the BlockPlaceEvent doesn't even get called unless you're holding a block.

@LinuxLogo
Copy link

When will this be fixed? This seems to be a crucial issue

@LukeDarling
Copy link
Owner

@LinuxLogo It is a PocketMine issue. It either has to be fixed in PocketMine's code, or I will have to find a hacky workaround.

@LinuxLogo
Copy link

Find hacky way around it plz. Been waiting since the summer for this plugin to like.... ya kno.. work on my prison server. Meaning An area in the prison they need to be able to break. And the rest... welp put it together lmao

@markkrueg
Copy link
Author

Or the other alternative would maybe be to try to fix the PocketMine code directly? PMMP has resurrected PocketMine-MP development. @LDX-MCPE Do you have any ideas about how to fix the PM code? Or maybe just a general description of the bug on the forum would get the attention of one of the main developers?

Just a thought :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants