Skip to content

Add self_placed block filter#84

Closed
Jeck wants to merge 1 commit intoAuxilor:masterfrom
Jeck:self_placed
Closed

Add self_placed block filter#84
Jeck wants to merge 1 commit intoAuxilor:masterfrom
Jeck:self_placed

Conversation

@Jeck
Copy link

@Jeck Jeck commented Feb 16, 2023

This PR adds a filter to check if a given block was placed by the player themself, not just by any player. It functions using the same basic functionality as "player_placed".

What good is a self_placed filter?

  • A skill that levels up when breaking other player's stuff, but not your own.
  • Weapons that deal bonus damage when standing on home turf.
  • Tools that mine your own blocks instantly.
  • Explosives that don't damage your own blocks
  • Probably other uses too.

How does it work?

The implementation relies on Auxilor/eco#243 this pull request.
TL;DR -- eco currently stores an integer "1" for any block placed by a player. The actual value stored is never checked, just its existence. I've taken advantage of that to store a value identifying the placing player instead.

@WillFP
Copy link
Member

WillFP commented Mar 25, 2023

Closing this because it's incompatible with v4

@WillFP WillFP closed this Mar 25, 2023
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.

3 participants