Skip to content

Commit 7387a0f

Browse files
committed
projectile_launch now has dispenser data in Paper 26.2
"shooter" can now be a dispenser block location and "shootertype" can now be "block". Previously they were always null when the projectile source was a dispenser.
1 parent ef93635 commit 7387a0f

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/main/java/com/laytonsmith/core/events/drivers/EntityEvents.java‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,9 @@ public String docs() {
518518
+ " For instance when a player shoots an arrow with a bow, if the event is cancelled the bow will"
519519
+ " still take damage from use."
520520
+ " {id: The entityID of the projectile | type: The entity type of the projectile |"
521-
+ " shooter: The entityID of the shooter (null if the projectile is launched by a dispenser) |"
522-
+ " shootertype: The entity type of the shooter (null if the projectile is launched by a dispenser) |"
521+
+ " shooter: entityID or dispenser location of the shooter (can be null for dispensers in Paper"
522+
+ " <=26.2 or any version of Spigot) | shootertype: entity type of the shooter or 'block' if a"
523+
+ " dispenser (can be null for dispensers in Paper <=26.2 or any version Spigot) |"
523524
+ " player: the player which has launched the projectile (null if the shooter is not a player) |"
524525
+ " location: from where the projectile is launched | velocity: the velocity of the projectile}"
525526
+ " {velocity}"
@@ -579,7 +580,7 @@ public Map<String, Mixed> evaluate(BindableEvent event) throws EventException {
579580
} else if(shooter instanceof MCBlockProjectileSource) {
580581
mapEvent.put("shooter", ObjectGenerator.GetGenerator().location(
581582
((MCBlockProjectileSource) shooter).getBlock().getLocation(), false));
582-
mapEvent.put("shootertype", new CString("BLOCK", Target.UNKNOWN));
583+
mapEvent.put("shootertype", new CString("block", Target.UNKNOWN));
583584
mapEvent.put("player", CNull.NULL);
584585
} else {
585586
mapEvent.put("shooter", CNull.NULL);

‎src/main/resources/docs/Upgrade_Guide‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Where possible, any value changes are converted for backwards compatibility with
55

66
== Minecraft 26.2 ==
77
* Damage causes HOT_FLOOR and CAMPFIRE for damage events now use CONTACT instead (Paper).
8+
* The projectile_launch event now properly gives a dispenser location for "shooter" (and "shootertype": "block") on Paper servers.
89

910
----
1011

0 commit comments

Comments
 (0)