MrScautHD

Untitled

Oct 31st, 2020
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. import software.bernie.geckolib.entity.IAnimatedEntity;
  2. import software.bernie.geckolib.animation.builder.AnimationBuilder;
  3.  
  4. import net.minecraft.entity.Entity;
  5.  
  6. import net.mcreator.test.TestModElements;
  7.  
  8. import java.util.Map;
  9.  
  10. @TestModElements.ModElement.Tag
  11. public class TadfProcedure extends TestModElements.ModElement {
  12. public TadfProcedure(TestModElements instance) {
  13. super(instance, 3);
  14. }
  15.  
  16. public static void executeProcedure(Map<String, Object> dependencies) {
  17. if (dependencies.get("entity") == null) {
  18. if (!dependencies.containsKey("entity"))
  19. System.err.println("Failed to load dependency entity for procedure Tadf!");
  20. return;
  21. }
  22. Entity entity = (Entity) dependencies.get("entity");
  23. if (entity instanceof IAnimatedEntity) {
  24. new Object() {
  25. void playAnimation(Entity entity, String animationID) {
  26. IAnimatedEntity aniEntity = (IAnimatedEntity) entity;
  27. aniEntity.getAnimationManager().get("controller").setAnimation(new AnimationBuilder().addAnimation(animationID, (false)));
  28. }
  29. }.playAnimation(entity, "animation.rockettier1.fly");
  30. }
  31. }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment