2018-09-16 00:45:44 +02:00
|
|
|
package com.minelittlepony.unicopia;
|
|
|
|
|
|
|
|
import com.minelittlepony.unicopia.entity.EntityCloud;
|
|
|
|
import com.minelittlepony.unicopia.entity.EntityConstructionCloud;
|
|
|
|
import com.minelittlepony.unicopia.entity.EntityRacingCloud;
|
2018-09-21 17:53:33 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.EntitySpell;
|
2018-09-16 00:45:44 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityWildCloud;
|
|
|
|
import com.minelittlepony.unicopia.render.RenderCloud;
|
2018-09-21 17:53:33 +02:00
|
|
|
import com.minelittlepony.unicopia.render.RenderGem;
|
2018-09-16 00:45:44 +02:00
|
|
|
|
2018-09-21 17:53:33 +02:00
|
|
|
import net.minecraft.entity.Entity;
|
2018-09-16 00:45:44 +02:00
|
|
|
import net.minecraft.entity.EntityList.EntityEggInfo;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
|
|
|
import net.minecraftforge.fml.common.registry.EntityEntry;
|
|
|
|
import net.minecraftforge.registries.IForgeRegistry;
|
|
|
|
|
|
|
|
public class UEntities {
|
2018-09-21 17:53:33 +02:00
|
|
|
private static final int BRUSHES_ROYALBLUE = 0x4169E1;
|
|
|
|
private static final int BRUSHES_CHARTREUSE = 0x7FFF00;
|
2018-09-16 00:45:44 +02:00
|
|
|
|
|
|
|
static void init(IForgeRegistry<EntityEntry> registry) {
|
2018-09-21 17:53:33 +02:00
|
|
|
addEntity(registry, EntityCloud.class, "cloud", true, BRUSHES_ROYALBLUE, BRUSHES_CHARTREUSE);
|
|
|
|
addEntity(registry, EntityWildCloud.class, "wild_cloud", false, 0, 0);
|
|
|
|
addEntity(registry, EntityRacingCloud.class, "racing_cloud", false, 0, 0);
|
|
|
|
addEntity(registry, EntityConstructionCloud.class, "construction_cloud", false, 0, 0);
|
|
|
|
addEntity(registry, EntitySpell.class, "magic_spell", false, 0, 0);
|
|
|
|
}
|
2018-09-16 00:45:44 +02:00
|
|
|
|
2018-09-21 17:53:33 +02:00
|
|
|
static <T extends Entity> void addEntity(IForgeRegistry<EntityEntry> registry, Class<T> type, String name, boolean egg, int a, int b) {
|
|
|
|
EntityEntry entry = new EntityEntry(type, name).setRegistryName(Unicopia.MODID, name);
|
2018-09-16 00:45:44 +02:00
|
|
|
|
2018-09-21 17:53:33 +02:00
|
|
|
if (egg) {
|
|
|
|
entry.setEgg(new EntityEggInfo(new ResourceLocation("unicopia", "cloud"), a, a));
|
|
|
|
}
|
2018-09-16 00:45:44 +02:00
|
|
|
|
2018-09-21 17:53:33 +02:00
|
|
|
registry.register(entry);
|
2018-09-16 00:45:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void preInit() {
|
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityCloud.class, manager -> new RenderCloud(manager));
|
2018-09-21 17:53:33 +02:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntitySpell.class, manager -> new RenderGem(manager));
|
2018-09-16 00:45:44 +02:00
|
|
|
}
|
|
|
|
}
|