Advertisement
sarxJava

WingsEntites

Jul 29th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. package net.msrandom.wings.entity;
  2.  
  3. import net.minecraft.entity.Entity;
  4. import net.minecraft.entity.EntityClassification;
  5. import net.minecraft.entity.EntityType;
  6. import net.minecraft.entity.passive.AnimalEntity;
  7. import net.minecraft.item.Item;
  8. import net.minecraft.item.SpawnEggItem;
  9. import net.minecraftforge.registries.DeferredRegister;
  10. import net.minecraftforge.registries.ForgeRegistries;
  11. import net.msrandom.wings.WingsAndClaws;
  12. import net.msrandom.wings.entity.item.MimangoEggEntity;
  13. import net.msrandom.wings.entity.item.PlowheadEggEntity;
  14. import net.msrandom.wings.entity.item.SaddledTailSpearEntity;
  15. import net.msrandom.wings.entity.monster.IcyPlowheadEntity;
  16. import net.msrandom.wings.entity.passive.DumpyEggDrakeEntity;
  17. import net.msrandom.wings.entity.passive.HatchetBeakEntity;
  18. import net.msrandom.wings.entity.passive.MimangoEntity;
  19. import net.msrandom.wings.item.WingsItems;
  20.  
  21. public class WingsEntities {
  22. public static final DeferredRegister<EntityType<?>> REGISTRY = new DeferredRegister<>(ForgeRegistries.ENTITIES, WingsAndClaws.MOD_ID);
  23.  
  24. public static final EntityType<SaddledTailSpearEntity> ST_SPEAR = create("spear_entity", SaddledTailSpearEntity::new, EntityClassification.MISC, 8, 8);
  25.  
  26.  
  27. private static <T extends AnimalEntity> EntityType<T> create(String name, EntityType.IFactory<T> factory, EntityClassification classification, float width, float height, int pri, int sec) {
  28. final Item.Properties properties = new Item.Properties().group(WingsItems.GROUP);
  29. EntityType<T> type = create(name, factory, classification, width, height);
  30. WingsItems.REGISTRY.register(name + "_spawn_egg", () -> new SpawnEggItem(type, pri, sec, properties));
  31. return type;
  32. }
  33.  
  34. private static <T extends Entity> EntityType<T> create(String name, EntityType.IFactory<T> factory, EntityClassification classification, float width, float height) {
  35. EntityType<T> type = EntityType.Builder.create(factory, classification).size(width, height).setTrackingRange(128).build(name);
  36. REGISTRY.register(name, () -> type);
  37. return type;
  38. }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement