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

Implement fill action #1103

Merged
merged 2 commits into from
Nov 26, 2022
Merged

Implement fill action #1103

merged 2 commits into from
Nov 26, 2022

Conversation

Pablete1234
Copy link
Member

@Pablete1234 Pablete1234 commented Nov 22, 2022

Adds a <fill> action that will place blocks in a block-bounded region.

  • region (required) as property (either attribute, or children). If there's multiple children, they're considered a union.
  • material (required) as attribute. Can be a material pattern like wool:15.
  • filter (optional) as attribute. Filter what blocks get affected. ⚠️ may impact performance for large fills.
  • events="true" (optional) as attribute, defaults to false. ⚠️ May impact performance for large fills.
    • If set to true, events will be called for block placements & block removals, meaning they will be affected by filters and can affect other pgm features (eg: they can cause damage to a destroyable).

The fill action works on the match scope.

Simple example:

<actions>
  <fill id="fill-with-air" region="some-region" material="air"/>
</actions>

Actual example, fills-in the region with water when any player is inside, and sets air when no one remains:

<actions>
  <fill id="fill-air" region="watery-region" material="air"/>
  <fill id="fill-water" region="watery-region" material="water"/>
  
  <trigger filter="has-players" action="fill-water" scope="match"/>	
  <trigger filter="no-players" action="fill-air" scope="match"/>
</actions>

<filters>
  <not id="no-players">
    <players id="has-players" filter="watery-region"/>
  </not>
</filters>

Electroid
Electroid previously approved these changes Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants