Skip to content

Commit

Permalink
add HORSE_BUCK animation to 1.13,1.14,1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 17, 2019
1 parent 265ddfe commit 0327e13
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Expand Up @@ -39,7 +39,7 @@ public class AnimateCommand extends AbstractCommand {
// <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/EntityEffect.html>
//
// In addition, Denizen adds a few new entity animations:
// SKELETON_START_SWING_ARM, SKELETON_STOP_SWING_ARM, POLAR_BEAR_START_STANDING, POLAR_BEAR_STOP_STANDING
// SKELETON_START_SWING_ARM, SKELETON_STOP_SWING_ARM, POLAR_BEAR_START_STANDING, POLAR_BEAR_STOP_STANDING, HORSE_BUCK
//
// Note that the above list only applies where logical, EG 'WOLF_' animations only apply to wolves.
//
Expand Down
Expand Up @@ -2,10 +2,12 @@

import com.denizenscript.denizen.nms.abstracts.AnimationHelper;
import com.denizenscript.denizen.nms.interfaces.EntityAnimation;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftHorse;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPolarBear;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftSkeleton;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Horse;

public class AnimationHelperImpl extends AnimationHelper {

Expand Down Expand Up @@ -42,5 +44,10 @@ public void play(Entity entity) {
}
}
});
register("HORSE_BUCK", entity -> {
if (entity instanceof Horse) {
((CraftHorse) entity).getHandle().dZ();
}
});
}
}
@@ -1,9 +1,11 @@
package com.denizenscript.denizen.nms.v1_14.helpers;

import com.denizenscript.denizen.nms.abstracts.AnimationHelper;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftHorse;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPolarBear;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftSkeleton;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Horse;

public class AnimationHelperImpl extends AnimationHelper {

Expand All @@ -28,5 +30,10 @@ public AnimationHelperImpl() {
((CraftPolarBear) entity).getHandle().r(false);
}
});
register("HORSE_BUCK", entity -> {
if (entity instanceof Horse) {
((CraftHorse) entity).getHandle().eu();
}
});
}
}
@@ -1,9 +1,11 @@
package com.denizenscript.denizen.nms.v1_15.helpers;

import com.denizenscript.denizen.nms.abstracts.AnimationHelper;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftHorse;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPolarBear;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftSkeleton;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Horse;

public class AnimationHelperImpl extends AnimationHelper {

Expand All @@ -28,5 +30,10 @@ public AnimationHelperImpl() {
((CraftPolarBear) entity).getHandle().r(false);
}
});
register("HORSE_BUCK", entity -> {
if (entity instanceof Horse) {
((CraftHorse) entity).getHandle().eP();
}
});
}
}

0 comments on commit 0327e13

Please sign in to comment.