Jump to content

Forge 1.7.2: Mob won't render correctly


DaryBob

Recommended Posts

Hey Guy's, I have two mobs in my mod. The Pumpkin Monster and the Pumpkin Mutant. The Mutant Mob I created is a boss. I made an own Handler for him. So I made a BossHandler.class. Now I have the problem that the boss has the model from the PumpkinMonster. Yes I made a model for him too. But it still renders the same model from the pumpkin monster. I checked anything out but I didn't wrote everywhere that the Mutant should have the model from the Monster.

 

Main Class:

package com.netcrafter.mod;

 

import com.netcrafter.mod.blocks.*;

import com.netcrafter.mod.entity.EntityPumpkinMonster;

import com.netcrafter.mod.entity.EntityPumpkinMutant;

import com.netcrafter.mod.handler.BossHandler;

import com.netcrafter.mod.handler.CraftingHandler;

import com.netcrafter.mod.handler.EntityHandler;

import com.netcrafter.mod.handler.FuelHandler;

import com.netcrafter.mod.items.*;

import com.netcrafter.mod.model.ModelPumpkinMonster;

import com.netcrafter.mod.model.ModelPumpkinMutant;

import com.netcrafter.mod.proxy.CommonProxy;

import com.netcrafter.mod.renderer.RenderPumpkinMonster;

import com.netcrafter.mod.renderer.RenderPumpkinMutant;

import com.netcrafter.mod.weapons.*;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.client.Minecraft;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraftforge.common.util.EnumHelper;

import net.minecraftforge.oredict.OreDictionary;

import cpw.mods.fml.client.registry.RenderingRegistry;

import cpw.mods.fml.common.FMLCommonHandler;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.Mod.Instance;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPostInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.event.FMLStateEvent;

import cpw.mods.fml.common.registry.EntityRegistry;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

@Mod(modid = LidlMelonRPG.modid, version = LidlMelonRPG.version)

public class LidlMelonRPG {

 

public static final String modid = "LidlMelonRPG";

    public static final String version = "Alpha v.01";

   

    //Creative Tabs

    public static CreativeTabs rpgMaterialTab;

    public static CreativeTabs rpgWeaponsTab;

   

    //Material

    public static ToolMaterial ModMaterial = EnumHelper.addToolMaterial("ModMaterial", 2, 4000, 10.0F, 10.0F, 10);

    public static ToolMaterial CheatMaterial = EnumHelper.addToolMaterial("CheatMaterial", 0, 59, 2.0F, 1.0F, 20);

    public static ToolMaterial GriefMaterial = EnumHelper.addToolMaterial("GriefMaterial", 2, 4000, 10.0F, 7.0F, 20);

    public static ToolMaterial HomoMaterial = EnumHelper.addToolMaterial("HomoMaterial", 2, 4000, 10.0F, 16.0F, 40);

    public static ToolMaterial NinjaMaterial = EnumHelper.addToolMaterial("NinjaMaterial", 2, 4000, 10.0F, 4.0F, 20);

    public static ToolMaterial UltraNinjaMaterial = EnumHelper.addToolMaterial("UltraNinjaMaterial", 10, 8000, 40.0F, 40.0F, 50);

    public static ToolMaterial Furzblade = EnumHelper.addToolMaterial("Furzblade", 10, 8000, 40.0F, 96.0F, 50);

    public static ToolMaterial Generation = EnumHelper.addToolMaterial("Generation", 18, 8000, 40.0F, 440.0F, 80);

    public static ToolMaterial NinjaMelon = EnumHelper.addToolMaterial("NinjaMelon", 20, 8000, 496.0F, 496.0F, 100);

    public static ToolMaterial Ultimate = EnumHelper.addToolMaterial("Ultimate", 30, 10000, 4440.0F, 4440.0F, 500);

   

    @Instance(modid)

public static LidlMelonRPG instance;

   

    //Weapons

    public static Item itemModBlade;

    public static Item itemCheaterSword;

    public static Item itemGrieferSword;

    public static Item itemHomoSword;

    public static Item itemNinjaKatana;

    public static Item itemUltraNinja;

    public static Item itemRevolution;

    public static Item itemPreGeneration;

    public static Item itemFurzblade;

    public static Item itemGeneration;

    public static Item itemNinjaMelon;

    public static Item itemUltimate;

   

    //Blocks

    public static Block blockMelonShard;

    public static Block blockLidl;

    public static Block blockGrief;

    public static Block blockTroll;

    public static Block blockYTroll;

    public static Block blockLucky;

    public static Block blockRoman;

    public static Block blockFurzPortal;

    public static Block blockFurz;

    public static Block blockKKBlock;

    public static Block blockUCSBlock;

   

    //Items

    public static Item itemMelonShard;

    public static Item itemPumpkinBlood;

    public static Item itemActionFigur;

    public static Item itemPlastik;

    public static Item itemLidlIngot;

    public static Item itemGrieferIngot;

    public static Item itemGayIngot;

    public static Item itemObsidianIngot;

    public static Item itemRomanDeath;

    public static Item itemChaosNugget;

    public static Item itemLuckyIngot;

    public static Item itemRomanIngot;

    public static Item itemFurzShard;

    public static Item itemHardenedFart;

    public static Item itemStolenMelons;

    public static Item itemJBCD;

    public static Item itemNGPShard;

    public static Item itemBieberSpawnegg;

    public static Item itemChaosShard;

    public static Item itemUCShard;

    public static Item itemNGPKnife;

    public static Item itemHalfIron;

   

    @SidedProxy(clientSide = "com.netcrafter.mod.proxy.ClientProxy", serverSide = "com.netcrafter.mod.proxy.CommonProxy")

public static CommonProxy proxy;

   

    @EventHandler

    public void PreInit(FMLPreInitializationEvent preEvent){

   

    //CreativeTabs

    rpgMaterialTab = new CreativeTabs("rpgMaterial") {

    @SideOnly(Side.CLIENT)

    public Item getTabIconItem() {

    return Item.getItemFromBlock(LidlMelonRPG.blockMelonShard);

    }

    };

   

    rpgWeaponsTab = new CreativeTabs("rpgWeapons") {

    @SideOnly(Side.CLIENT)

    public Item getTabIconItem() {

    return Item.getItemFromBlock(LidlMelonRPG.blockMelonShard);

    }

    };

   

    //Weapons

    itemModBlade = new Weapons(ModMaterial).setUnlocalizedName("ModBlade");

    itemCheaterSword = new Weapons(CheatMaterial).setUnlocalizedName("CheaterSword");

    itemGrieferSword = new Weapons(GriefMaterial).setUnlocalizedName("GrieferSword");

    itemHomoSword = new Weapons(HomoMaterial).setUnlocalizedName("HomoSword");

    itemNinjaKatana = new Weapons(NinjaMaterial).setUnlocalizedName("NinjaKatana");

    itemUltraNinja = new Weapons(UltraNinjaMaterial).setUnlocalizedName("UltraNinja");

    itemRevolution = new Weapons(UltraNinjaMaterial).setUnlocalizedName("Revolution");

    itemPreGeneration = new Weapons(Furzblade).setUnlocalizedName("PreGeneration");

    itemFurzblade = new Weapons(Furzblade).setUnlocalizedName("Furzblade");

    itemGeneration = new Weapons(Generation).setUnlocalizedName("Generation");

    itemNinjaMelon = new Weapons(NinjaMelon).setUnlocalizedName("NinjaMelon");

    itemUltimate = new Weapons(Ultimate).setUnlocalizedName("Ultimate");

   

    //Blocks

    blockMelonShard = new RPGBlocks(Material.clay).setBlockName("MelonShardBlock");

    blockGrief = new RPGBlocks(Material.rock).setBlockName("Grief");

    blockLidl = new RPGBlocks(Material.rock).setBlockName("Lidl");

        blockTroll = new RPGBlocks(Material.rock).setBlockName("Troll");

    blockYTroll = new RPGBlocks(Material.rock).setBlockName("YTroll");

        blockLucky = new RPGBlocks(Material.rock).setBlockName("Lucky");

    blockRoman = new RPGBlocks(Material.rock).setBlockName("Roman");

    blockFurzPortal = new RPGBlocks(Material.rock).setBlockName("FurzPortal");

    blockFurz = new RPGBlocks(Material.rock).setBlockName("Furz");

    blockKKBlock = new RPGBlocks(Material.rock).setBlockName("KKBlock");

    blockUCSBlock = new RPGBlocks(Material.rock).setBlockName("UCSBlock");

   

    //Items

    itemNGPKnife = new DurableItems().setUnlocalizedName("NGPKnife");

    itemHalfIron = new RPGItems().setUnlocalizedName("HalfIron");

    itemMelonShard = new RPGItems().setUnlocalizedName("MelonShard");

    itemPumpkinBlood = new RPGItems().setUnlocalizedName("PumpkinBlood");

    itemActionFigur = new RPGItems().setUnlocalizedName("ActionFigur");

    itemPlastik = new RPGItems().setUnlocalizedName("Plastik");

    itemLidlIngot = new RPGItems().setUnlocalizedName("LidlIngot");

    itemGrieferIngot = new RPGItems().setUnlocalizedName("GrieferIngot");

    itemGayIngot = new RPGItems().setUnlocalizedName("GayIngot");

    itemObsidianIngot = new RPGItems().setUnlocalizedName("ObsidianIngot");

    itemRomanDeath = new RPGItems().setUnlocalizedName("RomanDeath");

    itemChaosNugget = new RPGItems().setUnlocalizedName("ChaosNugget");

    itemLuckyIngot = new RPGItems().setUnlocalizedName("LuckyIngot");

    itemRomanIngot = new RPGItems().setUnlocalizedName("RomanIngot");

    itemFurzShard = new RPGItems().setUnlocalizedName("FurzShard");

    itemHardenedFart = new RPGItems().setUnlocalizedName("HardenedFart");

    itemStolenMelons = new RPGItems().setUnlocalizedName("StolenMelons");

    itemJBCD = new RPGItems().setUnlocalizedName("JBCD");

    itemNGPShard = new RPGItems().setUnlocalizedName("NGPShard");

    itemBieberSpawnegg = new RPGItems().setUnlocalizedName("BieberSpawnegg");

    itemChaosShard = new RPGItems().setUnlocalizedName("ChaosShard");

    itemUCShard = new RPGItems().setUnlocalizedName("UCShard");

   

    //Weapon Registry

    GameRegistry.registerItem(itemModBlade, "ModBlade");

    GameRegistry.registerItem(itemCheaterSword, "CheaterSword");

    GameRegistry.registerItem(itemGrieferSword, "GrieferSword");

    GameRegistry.registerItem(itemHomoSword, "HomoSword");

    GameRegistry.registerItem(itemNinjaKatana, "NinjaKatana");

    GameRegistry.registerItem(itemUltraNinja, "UltraNinja");

    GameRegistry.registerItem(itemRevolution, "Revolution");

    GameRegistry.registerItem(itemPreGeneration, "PreGeneration");

    GameRegistry.registerItem(itemFurzblade, "Furzblade");

    GameRegistry.registerItem(itemGeneration, "Generation");

    GameRegistry.registerItem(itemNinjaMelon, "NinjaMelon");

    GameRegistry.registerItem(itemUltimate, "Ultimate");

   

   

    //Block Registry

    GameRegistry.registerBlock(blockMelonShard, "MelonShardBlock");

    GameRegistry.registerBlock(blockGrief, "Grief");

    GameRegistry.registerBlock(blockLidl, "Lidl");

    GameRegistry.registerBlock(blockTroll, "Troll");

    GameRegistry.registerBlock(blockYTroll, "YTroll");

    GameRegistry.registerBlock(blockLucky, "Lucky");

    GameRegistry.registerBlock(blockRoman, "Roman");

    GameRegistry.registerBlock(blockFurzPortal, "FurzPortal");

    GameRegistry.registerBlock(blockFurz, "Furz");

    GameRegistry.registerBlock(blockKKBlock, "KKBlock");

    GameRegistry.registerBlock(blockUCSBlock, "UCSBlock");

   

    //Item Registry

    GameRegistry.registerItem(itemHalfIron, "HalfIron");

    GameRegistry.registerItem(itemNGPKnife, "NGPKnife");

    GameRegistry.registerItem(itemMelonShard, "MelonShard");

    GameRegistry.registerItem(itemPumpkinBlood, "PumpkinBlood");

    GameRegistry.registerItem(itemActionFigur, "ActionFigur");

    GameRegistry.registerItem(itemPlastik, "Plastik");

    GameRegistry.registerItem(itemLidlIngot, "LidlIngot");

    GameRegistry.registerItem(itemGrieferIngot, "GrieferIngot");

    GameRegistry.registerItem(itemGayIngot, "GayIngot");

    GameRegistry.registerItem(itemObsidianIngot, "ObsidianIngot");

    GameRegistry.registerItem(itemRomanDeath, "RomanDeath");

    GameRegistry.registerItem(itemChaosNugget, "ChaosNugget");

    GameRegistry.registerItem(itemLuckyIngot, "LuckyIngot");

    GameRegistry.registerItem(itemRomanIngot, "RomanIngot");

    GameRegistry.registerItem(itemFurzShard, "FurzShard");

    GameRegistry.registerItem(itemHardenedFart, "HardenedFart");

    GameRegistry.registerItem(itemStolenMelons, "StolenMelons");

    GameRegistry.registerItem(itemJBCD, "JBCD");

    GameRegistry.registerItem(itemNGPShard, "NGPShard");

    GameRegistry.registerItem(itemBieberSpawnegg, "BieberSpawnegg");

    GameRegistry.registerItem(itemChaosShard, "ChaosShard");

    GameRegistry.registerItem(itemUCShard, "UCShard");

   

    //Entity Registry

    EntityRegistry.registerGlobalEntityID(EntityPumpkinMonster.class, "PumpkinMonster", 106, 0, 0);

    EntityRegistry.registerGlobalEntityID(EntityPumpkinMutant.class, "PumpkinMutant", 107, 0, 1);

   

    //Rendering Registry

    RenderingRegistry.registerEntityRenderingHandler(EntityPumpkinMonster.class, new RenderPumpkinMonster(new ModelPumpkinMonster(), 0.3F));

    RenderingRegistry.registerEntityRenderingHandler(EntityPumpkinMutant.class, new RenderPumpkinMutant(new ModelPumpkinMutant(), 0.4F));

   

    }

   

    @EventHandler

    public void Init(FMLInitializationEvent event){

   

    FMLCommonHandler.instance().bus().register(new CraftingHandler());

   

    //Recipes

    GameRegistry.addShapelessRecipe(new ItemStack(itemHalfIron, 2), new Object[]{new ItemStack(itemNGPKnife, 1, OreDictionary.WILDCARD_VALUE), Items.iron_ingot});

    GameRegistry.addRecipe(new ItemStack(itemNGPKnife), new Object[]{" I ", " I ", " N ", 'I', Items.iron_sword, 'N', itemNGPShard});

    GameRegistry.addRecipe(new ItemStack(blockMelonShard), new Object[]{"  ", " MM", " MM", 'M', itemMelonShard});

    GameRegistry.addRecipe(new ItemStack(blockRoman), new Object[]{"  ", " MM", " MM", 'M', itemRomanIngot});

    GameRegistry.addRecipe(new ItemStack(blockFurz), new Object[]{"  ", " MM", " MM", 'M', itemHardenedFart});

    GameRegistry.addRecipe(new ItemStack(blockUCSBlock), new Object[]{"  ", " MM", " MM", 'M', itemUCShard});

    GameRegistry.addRecipe(new ItemStack(blockGrief), new Object[]{"OXO", "XOX", "OXO", 'O', itemGrieferIngot, 'X', itemGayIngot});

    GameRegistry.addRecipe(new ItemStack(itemMelonShard), new Object[]{"GMG", "MDM", "OOO", 'G', Items.ghast_tear, 'D', Items.diamond, 'M', Items.melon, 'O', Blocks.obsidian});

    GameRegistry.addRecipe(new ItemStack(itemChaosShard), new Object[]{"COC", "DCD", "MMM", 'C', itemChaosNugget, 'D', Items.diamond, 'M', itemMelonShard, 'O', Blocks.obsidian});

    GameRegistry.addRecipe(new ItemStack(blockKKBlock), new Object[]{"FKF", "KOK", "FKF", 'F', itemHardenedFart, 'K', Blocks.pumpkin, 'O', Blocks.obsidian});

    GameRegistry.addRecipe(new ItemStack(blockLidl), new Object[]{"LLL", "LLL", "LLL", 'L', blockLidl});

   

   

    //Smelting

    GameRegistry.addSmelting(itemPlastik, new ItemStack(itemLidlIngot, 16), 16);

    GameRegistry.addSmelting(Blocks.obsidian, new ItemStack(itemObsidianIngot), 16);

    GameRegistry.addSmelting(blockGrief, new ItemStack(blockTroll), 16);

    GameRegistry.addSmelting(blockLucky, new ItemStack(itemLuckyIngot, 4), 16);

    GameRegistry.addSmelting(itemRomanDeath, new ItemStack(itemRomanIngot, 64), 16);

    GameRegistry.addSmelting(blockRoman, new ItemStack(blockFurzPortal), 16);

    GameRegistry.addSmelting(itemFurzShard, new ItemStack(itemHardenedFart), 16);

    GameRegistry.addSmelting(itemStolenMelons, new ItemStack(itemMelonShard), 16);

    GameRegistry.addSmelting(itemJBCD, new ItemStack(itemBieberSpawnegg), 16);

   

    //Handler

    GameRegistry.registerFuelHandler(new FuelHandler());

   

    //Entities

    EntityHandler.registerMonsters(EntityPumpkinMonster.class, "PumpkinMonster");

   

    //Bosses

    BossHandler.registerBosses(EntityPumpkinMutant.class, "PumpkinMutant");

   

    }

   

    @EventHandler

    public void PostInit(FMLPostInitializationEvent postEvent){

   

    }

 

}

 

 

 

EntityPumpkinMonster:

package com.netcrafter.mod.entity;

 

import net.minecraft.entity.SharedMonsterAttributes;

import net.minecraft.entity.ai.EntityAIAttackOnCollide;

import net.minecraft.entity.ai.EntityAIHurtByTarget;

import net.minecraft.entity.ai.EntityAILookIdle;

import net.minecraft.entity.ai.EntityAIMoveThroughVillage;

import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction;

import net.minecraft.entity.ai.EntityAINearestAttackableTarget;

import net.minecraft.entity.ai.EntityAISwimming;

import net.minecraft.entity.ai.EntityAIWander;

import net.minecraft.entity.ai.EntityAIWatchClosest;

import net.minecraft.entity.monster.EntityMob;

import net.minecraft.entity.passive.EntityVillager;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.world.World;

import net.minecraftforge.common.ForgeModContainer;

 

public class EntityPumpkinMonster extends EntityMob {

 

public EntityPumpkinMonster(World world) {

super(world);

        this.getNavigator().setBreakDoors(true);

        this.tasks.addTask(0, new EntityAISwimming(this));

        this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, true));

        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true));

        this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D));

        this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, true));

        this.tasks.addTask(7, new EntityAIWander(this, 1.0D));

        this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));

        this.tasks.addTask(8, new EntityAILookIdle(this));

        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));

        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));

        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, true));

        this.setSize(0.6F, 1.8F);

 

}

 

    protected void applyEntityAttributes()

    {

        super.applyEntityAttributes();

        this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);

        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D);

        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D);

        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);

        this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(20.0D);

    }

   

    protected boolean isAIEnabled()

    {

        return true;

    }

}

 

 

 

EntityPumpkinMutant:

package com.netcrafter.mod.entity;

 

import net.minecraft.entity.SharedMonsterAttributes;

import net.minecraft.entity.ai.EntityAIAttackOnCollide;

import net.minecraft.entity.ai.EntityAIHurtByTarget;

import net.minecraft.entity.ai.EntityAILookIdle;

import net.minecraft.entity.ai.EntityAIMoveThroughVillage;

import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction;

import net.minecraft.entity.ai.EntityAINearestAttackableTarget;

import net.minecraft.entity.ai.EntityAISwimming;

import net.minecraft.entity.ai.EntityAIWander;

import net.minecraft.entity.ai.EntityAIWatchClosest;

import net.minecraft.entity.monster.EntityMob;

import net.minecraft.entity.passive.EntityVillager;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.world.World;

import net.minecraftforge.common.ForgeModContainer;

 

public class EntityPumpkinMutant extends EntityMob {

 

public EntityPumpkinMutant(World world) {

    super(world);

        this.getNavigator().setBreakDoors(true);

        this.tasks.addTask(0, new EntityAISwimming(this));

        this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, true));

        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true));

        this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D));

        this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, true));

        this.tasks.addTask(7, new EntityAIWander(this, 1.0D));

        this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));

        this.tasks.addTask(8, new EntityAILookIdle(this));

        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));

        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));

        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, true));

        this.setSize(0.6F, 1.8F);

 

}

 

    protected void applyEntityAttributes()

    {

        super.applyEntityAttributes();

        this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);

        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D);

        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D);

        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);

    }

   

    protected boolean isAIEnabled()

    {

        return true;

    }

}

 

 

 

 

BossHandler:

package com.netcrafter.mod.handler;

 

import java.util.Random;

 

import net.minecraft.entity.EntityList;

import net.minecraft.entity.EnumCreatureType;

import net.minecraft.world.biome.BiomeGenBase;

 

import com.netcrafter.mod.LidlMelonRPG;

 

import cpw.mods.fml.common.registry.EntityRegistry;

 

public class BossHandler {

 

public static void registerBosses(Class bossClass, String name) {

int entityId = EntityRegistry.findGlobalUniqueEntityId();

long x = name.hashCode();

Random random = new Random(x);

int mainColor = random.nextInt() * 16777216;

int subColor = random.nextInt() * 16777216;

 

EntityRegistry.registerGlobalEntityID(bossClass, name, entityId);

EntityRegistry.addSpawn(bossClass, 50, 2, 4, EnumCreatureType.monster);

EntityRegistry.registerModEntity(bossClass, name, entityId, LidlMelonRPG.instance, 64, 1, true);

EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, mainColor, subColor));

}

}

 

 

 

EntityHandler:

package com.netcrafter.mod.handler;

 

import java.util.Random;

 

import net.minecraft.entity.EntityList;

import net.minecraft.entity.EnumCreatureType;

import net.minecraft.world.biome.BiomeGenBase;

 

import com.netcrafter.mod.LidlMelonRPG;

 

import cpw.mods.fml.common.registry.EntityRegistry;

 

public class EntityHandler {

 

public static void registerMonsters(Class entityClass, String name) {

int entityId = EntityRegistry.findGlobalUniqueEntityId();

long x = name.hashCode();

Random random = new Random(x);

int mainColor = random.nextInt() * 16777215;

int subColor = random.nextInt() * 16777215;

 

EntityRegistry.registerGlobalEntityID(entityClass, name, entityId);

EntityRegistry.addSpawn(entityClass, 50, 2, 4, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.forest);

EntityRegistry.registerModEntity(entityClass, name, entityId, LidlMelonRPG.instance, 64, 1, true);

EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, mainColor, subColor));

}

}

 

 

 

 

ModelPumpkinMonster:

package com.netcrafter.mod.model;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.client.model.ModelRenderer;

import net.minecraft.entity.Entity;

 

public class ModelPumpkinMonster extends ModelBase {

 

    ModelRenderer Body;

    ModelRenderer Neck;

    ModelRenderer Head;

 

  public ModelPumpkinMonster()

  {

    textureWidth = 64;

    textureHeight = 32;

   

      Body = new ModelRenderer(this, 0, 12);

      Body.addBox(0F, 0F, 0F, 12, 8, 12);

      Body.setRotationPoint(-6F, 16F, -6F);

      Body.setTextureSize(64, 32);

      Body.mirror = true;

      setRotation(Body, 0F, 0F, 0F);

      Neck = new ModelRenderer(this, 0, 0);

      Neck.addBox(0F, 0F, 0F, 8, 4, 8);

      Neck.setRotationPoint(-4F, 12F, -4F);

      Neck.setTextureSize(64, 32);

      Neck.mirror = true;

      setRotation(Neck, 0F, 0F, 0F);

      Head = new ModelRenderer(this, 48, 24);

      Head.addBox(0F, 0F, 0F, 4, 4, 4);

      Head.setRotationPoint(-2F, 8F, -2F);

      Head.setTextureSize(64, 32);

      Head.mirror = true;

      setRotation(Head, 0F, 0F, 0F);

  }

 

  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)

  {

    super.render(entity, f, f1, f2, f3, f4, f5);

    setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    Body.render(f5);

    Neck.render(f5);

    Head.render(f5);

  }

 

  private void setRotation(ModelRenderer model, float x, float y, float z)

  {

    model.rotateAngleX = x;

    model.rotateAngleY = y;

    model.rotateAngleZ = z;

  }

 

  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)

  {

    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    this.Body.render(f5);

   

  }

 

}

 

 

 

 

ModelPumpkinMutant:

package com.netcrafter.mod.model;

 

import net.minecraft.client.model.ModelBiped;

import net.minecraft.client.model.ModelRenderer;

import net.minecraft.entity.Entity;

 

public class ModelPumpkinMutant extends ModelBiped

{

 

    ModelRenderer head;

    ModelRenderer body;

    ModelRenderer rightarm;

    ModelRenderer leftarm;

    ModelRenderer rightleg;

    ModelRenderer leftleg;

 

  public ModelPumpkinMutant()

  {

    textureWidth = 64;

    textureHeight = 64;

   

      head = new ModelRenderer(this, 0, 0);

      head.addBox(-4F, -8F, -4F, 8, 8, 8);

      head.setRotationPoint(0F, 0F, 0F);

      head.setTextureSize(64, 32);

      head.mirror = true;

      setRotation(head, 0F, 0F, 0F);

      body = new ModelRenderer(this, 16, 16);

      body.addBox(-4F, 0F, -2F, 8, 12, 4);

      body.setRotationPoint(0F, 0F, 0F);

      body.setTextureSize(64, 32);

      body.mirror = true;

      setRotation(body, 0F, 0F, 0F);

      rightarm = new ModelRenderer(this, 40, 16);

      rightarm.addBox(-3F, -2F, -2F, 4, 12, 4);

      rightarm.setRotationPoint(-5F, 2F, 0F);

      rightarm.setTextureSize(64, 32);

      rightarm.mirror = true;

      setRotation(rightarm, 0F, 0F, 0F);

      leftarm = new ModelRenderer(this, 40, 16);

      leftarm.addBox(-1F, -2F, -2F, 4, 12, 4);

      leftarm.setRotationPoint(5F, 2F, 0F);

      leftarm.setTextureSize(64, 32);

      leftarm.mirror = true;

      setRotation(leftarm, 0F, 0F, 0F);

      rightleg = new ModelRenderer(this, 0, 16);

      rightleg.addBox(-2F, 0F, -2F, 4, 12, 4);

      rightleg.setRotationPoint(-2F, 12F, 0F);

      rightleg.setTextureSize(64, 32);

      rightleg.mirror = true;

      setRotation(rightleg, 0F, 0F, 0F);

      leftleg = new ModelRenderer(this, 0, 16);

      leftleg.addBox(-2F, 0F, -2F, 4, 12, 4);

      leftleg.setRotationPoint(2F, 12F, 0F);

      leftleg.setTextureSize(64, 32);

      leftleg.mirror = true;

      setRotation(leftleg, 0F, 0F, 0F);

  }

 

  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)

  {

    super.render(entity, f, f1, f2, f3, f4, f5);

    setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    head.render(f5);

    body.render(f5);

    rightarm.render(f5);

    leftarm.render(f5);

    rightleg.render(f5);

    leftleg.render(f5);

  }

 

  private void setRotation(ModelRenderer model, float x, float y, float z)

  {

    model.rotateAngleX = x;

    model.rotateAngleY = y;

    model.rotateAngleZ = z;

  }

 

  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)

  {

    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

  }

 

}

 

 

 

 

ClientProxy:

package com.netcrafter.mod.proxy;

 

import com.netcrafter.mod.entity.EntityPumpkinMonster;

import com.netcrafter.mod.entity.EntityPumpkinMutant;

import com.netcrafter.mod.model.ModelPumpkinMonster;

import com.netcrafter.mod.model.ModelPumpkinMutant;

import com.netcrafter.mod.renderer.RenderPumpkinMonster;

import com.netcrafter.mod.renderer.RenderPumpkinMutant;

 

import cpw.mods.fml.client.registry.RenderingRegistry;

 

public class ClientProxy extends CommonProxy {

 

public void registerRenderThings() {

 

//TileEntities

    //nothing

 

//Entities

RenderingRegistry.registerEntityRenderingHandler(EntityPumpkinMonster.class, new RenderPumpkinMonster(new ModelPumpkinMonster(), 0.3F));

RenderingRegistry.registerEntityRenderingHandler(EntityPumpkinMutant.class, new RenderPumpkinMutant(new ModelPumpkinMutant(), 0.4F));

 

}

 

}

 

 

 

 

CommonProxy:

package com.netcrafter.mod.proxy;

 

public class CommonProxy {

 

public void registerRenderThings() {

 

}

 

}

 

 

 

RenderPumpkinMonster:

package com.netcrafter.mod.renderer;

 

import com.netcrafter.mod.entity.EntityPumpkinMonster;

import com.netcrafter.mod.model.ModelPumpkinMonster;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.client.renderer.entity.Render;

import net.minecraft.client.renderer.entity.RenderLiving;

import net.minecraft.entity.Entity;

import net.minecraft.entity.EntityLiving;

import net.minecraft.util.ResourceLocation;

 

public class RenderPumpkinMonster extends RenderLiving {

 

public static final ResourceLocation texture = new ResourceLocation("netcrafter:textures/model/PumpkinMonster.png");

 

protected ModelPumpkinMonster modelEntity;

 

public RenderPumpkinMonster(ModelBase par1ModelBase, float par2) {

super(par1ModelBase, par2);

 

modelEntity = ((ModelPumpkinMonster) mainModel);

 

}

 

public void renderPumpkinMonster(EntityPumpkinMonster entity, double x, double y, double z, float u, float v) {

super.doRender(entity, x, y, z, u, v);

}

 

public void doRenderLiving(EntityLiving entityLiving, double x, double y, double z, float u, float v) {

renderPumpkinMonster((EntityPumpkinMonster)entityLiving, x, y, z, u, v);

}

 

public void doRender(Entity entity, double x, double y, double z, float u, float v) {

renderPumpkinMonster((EntityPumpkinMonster)entity, x, y, z, u, v);

}

 

@Override

protected ResourceLocation getEntityTexture(Entity var1) {

return texture;

}

 

}

 

 

 

 

RenderPumpkinMutant:

package com.netcrafter.mod.renderer;

 

import com.netcrafter.mod.entity.EntityPumpkinMutant;

import com.netcrafter.mod.model.ModelPumpkinMutant;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.client.renderer.entity.Render;

import net.minecraft.client.renderer.entity.RenderLiving;

import net.minecraft.entity.Entity;

import net.minecraft.entity.EntityLiving;

import net.minecraft.util.ResourceLocation;

 

public class RenderPumpkinMutant extends RenderLiving {

 

public static final ResourceLocation texture = new ResourceLocation("netcrafter:textures/model/PumpkinMutant.png");

 

protected ModelPumpkinMutant modelEntity;

 

public RenderPumpkinMutant(ModelBase par1ModelBase, float par2) {

super(par1ModelBase, par2);

 

modelEntity = ((ModelPumpkinMutant) mainModel);

 

}

 

public void renderPumpkinMutant(EntityPumpkinMutant entity, double x, double y, double z, float u, float v) {

super.doRender(entity, x, y, z, u, v);

}

 

public void doRenderLiving(EntityLiving entityLiving, double x, double y, double z, float u, float v) {

renderPumpkinMutant((EntityPumpkinMutant)entityLiving, x, y, z, u, v);

}

 

public void doRender(Entity entity, double x, double y, double z, float u, float v) {

renderPumpkinMutant((EntityPumpkinMutant)entity, x, y, z, u, v);

}

 

@Override

protected ResourceLocation getEntityTexture(Entity var1) {

return texture;

}

 

}

 

 

 

 

 

Hope you can help me. And yeah theres another spawn egg with the ID 3, I didn't made an entity with the ID 3 so I don't know. And that ID doesen't spawn anything. If I try spawn the ID 3 then it ignores it.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.