mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-05 16:07:56 +01:00
Standardize the default resolver of entities/blocks to 'target'.
This commit is contained in:
parent
69940f2fac
commit
cbcc524798
@ -284,7 +284,7 @@ public void onPlayerJoin(PlayerJoinEvent event) {
|
|||||||
// RuleLists
|
// RuleLists
|
||||||
RuleSet rules = wcfg.getRuleList().get(KnownAttachment.PLAYER_JOIN);
|
RuleSet rules = wcfg.getRuleList().get(KnownAttachment.PLAYER_JOIN);
|
||||||
BukkitContext context = new BukkitContext(event);
|
BukkitContext context = new BukkitContext(event);
|
||||||
context.setSourceEntity(player);
|
context.setTargetEntity(player);
|
||||||
rules.process(context);
|
rules.process(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
public interface EntityResolver extends Resolver {
|
public interface EntityResolver extends Resolver {
|
||||||
|
|
||||||
public static final String DEFAULT = "source";
|
public static final String DEFAULT = "target";
|
||||||
|
|
||||||
public Entity resolve(Context context);
|
public Entity resolve(Context context);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
- ?has-permission: worldguard.auto-invincible
|
- ?has-permission: worldguard.auto-invincible
|
||||||
then:
|
then:
|
||||||
- ?: update-entity
|
- ?: update-entity
|
||||||
|
entity: target
|
||||||
set-invincible: true
|
set-invincible: true
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
@ -17,9 +18,13 @@
|
|||||||
- when: block-break
|
- when: block-break
|
||||||
if:
|
if:
|
||||||
- ?: match-item
|
- ?: match-item
|
||||||
|
entity: source
|
||||||
|
item: held
|
||||||
has-data: true
|
has-data: true
|
||||||
then:
|
then:
|
||||||
- ?: update-item
|
- ?: update-item
|
||||||
|
entity: source
|
||||||
|
item: held
|
||||||
set-data: 0
|
set-data: 0
|
||||||
- setting: protection.disable-xp-orb-drops
|
- setting: protection.disable-xp-orb-drops
|
||||||
rules:
|
rules:
|
||||||
@ -72,6 +77,7 @@
|
|||||||
- when: block-physics
|
- when: block-physics
|
||||||
if:
|
if:
|
||||||
- ?match-block: gravel
|
- ?match-block: gravel
|
||||||
|
block: target
|
||||||
then:
|
then:
|
||||||
- ?: cancel
|
- ?: cancel
|
||||||
- setting: physics.no-physics-sand
|
- setting: physics.no-physics-sand
|
||||||
@ -79,6 +85,7 @@
|
|||||||
- when: block-physics
|
- when: block-physics
|
||||||
if:
|
if:
|
||||||
- ?match-block: sand
|
- ?match-block: sand
|
||||||
|
block: target
|
||||||
then:
|
then:
|
||||||
- ?: cancel
|
- ?: cancel
|
||||||
- setting: physics.no-physics-portal
|
- setting: physics.no-physics-portal
|
||||||
@ -86,6 +93,7 @@
|
|||||||
- when: block-physics
|
- when: block-physics
|
||||||
if:
|
if:
|
||||||
- ?match-block: portal
|
- ?match-block: portal
|
||||||
|
block: target
|
||||||
then:
|
then:
|
||||||
- ?: cancel
|
- ?: cancel
|
||||||
- setting: physics.disable-water-damage-blocks
|
- setting: physics.disable-water-damage-blocks
|
||||||
@ -148,7 +156,7 @@
|
|||||||
- ?match-entity: [player]
|
- ?match-entity: [player]
|
||||||
entity: source
|
entity: source
|
||||||
- ?match-item: lighter
|
- ?match-item: lighter
|
||||||
slot: held
|
# context.item
|
||||||
- ?has-permission: worldguard.override.lighter
|
- ?has-permission: worldguard.override.lighter
|
||||||
negate: true
|
negate: true
|
||||||
then:
|
then:
|
||||||
@ -351,7 +359,6 @@
|
|||||||
- when: entity-spawn
|
- when: entity-spawn
|
||||||
if:
|
if:
|
||||||
- ?match-spawn: plugin
|
- ?match-spawn: plugin
|
||||||
entity: target
|
|
||||||
then:
|
then:
|
||||||
- ?: cancel
|
- ?: cancel
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user