mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
Manually calculate horses' jump power due to horse jumping being moved clientside
This commit is contained in:
parent
76c04254c1
commit
4ca1f89907
@ -99,12 +99,18 @@
|
|||||||
AttributeInstance attributeinstance = this.getAttributeMap().a("Speed");
|
AttributeInstance attributeinstance = this.getAttributeMap().a("Speed");
|
||||||
|
|
||||||
if (attributeinstance != null) {
|
if (attributeinstance != null) {
|
||||||
@@ -1145,6 +1168,12 @@
|
@@ -1145,6 +1168,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void b(int i) {
|
public void b(int i) {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callHorseJumpEvent(this, this.jumpPower);
|
+ float power;
|
||||||
|
+ if (i >= 90) {
|
||||||
|
+ power = 1.0F;
|
||||||
|
+ } else {
|
||||||
|
+ power = 0.4F + 0.4F * (float) i / 90.0F;
|
||||||
|
+ }
|
||||||
|
+ org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callHorseJumpEvent(this, power);
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
|
Loading…
Reference in New Issue
Block a user