2
1
Fork 1
mirror of https://github.com/ACGaming/Spackenmobs synced 2024-05-19 11:54:25 +02:00

Compare commits

...

3 commits

Author SHA1 Message Date
ACGaming ddb0030ede Bump version 2022-04-12 12:40:06 +02:00
ACGaming a065b2e849 Add Baka Mitai Creeper effect cloud 2022-04-12 12:16:10 +02:00
ACGaming ae38ceb3d7 Clean up registry handler, add spawn eggs 2022-04-12 11:47:41 +02:00
5 changed files with 79 additions and 203 deletions

View file

@ -11,9 +11,9 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = "1.8.1"
version = "1.12.2-1.9.0"
group = "mod.acgaming.spackenmobs" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Spackenmobs-1.12.2"
archivesBaseName = "Spackenmobs"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {

View file

@ -16,7 +16,7 @@ import mod.acgaming.spackenmobs.misc.ModEntities;
public class Spackenmobs
{
public static final String MODID = "spackenmobs";
public static final String VERSION = "1.8.1";
public static final String VERSION = "1.12.2-1.9.0";
public static final CreativeTabs SPACKENMOBS_TAB = new SpackenmobsTab();

View file

@ -1,7 +1,10 @@
package mod.acgaming.spackenmobs;
import java.util.ArrayList;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -9,6 +12,8 @@ import mod.acgaming.spackenmobs.misc.ModItems;
public class SpackenmobsTab extends CreativeTabs
{
public static ArrayList<ItemStack> eggs = new ArrayList<>();
public SpackenmobsTab()
{
super(Spackenmobs.MODID);
@ -20,4 +25,12 @@ public class SpackenmobsTab extends CreativeTabs
{
return new ItemStack(ModItems.RAM);
}
@Override
@SideOnly(Side.CLIENT)
public void displayAllRelevantItems(NonNullList<ItemStack> list)
{
super.displayAllRelevantItems(list);
list.addAll(eggs);
}
}

View file

@ -1,6 +1,5 @@
package mod.acgaming.spackenmobs.entities;
import java.util.Collection;
import javax.annotation.Nullable;
import net.minecraft.entity.Entity;
@ -13,6 +12,7 @@ import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.MobEffects;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -66,6 +66,7 @@ public class EntityBakaMitaiCreeper extends EntityMob
if (i > 0 && this.timeSinceIgnited == 0)
{
this.spawnLingeringCloud();
this.playSound(ModSoundEvents.ENTITY_BAKAMITAICREEPER_FUSE, 1.0F, 1.0F);
}
@ -296,29 +297,19 @@ public class EntityBakaMitaiCreeper extends EntityMob
this.world.playSound(null, getPosition(), ModSoundEvents.ENTITY_BAKAMITAICREEPER_BLOW, getSoundCategory(), 2.0F, 1.0F);
this.world.createExplosion(this, this.posX, this.posY, this.posZ, (float) this.explosionRadius * f, flag);
this.setDead();
this.spawnLingeringCloud();
}
}
private void spawnLingeringCloud()
{
Collection<PotionEffect> collection = this.getActivePotionEffects();
if (!collection.isEmpty())
{
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
entityareaeffectcloud.setDuration(entityareaeffectcloud.getDuration() / 2);
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
for (PotionEffect potioneffect : collection)
{
entityareaeffectcloud.addEffect(new PotionEffect(potioneffect));
}
this.world.spawnEntity(entityareaeffectcloud);
}
EntityAreaEffectCloud cloud = new EntityAreaEffectCloud(this.world, this.posX, this.posY, this.posZ);
cloud.setOwner(this);
cloud.setRadius(10.0F);
cloud.setRadiusOnUse(-0.5F);
cloud.setWaitTime(10);
cloud.setDuration(cloud.getDuration() / 2);
cloud.setRadiusPerTick(-cloud.getRadius() / (float) cloud.getDuration());
cloud.addEffect(new PotionEffect(MobEffects.SLOWNESS, 100, 3));
this.world.spawnEntity(cloud);
}
}

View file

@ -5,7 +5,10 @@ import java.util.Set;
import com.google.common.collect.Lists;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.biome.Biome;
@ -18,11 +21,14 @@ import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.oredict.OreDictionary;
import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.SpackenmobsTab;
import mod.acgaming.spackenmobs.entities.*;
@EventBusSubscriber(modid = Spackenmobs.MODID)
public class RegistryHandler
{
public static int id;
@SubscribeEvent
public static void registerEntities(Register<EntityEntry> event)
{
@ -36,189 +42,55 @@ public class RegistryHandler
}
}
int id = 1;
// REGISTRATION
registerEntityWithSpawnEgg(EntityApoRed.class, "apored", 2039583, 16711680);
registerEntityWithSpawnEgg(EntityBakaMitaiCreeper.class, "bakamitai_creeper", 826890, 0);
registerEntityWithSpawnEgg(EntityDrachenlord.class, "drachenlord", 15256745, 8738878);
registerEntityWithSpawnEgg(EntityFriedrichLiechtenstein.class, "friedrich", 16447728, 15878595);
registerEntityWithSpawnEgg(EntityGisela.class, "gisela", 39835, 16448250);
registerEntityWithSpawnEgg(EntityHolzstammhuhn.class, "holzstammhuhn", 12096347, 5295899);
registerEntityWithSpawnEgg(EntityIslamist.class, "islamist", 15263976, 15211548);
registerEntityWithSpawnEgg(EntityJens.class, "jens", 6704526, 6767911);
registerEntityWithSpawnEgg(EntityMZTEWolf.class, "mztewolf", 16711680, 0);
registerEntityWithSpawnEgg(EntityMarcellDAvis.class, "marcell_davis", 15759, 16777215);
registerEntityWithSpawnEgg(EntityMrBean.class, "mr_bean", 4802350, 3220238);
registerEntityWithSpawnEgg(EntitySchalker.class, "schalker", 24745, 16777215);
registerEntityWithSpawnEgg(EntitySmavaCreeper.class, "smava_creeper", 7649828, 11053224);
registerEntityWithSpawnEgg(EntityTileraGhast.class, "tilera_ghast", 255, 16711680);
// Smava Creeper
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:smava_creeper"), EntitySmavaCreeper.class, "smava_creeper", id++, Spackenmobs.instance, 64, 1, true, 7649828, 11053224);
if (ModConfigs.spawn_switches.SmavaCreeper_spawn)
{
EntityRegistry.addSpawn(
EntitySmavaCreeper.class,
ModConfigs.spawn_values.SmavaCreeper_weight,
ModConfigs.spawn_values.SmavaCreeper_min,
ModConfigs.spawn_values.SmavaCreeper_max,
EnumCreatureType.MONSTER,
regularSpawning.toArray(new Biome[0]));
}
// SPAWNING
if (ModConfigs.spawn_switches.ApoRed_spawn) EntityRegistry.addSpawn(EntityApoRed.class, ModConfigs.spawn_values.ApoRed_weight, ModConfigs.spawn_values.ApoRed_min, ModConfigs.spawn_values.ApoRed_max, EnumCreatureType.MONSTER, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.BakaMitaiCreeper_spawn) EntityRegistry.addSpawn(EntityBakaMitaiCreeper.class, ModConfigs.spawn_values.BakaMitaiCreeper_weight, ModConfigs.spawn_values.BakaMitaiCreeper_min, ModConfigs.spawn_values.BakaMitaiCreeper_max, EnumCreatureType.MONSTER, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.Drachenlord_spawn) EntityRegistry.addSpawn(EntityDrachenlord.class, ModConfigs.spawn_values.Drachenlord_weight, ModConfigs.spawn_values.Drachenlord_min, ModConfigs.spawn_values.Drachenlord_max, EnumCreatureType.MONSTER, BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER).toArray(new Biome[0]));
if (ModConfigs.spawn_switches.Friedrich_spawn) EntityRegistry.addSpawn(EntityFriedrichLiechtenstein.class, ModConfigs.spawn_values.Friedrich_weight, ModConfigs.spawn_values.Friedrich_min, ModConfigs.spawn_values.Friedrich_max, EnumCreatureType.CREATURE, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.Gisela_spawn) EntityRegistry.addSpawn(EntityGisela.class, ModConfigs.spawn_values.Gisela_weight, ModConfigs.spawn_values.Gisela_min, ModConfigs.spawn_values.Gisela_max, EnumCreatureType.CREATURE, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.Holzstammhuhn_spawn) EntityRegistry.addSpawn(EntityHolzstammhuhn.class, ModConfigs.spawn_values.Holzstammhuhn_weight, ModConfigs.spawn_values.Holzstammhuhn_min, ModConfigs.spawn_values.Holzstammhuhn_max, EnumCreatureType.CREATURE, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.Islamist_spawn) EntityRegistry.addSpawn(EntityIslamist.class, ModConfigs.spawn_values.Islamist_weight, ModConfigs.spawn_values.Islamist_min, ModConfigs.spawn_values.Islamist_max, EnumCreatureType.MONSTER, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.Jens_spawn) EntityRegistry.addSpawn(EntityJens.class, ModConfigs.spawn_values.Jens_weight, ModConfigs.spawn_values.Jens_min, ModConfigs.spawn_values.Jens_max, EnumCreatureType.CREATURE, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.MZTEWolf_spawn) EntityRegistry.addSpawn(EntityMZTEWolf.class, ModConfigs.spawn_values.MZTEWolf_weight, ModConfigs.spawn_values.MZTEWolf_min, ModConfigs.spawn_values.MZTEWolf_max, EnumCreatureType.CREATURE, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.MarcellDAvis_spawn) EntityRegistry.addSpawn(EntityMarcellDAvis.class, ModConfigs.spawn_values.MarcellDAvis_weight, ModConfigs.spawn_values.MarcellDAvis_min, ModConfigs.spawn_values.MarcellDAvis_max, EnumCreatureType.MONSTER, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.MrBean_spawn) EntityRegistry.addSpawn(EntityMrBean.class, ModConfigs.spawn_values.MrBean_weight, ModConfigs.spawn_values.MrBean_min, ModConfigs.spawn_values.MrBean_max, EnumCreatureType.MONSTER, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.Schalker_spawn) EntityRegistry.addSpawn(EntitySchalker.class, ModConfigs.spawn_values.Schalker_weight, ModConfigs.spawn_values.Schalker_min, ModConfigs.spawn_values.Schalker_max, EnumCreatureType.MONSTER, BiomeDictionary.getBiomes(BiomeDictionary.Type.END).toArray(new Biome[0]));
if (ModConfigs.spawn_switches.SmavaCreeper_spawn) EntityRegistry.addSpawn(EntitySmavaCreeper.class, ModConfigs.spawn_values.SmavaCreeper_weight, ModConfigs.spawn_values.SmavaCreeper_min, ModConfigs.spawn_values.SmavaCreeper_max, EnumCreatureType.MONSTER, regularSpawning.toArray(new Biome[0]));
if (ModConfigs.spawn_switches.tileraGhast_spawn) EntityRegistry.addSpawn(EntityTileraGhast.class, ModConfigs.spawn_values.tileraGhast_weight, ModConfigs.spawn_values.tileraGhast_min, ModConfigs.spawn_values.tileraGhast_max, EnumCreatureType.MONSTER, BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER).toArray(new Biome[0]));
}
// Marcell D'Avis
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:marcell_davis"), EntityMarcellDAvis.class, "marcell_davis", id++, Spackenmobs.instance, 64, 1, true, 15759, 16777215);
if (ModConfigs.spawn_switches.MarcellDAvis_spawn)
{
EntityRegistry.addSpawn(
EntityMarcellDAvis.class,
ModConfigs.spawn_values.MarcellDAvis_weight,
ModConfigs.spawn_values.MarcellDAvis_min,
ModConfigs.spawn_values.MarcellDAvis_max,
EnumCreatureType.MONSTER,
regularSpawning.toArray(new Biome[0]));
}
public static void registerEntityWithSpawnEgg(Class clazz, String entityName, int primary, int secondary)
{
ResourceLocation registryName = new ResourceLocation(Spackenmobs.MODID, entityName);
EntityRegistry.registerModEntity(registryName, clazz, entityName, id++, Spackenmobs.instance, 64, 1, true, primary, secondary);
SpackenmobsTab.eggs.add(getSpawnEgg(entityName));
}
// Islamist
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:islamist"), EntityIslamist.class, "islamist", id++, Spackenmobs.instance, 64, 1, true, 15263976, 15211548);
if (ModConfigs.spawn_switches.Islamist_spawn)
{
EntityRegistry.addSpawn(
EntityIslamist.class,
ModConfigs.spawn_values.Islamist_weight,
ModConfigs.spawn_values.Islamist_min,
ModConfigs.spawn_values.Islamist_max,
EnumCreatureType.MONSTER,
regularSpawning.toArray(new Biome[0]));
}
// ApoRed
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:apored"), EntityApoRed.class, "apored", id++, Spackenmobs.instance, 64, 1, true, 2039583, 16711680);
if (ModConfigs.spawn_switches.ApoRed_spawn)
{
EntityRegistry.addSpawn(
EntityApoRed.class,
ModConfigs.spawn_values.ApoRed_weight,
ModConfigs.spawn_values.ApoRed_min,
ModConfigs.spawn_values.ApoRed_max,
EnumCreatureType.MONSTER,
regularSpawning.toArray(new Biome[0]));
}
// Mr. Bean
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mr_bean"), EntityMrBean.class, "mr_bean", id++, Spackenmobs.instance, 64, 1, true, 4802350, 3220238);
if (ModConfigs.spawn_switches.MrBean_spawn)
{
EntityRegistry.addSpawn(
EntityMrBean.class,
ModConfigs.spawn_values.MrBean_weight,
ModConfigs.spawn_values.MrBean_min,
ModConfigs.spawn_values.MrBean_max,
EnumCreatureType.MONSTER,
regularSpawning.toArray(new Biome[0]));
}
// Drachenlord
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:drachenlord"), EntityDrachenlord.class, "drachenlord", id++, Spackenmobs.instance, 64, 1, true, 15256745, 8738878);
if (ModConfigs.spawn_switches.Drachenlord_spawn)
{
EntityRegistry.addSpawn(
EntityDrachenlord.class,
ModConfigs.spawn_values.Drachenlord_weight,
ModConfigs.spawn_values.Drachenlord_min,
ModConfigs.spawn_values.Drachenlord_max,
EnumCreatureType.MONSTER,
BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER).toArray(new Biome[0]));
}
// Schalker
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:schalker"), EntitySchalker.class, "schalker", id++, Spackenmobs.instance, 64, 1, true, 24745, 16777215);
if (ModConfigs.spawn_switches.Schalker_spawn)
{
EntityRegistry.addSpawn(
EntitySchalker.class,
ModConfigs.spawn_values.Schalker_weight,
ModConfigs.spawn_values.Schalker_min,
ModConfigs.spawn_values.Schalker_max,
EnumCreatureType.MONSTER,
BiomeDictionary.getBiomes(BiomeDictionary.Type.END).toArray(new Biome[0]));
}
// Jens
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:jens"), EntityJens.class, "jens", id++, Spackenmobs.instance, 64, 1, true, 6704526, 6767911);
if (ModConfigs.spawn_switches.Jens_spawn)
{
EntityRegistry.addSpawn(
EntityJens.class,
ModConfigs.spawn_values.Jens_weight,
ModConfigs.spawn_values.Jens_min,
ModConfigs.spawn_values.Jens_max,
EnumCreatureType.CREATURE,
regularSpawning.toArray(new Biome[0]));
}
// MZTEWolf
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:mztewolf"), EntityMZTEWolf.class, "mztewolf", id++, Spackenmobs.instance, 64, 1, true, 16711680, 0);
if (ModConfigs.spawn_switches.MZTEWolf_spawn)
{
EntityRegistry.addSpawn(
EntityMZTEWolf.class,
ModConfigs.spawn_values.MZTEWolf_weight,
ModConfigs.spawn_values.MZTEWolf_min,
ModConfigs.spawn_values.MZTEWolf_max,
EnumCreatureType.CREATURE,
regularSpawning.toArray(new Biome[0]));
}
// Holzstammhuhn
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:holzstammhuhn"), EntityHolzstammhuhn.class, "holzstammhuhn", id++, Spackenmobs.instance, 64, 1, true, 12096347, 5295899);
if (ModConfigs.spawn_switches.Holzstammhuhn_spawn)
{
EntityRegistry.addSpawn(
EntityHolzstammhuhn.class,
ModConfigs.spawn_values.Holzstammhuhn_weight,
ModConfigs.spawn_values.Holzstammhuhn_min,
ModConfigs.spawn_values.Holzstammhuhn_max,
EnumCreatureType.CREATURE,
regularSpawning.toArray(new Biome[0]));
}
// Baka Mitai Creeper
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:bakamitai_creeper"), EntityBakaMitaiCreeper.class, "bakamitai_creeper", id++, Spackenmobs.instance, 64, 1, true, 826890, 0);
if (ModConfigs.spawn_switches.BakaMitaiCreeper_spawn)
{
EntityRegistry.addSpawn(
EntityBakaMitaiCreeper.class,
ModConfigs.spawn_values.BakaMitaiCreeper_weight,
ModConfigs.spawn_values.BakaMitaiCreeper_min,
ModConfigs.spawn_values.BakaMitaiCreeper_max,
EnumCreatureType.MONSTER,
regularSpawning.toArray(new Biome[0]));
}
// Friedrich Liechtenstein
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:friedrich"), EntityFriedrichLiechtenstein.class, "friedrich", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595);
if (ModConfigs.spawn_switches.Friedrich_spawn)
{
EntityRegistry.addSpawn(
EntityFriedrichLiechtenstein.class,
ModConfigs.spawn_values.Friedrich_weight,
ModConfigs.spawn_values.Friedrich_min,
ModConfigs.spawn_values.Friedrich_max,
EnumCreatureType.CREATURE,
regularSpawning.toArray(new Biome[0]));
}
// Gisela
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:gisela"), EntityGisela.class, "gisela", id++, Spackenmobs.instance, 64, 1, true, 39835, 16448250);
if (ModConfigs.spawn_switches.Gisela_spawn)
{
EntityRegistry.addSpawn(
EntityGisela.class,
ModConfigs.spawn_values.Gisela_weight,
ModConfigs.spawn_values.Gisela_min,
ModConfigs.spawn_values.Gisela_max,
EnumCreatureType.CREATURE,
regularSpawning.toArray(new Biome[0]));
}
// tilera Ghast
EntityRegistry.registerModEntity(new ResourceLocation("spackenmobs:tilera_ghast"), EntityTileraGhast.class, "tilera_ghast", id++, Spackenmobs.instance, 64, 1, true, 16447728, 15878595);
if (ModConfigs.spawn_switches.tileraGhast_spawn)
{
EntityRegistry.addSpawn(
EntityTileraGhast.class,
ModConfigs.spawn_values.tileraGhast_weight,
ModConfigs.spawn_values.tileraGhast_min,
ModConfigs.spawn_values.tileraGhast_max,
EnumCreatureType.MONSTER,
BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER).toArray(new Biome[0]));
}
public static ItemStack getSpawnEgg(String entityName)
{
ItemStack stack = new ItemStack(Items.SPAWN_EGG);
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("id", Spackenmobs.MODID + ":" + entityName);
NBTTagCompound nbt2 = new NBTTagCompound();
nbt2.setTag("EntityTag", nbt);
stack.setTagCompound(nbt2);
return stack;
}
@SubscribeEvent