Standardize the default resolver of entities/blocks to 'target'.

This commit is contained in:
sk89q 2012-11-04 13:00:52 -08:00
parent 69940f2fac
commit cbcc524798
3 changed files with 14 additions and 7 deletions

View File

@ -284,7 +284,7 @@ public void onPlayerJoin(PlayerJoinEvent event) {
// RuleLists
RuleSet rules = wcfg.getRuleList().get(KnownAttachment.PLAYER_JOIN);
BukkitContext context = new BukkitContext(event);
context.setSourceEntity(player);
context.setTargetEntity(player);
rules.process(context);
}

View File

@ -25,7 +25,7 @@
public interface EntityResolver extends Resolver {
public static final String DEFAULT = "source";
public static final String DEFAULT = "target";
public Entity resolve(Context context);
}

View File

@ -5,6 +5,7 @@
- ?has-permission: worldguard.auto-invincible
then:
- ?: update-entity
entity: target
set-invincible: true
# ----------------------------------------------
@ -17,9 +18,13 @@
- when: block-break
if:
- ?: match-item
entity: source
item: held
has-data: true
then:
- ?: update-item
entity: source
item: held
set-data: 0
- setting: protection.disable-xp-orb-drops
rules:
@ -72,6 +77,7 @@
- when: block-physics
if:
- ?match-block: gravel
block: target
then:
- ?: cancel
- setting: physics.no-physics-sand
@ -79,6 +85,7 @@
- when: block-physics
if:
- ?match-block: sand
block: target
then:
- ?: cancel
- setting: physics.no-physics-portal
@ -86,6 +93,7 @@
- when: block-physics
if:
- ?match-block: portal
block: target
then:
- ?: cancel
- setting: physics.disable-water-damage-blocks
@ -148,7 +156,7 @@
- ?match-entity: [player]
entity: source
- ?match-item: lighter
slot: held
# context.item
- ?has-permission: worldguard.override.lighter
negate: true
then:
@ -351,7 +359,6 @@
- when: entity-spawn
if:
- ?match-spawn: plugin
entity: target
then:
- ?: cancel