2019-02-17 00:08:19 +01:00
|
|
|
package com.minelittlepony.unicopia.init;
|
2018-09-16 00:45:44 +02:00
|
|
|
|
2019-02-17 00:08:19 +01:00
|
|
|
import com.minelittlepony.unicopia.Unicopia;
|
2019-03-21 16:03:59 +01:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityButterfly;
|
2018-09-16 00:45:44 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityCloud;
|
|
|
|
import com.minelittlepony.unicopia.entity.EntityConstructionCloud;
|
2019-03-08 21:56:25 +01:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityCuccoon;
|
2018-09-16 00:45:44 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityRacingCloud;
|
2019-02-04 14:25:12 +01:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityRainbow;
|
2019-04-09 13:45:36 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.EntitySpear;
|
2018-09-21 17:53:33 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.EntitySpell;
|
2019-01-10 10:35:15 +01:00
|
|
|
import com.minelittlepony.unicopia.entity.EntitySpellbook;
|
2019-01-06 22:31:34 +01:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityProjectile;
|
2018-09-16 00:45:44 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.EntityWildCloud;
|
2019-02-04 14:25:12 +01:00
|
|
|
import com.minelittlepony.unicopia.forgebullshit.BiomeBS;
|
2019-01-30 11:26:00 +01:00
|
|
|
import com.minelittlepony.unicopia.forgebullshit.EntityType;
|
2019-03-21 16:03:59 +01:00
|
|
|
import com.minelittlepony.unicopia.render.RenderButterfly;
|
2018-09-16 00:45:44 +02:00
|
|
|
import com.minelittlepony.unicopia.render.RenderCloud;
|
2019-03-08 21:56:25 +01:00
|
|
|
import com.minelittlepony.unicopia.render.RenderCuccoon;
|
2018-09-21 17:53:33 +02:00
|
|
|
import com.minelittlepony.unicopia.render.RenderGem;
|
2019-01-06 22:31:34 +01:00
|
|
|
import com.minelittlepony.unicopia.render.RenderProjectile;
|
2019-02-04 14:25:12 +01:00
|
|
|
import com.minelittlepony.unicopia.render.RenderRainbow;
|
2019-04-09 13:45:36 +02:00
|
|
|
import com.minelittlepony.unicopia.render.RenderSpear;
|
2019-01-10 10:35:15 +01:00
|
|
|
import com.minelittlepony.unicopia.render.RenderSpellbook;
|
2018-09-16 00:45:44 +02:00
|
|
|
|
2019-01-29 14:22:36 +01:00
|
|
|
import net.minecraft.entity.EnumCreatureType;
|
|
|
|
import net.minecraft.world.biome.Biome;
|
|
|
|
import net.minecraft.world.biome.BiomeEnd;
|
2019-03-21 16:03:59 +01:00
|
|
|
import net.minecraft.world.biome.BiomeForest;
|
2019-01-29 14:22:36 +01:00
|
|
|
import net.minecraft.world.biome.BiomeHell;
|
2019-03-21 16:03:59 +01:00
|
|
|
import net.minecraft.world.biome.BiomeHills;
|
|
|
|
import net.minecraft.world.biome.BiomePlains;
|
|
|
|
import net.minecraft.world.biome.BiomeRiver;
|
2019-01-29 14:22:36 +01:00
|
|
|
import net.minecraftforge.common.BiomeManager;
|
2018-09-16 00:45:44 +02:00
|
|
|
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
|
|
|
import net.minecraftforge.fml.common.registry.EntityEntry;
|
|
|
|
import net.minecraftforge.registries.IForgeRegistry;
|
|
|
|
|
|
|
|
public class UEntities {
|
|
|
|
|
|
|
|
static void init(IForgeRegistry<EntityEntry> registry) {
|
2019-01-30 11:26:00 +01:00
|
|
|
EntityType builder = EntityType.builder(Unicopia.MODID);
|
2019-01-06 22:31:34 +01:00
|
|
|
registry.registerAll(
|
2019-03-21 16:03:59 +01:00
|
|
|
builder.creature(EntityCloud.class, "cloud").withEgg(0x4169e1, 0x7fff00),
|
2019-01-30 11:26:00 +01:00
|
|
|
builder.creature(EntityWildCloud.class, "wild_cloud"),
|
|
|
|
builder.creature(EntityRacingCloud.class, "racing_cloud"),
|
|
|
|
builder.creature(EntityConstructionCloud.class, "construction_cloud"),
|
|
|
|
builder.creature(EntitySpell.class, "magic_spell"),
|
|
|
|
builder.creature(EntitySpellbook.class, "spellbook"),
|
2019-02-04 14:25:12 +01:00
|
|
|
builder.creature(EntityRainbow.Spawner.class, "rainbow_spawner"),
|
2019-03-21 16:03:59 +01:00
|
|
|
builder.creature(EntityCuccoon.class, "cuccoon"),
|
|
|
|
builder.creature(EntityButterfly.class, "butterfly").withEgg(0x222200, 0xaaeeff),
|
2019-02-04 14:25:12 +01:00
|
|
|
builder.projectile(EntityRainbow.class, "rainbow", 500, 5),
|
2019-04-09 13:45:36 +02:00
|
|
|
builder.projectile(EntityProjectile.class, "thrown_item", 100, 10),
|
|
|
|
builder.projectile(EntitySpear.class, "spear", 100, 10)
|
2019-01-06 22:31:34 +01:00
|
|
|
);
|
2018-09-21 17:53:33 +02:00
|
|
|
}
|
2018-09-16 00:45:44 +02:00
|
|
|
|
2019-02-17 00:08:19 +01:00
|
|
|
public static void preInit() {
|
2019-01-06 22:31:34 +01:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityCloud.class, RenderCloud::new);
|
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntitySpell.class, RenderGem::new);
|
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityProjectile.class, RenderProjectile::new);
|
2019-01-10 10:35:15 +01:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntitySpellbook.class, RenderSpellbook::new);
|
2019-02-04 14:25:12 +01:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityRainbow.class, RenderRainbow::new);
|
2019-03-21 16:03:59 +01:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityButterfly.class, RenderButterfly::new);
|
2019-03-08 21:56:25 +01:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityCuccoon.class, RenderCuccoon::new);
|
2019-04-09 13:45:36 +02:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, RenderSpear::new);
|
2019-01-06 22:31:34 +01:00
|
|
|
}
|
|
|
|
|
2019-02-17 00:08:19 +01:00
|
|
|
public static void registerSpawnEntries(Biome biome) {
|
2019-01-29 14:22:36 +01:00
|
|
|
if (!(biome instanceof BiomeHell || biome instanceof BiomeEnd)) {
|
2019-02-04 14:25:12 +01:00
|
|
|
|
|
|
|
BiomeBS.addSpawnEntry(biome, EnumCreatureType.AMBIENT, EntityWildCloud.class, b ->
|
2019-04-04 16:40:00 +02:00
|
|
|
BiomeManager.oceanBiomes.contains(b) ? EntityWildCloud.SPAWN_ENTRY_OCEAN : EntityWildCloud.SPAWN_ENTRY_LAND
|
2019-02-04 14:25:12 +01:00
|
|
|
);
|
2019-03-21 16:03:59 +01:00
|
|
|
|
2019-02-04 14:25:12 +01:00
|
|
|
BiomeBS.addSpawnEntry(biome, EnumCreatureType.CREATURE, EntityRainbow.Spawner.class, b -> EntityRainbow.SPAWN_ENTRY);
|
2019-01-29 14:22:36 +01:00
|
|
|
}
|
2019-03-21 16:03:59 +01:00
|
|
|
|
|
|
|
if (biome instanceof BiomePlains
|
|
|
|
|| biome instanceof BiomeRiver
|
|
|
|
|| biome instanceof BiomeHills
|
|
|
|
|| biome instanceof BiomeForest) {
|
|
|
|
BiomeBS.addSpawnEntry(biome, EnumCreatureType.AMBIENT, EntityButterfly.class, b -> EntityButterfly.SPAWN_ENTRY);
|
|
|
|
}
|
2019-01-29 14:22:36 +01:00
|
|
|
}
|
2018-09-16 00:45:44 +02:00
|
|
|
}
|