mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
Fix TargetHitEvent#getSignalStrength() post-hard-fork (#11897)
This commit is contained in:
parent
6ab13521b7
commit
33a590bca6
1 changed files with 4 additions and 4 deletions
|
@ -20,12 +20,12 @@
|
||||||
+ if (projectile instanceof Projectile) {
|
+ if (projectile instanceof Projectile) {
|
||||||
+ final org.bukkit.craftbukkit.block.CraftBlock craftBlock = org.bukkit.craftbukkit.block.CraftBlock.at(level, hit.getBlockPos());
|
+ final org.bukkit.craftbukkit.block.CraftBlock craftBlock = org.bukkit.craftbukkit.block.CraftBlock.at(level, hit.getBlockPos());
|
||||||
+ final org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(hit.getDirection());
|
+ final org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(hit.getDirection());
|
||||||
+ final io.papermc.paper.event.block.TargetHitEvent targetHitEvent = new io.papermc.paper.event.block.TargetHitEvent((org.bukkit.entity.Projectile) projectile.getBukkitEntity(), craftBlock, blockFace, i);
|
+ final io.papermc.paper.event.block.TargetHitEvent targetHitEvent = new io.papermc.paper.event.block.TargetHitEvent((org.bukkit.entity.Projectile) projectile.getBukkitEntity(), craftBlock, blockFace, redstoneStrength);
|
||||||
+ if (targetHitEvent.callEvent()) {
|
+ if (targetHitEvent.callEvent()) {
|
||||||
+ i = targetHitEvent.getSignalStrength();
|
+ redstoneStrength = targetHitEvent.getSignalStrength();
|
||||||
+ shouldAward = true;
|
+ shouldAward = true;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return i;
|
+ return redstoneStrength;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - Add TargetHitEvent
|
+ // Paper end - Add TargetHitEvent
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
+
|
+
|
||||||
+ // Paper start - Award Hit Criteria after Block Update
|
+ // Paper start - Award Hit Criteria after Block Update
|
||||||
+ if (shouldAward) {
|
+ if (shouldAward) {
|
||||||
+ awardTargetHitCriteria((Projectile) projectile, hit, i);
|
+ awardTargetHitCriteria((Projectile) projectile, hit, redstoneStrength);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - Award Hit Criteria after Block Update
|
+ // Paper end - Award Hit Criteria after Block Update
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue