Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option for mob projectiles changing blocks in claims #2099

Merged

Conversation

Swordstone86
Copy link

Some builds that rely on mob projectiles changing blocks, like TNT-powered music disc farms where skeleton arrows must ignite TNT, are completely broken in claims. EntityEventHandler.handleProjectileChangeBlock handles these interactions but only allows projectiles to change blocks if:

  1. The area is unclaimed, or
  2. The projectile was shot by a player who is trusted in the claim, or
  3. The projectile was shot by a dispenser in the same claim.

There's no exception for mob projectiles and no way to allow mob projectiles to change blocks, so I went ahead and added a config option to do just that. This allows TNT music disc farms and other builds relying on the mechanic to work again, as tested on a Paper 1.20 server.

The default for this config value is false, which means default behavior is unchanged unless a server owner specifically toggles MobProjectilesChangeBlocks to true.

@RoboMWM RoboMWM added this to the 16.18.2 milestone Jul 7, 2023
@RoboMWM
Copy link

RoboMWM commented Jul 7, 2023

Given that other mob grief is allowed, I'm thinking this should be allowed by default too, thoughts?

@RoboMWM RoboMWM requested a review from Jikoo July 7, 2023 21:16
@Jikoo
Copy link
Collaborator

Jikoo commented Jul 7, 2023

Makes sense to me, it's such a niche thing. I guess we could run a target check to make sure the target is either a non-player or trusted if we want to be super safe. Honestly if we do that we probably shouldn't even include a config option.

@RoboMWM
Copy link

RoboMWM commented Jul 12, 2023

I guess we could run a target check to make sure the target is either a non-player or trusted if we want to be super safe.

To prevent elaborate player traps? Or am I understanding this wrong?

@Jikoo
Copy link
Collaborator

Jikoo commented Jul 12, 2023

I guess we could run a target check to make sure the target is either a non-player or trusted if we want to be super safe.

To prevent elaborate player traps? Or am I understanding this wrong?

To prevent luring skeletons into farms and breaking things with their arrows, for example. If we're guarding against the potential malicious usage I don't see why it needs a config option given how opinionated GP is in general.

@RoboMWM
Copy link

RoboMWM commented Jul 12, 2023

Ah. Do we do checks like that for e.g. creepers being lured in now too?

My current understanding is that mob-performed stuff, even with hostile mobs, are currently permissible since that's seen to be an issue with how the player has built their structures. E.g., mobs can trample crops.

@Jikoo
Copy link
Collaborator

Jikoo commented Jul 12, 2023

That's true, I guess this does fall under general mob grief, which GP does have config settings for.

@RoboMWM
Copy link

RoboMWM commented Oct 4, 2023

I'll want to revisit this sort of stuff with v17 - my thinking is to simplify config to either deny all or allow all, and have addons provide more granular controls later on.

@RoboMWM RoboMWM merged commit ee818cc into GriefPrevention:master Oct 4, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants