Advertisement
Creepinson

Untitled

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