Advertisement
Creepinson

Untitled

Jun 20th, 2017
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. package me.creepinson.main;
  2.  
  3. import me.creepinson.entities.EntityCreepino;
  4. import me.creepinson.entities.ai.EntityAIAttackMelee;
  5. import me.creepinson.lib.IProxy;
  6. import net.minecraft.entity.EntityLiving;
  7. import net.minecraft.util.ResourceLocation;
  8. import obsidianAPI.ObsidianAPIUtil;
  9. import obsidianAPI.animation.wrapper.FunctionAnimationWrapper.IsActiveFunction;
  10. import obsidianAPI.registry.AnimationRegistry;
  11.  
  12. public class CommonProxy implements IProxy {
  13. public void registerRenders() {
  14.  
  15. }
  16.  
  17. @Override
  18. public void preInit() {
  19.  
  20. }
  21.  
  22.  
  23. @Override
  24. public void init() {
  25.  
  26. registerAnimations();
  27. registerRenders();
  28.  
  29. }
  30.  
  31. @Override
  32. public void postInit() {
  33.  
  34.  
  35. }
  36.  
  37. public void registerAnimations(){
  38. IsActiveFunction isWalking = (entity) -> {
  39. return ObsidianAPIUtil.isEntityMoving(entity) && !entity.isSprinting() && !entity.isSneaking() && entity.onGround;
  40. };
  41. IsActiveFunction returnTrue = (entity) -> {
  42. return true;
  43. };
  44. IsActiveFunction isAttacking = (entity) -> {
  45. if(entity instanceof EntityLiving) {
  46. EntityLiving entityLiving = (EntityLiving) entity;
  47. return ObsidianAPIUtil.isEntityAITaskActive(entityLiving, EntityAIAttackMelee.name);
  48. }
  49. return false;
  50. };
  51.  
  52.  
  53. AnimationRegistry.registerEntity(EntityCreepino.class, "Creepino");
  54. AnimationRegistry.registerAnimation("Creepino", "idle", new ResourceLocation("meepersplus:animations/creepinoidle.oba"), 100, true, returnTrue);
  55. AnimationRegistry.registerAnimation("Creepino", "walk", new ResourceLocation("meepersplus:animations/creepinowalk.oba"), 50, true, isWalking);
  56. AnimationRegistry.registerAnimation("Creepino", "bite", new ResourceLocation("meepersplus:animations/creepinobite.oba"), 10, false, isAttacking);
  57.  
  58.  
  59.  
  60. }
  61.  
  62.  
  63.  
  64. public static void registerModelBakeryVarients() {
  65.  
  66. }
  67.  
  68. public void registerModelBakeryStuff() {
  69.  
  70. }
  71.  
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement