Jump to content

[1.6.4]Custom Tnt


starwarsmace

Recommended Posts

There are not tutorials for anything. Look at tutorials on how to make custom entities and then look at the vanilla TNT and go from there.

 

 

I looked at the vanilla code and made my own block,entity,and render file but I have one problem. The tnt explodes fine but my rendering doesnt work. When the entity comes in it just doesnt appear. But I know its there because it explodes. Here is my render file:

 

package rotten_flesh_mod;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

@SideOnly(Side.CLIENT)
public class RenderRottenFleshNukePrimed extends Render
{
    private RenderBlocks blockRenderer = new RenderBlocks();

    public RenderRottenFleshNukePrimed()
    {
        this.shadowSize = 0.5F;
    }

    public void renderPrimedTNT(EntityRottenFleshNukePrimed par1EntityTNTPrimed, double par2, double par4, double par6, float par8, float par9)
    {
        GL11.glPushMatrix();
        GL11.glTranslatef((float)par2, (float)par4, (float)par6);
        float f2;

        if ((float)par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F)
        {
            f2 = 1.0F - ((float)par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F;

            if (f2 < 0.0F)
            {
                f2 = 0.0F;
            }

            if (f2 > 1.0F)
            {
                f2 = 1.0F;
            }

            f2 *= f2;
            f2 *= f2;
            float f3 = 1.0F + f2 * 0.3F;
            GL11.glScalef(f3, f3, f3);
        }

        f2 = (1.0F - ((float)par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F;
        this.bindEntityTexture(par1EntityTNTPrimed);
        this.blockRenderer.renderBlockAsItem(Block.tnt, 0, par1EntityTNTPrimed.getBrightness(par9));

        if (par1EntityTNTPrimed.fuse / 5 % 2 == 0)
        {
            GL11.glDisable(GL11.GL_TEXTURE_2D);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
            this.blockRenderer.renderBlockAsItem(Block.tnt, 0, 1.0F);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glDisable(GL11.GL_BLEND);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glEnable(GL11.GL_TEXTURE_2D);
        }

        GL11.glPopMatrix();
    }

    protected ResourceLocation func_110808_a(EntityRottenFleshNukePrimed par1EntityTNTPrimed)
    {
        return TextureMap.locationBlocksTexture;
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected ResourceLocation getEntityTexture(Entity par1Entity)
    {
        return this.func_110808_a((EntityRottenFleshNukePrimed)par1Entity);
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
    {
        this.renderPrimedTNT((EntityRottenFleshNukePrimed)par1Entity, par2, par4, par6, par8, par9);
    }
}

 

 

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

Yeah, post ClientProxy and main mod file. And also add a println() statement to your render code, see if it get's actually called.

 

Ok ill try the println() and post my ClientProxy and main mod file.

 

Edit: I know its called because I have another entity and the render file for that is called.

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

Here is the client proxy:

 

package rotten_flesh_mod;

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


public class ClientProxy extends CommonProxy{
@Override
    public void registerRenderers() {
	RenderingRegistry.registerEntityRenderingHandler(EntityRottenFleshGrenade.class, new RenderRottenFleshGrenade(RottenFleshMod.rottenFleshGrenade));
	RenderingRegistry.registerEntityRenderingHandler(EntityRottenFleshNukePrimed.class, new RenderRottenFleshNukePrimed());
    }
public int addArmor(String par1){

	return RenderingRegistry.addNewArmourRendererPrefix(par1);

}
}

 

And heres the main mod file:

 

package rotten_flesh_mod;


import net.minecraft.block.Block;
import net.minecraft.block.StepSound;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemSoup;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.Potion;
import net.minecraftforge.common.EnumHelper;
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.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid=RottenFleshMod.modid,name="Rotten Flesh Mod",version="1.3")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class RottenFleshMod {
@Instance(value = RottenFleshMod.modid)
public static RottenFleshMod instance;
@SidedProxy(clientSide="rotten_flesh_mod.ClientProxy", serverSide="rotten_flesh_mod.CommonProxy")
    public static CommonProxy proxy;

public static final String modid ="rotten_flesh_mod";




//Items
	//Tools
public static Item rottenFleshPickaxe;
public static Item rottenFleshAxe;
public static Item rottenFleshShovel;
public static Item rottenFleshSword;
public static Item rottenFleshHoe;
	//Rings
public static Item rottenFleshRingFlyingOFF;
public static Item rottenFleshRingFlyingON;
public static Item rottenFleshRing;
public static Item rottenFleshRingInvisOFF;
public static Item rottenFleshRingInvisON;
	//Wand
public static Item rottenFleshWandLightningTop;
public static Item rottenFleshWandLightning;
public static Item rottenFleshWandFireBall;
public static Item rottenFleshWandFireBallTop;
public static Item rottenFleshWandZombieTamer;
public static Item rottenFleshWandZombieTamerTop;
	//Armor
public static Item rottenFleshSpeedBoots;



	//Misc
public static Item rottenFleshStick;
public static Item cookedZombieFlesh;
public static Item rottenFleshGrenade;
public static Item cookedZombieFleshSoup;
public static Item goldenRottenFlesh;

//Blocks
public static Block rottenFleshBlock;
public static Block cookedZombieFleshBlock;
public static Block rottenFleshSpawner;
public static Block cookedZombieFleshSpawner;
public static Block rottenFleshRainMaker;
public static Block rottenFleshNuke;

//Enums
public static EnumToolMaterial rottenFleshMaterial;

@EventHandler
public void preInit(FMLPreInitializationEvent event){

}

@EventHandler
public void load(FMLInitializationEvent event){
	proxy.registerServerTickHandler();
	cookedZombieFlesh=(new ItemFood(4744,6 ,0.2F, false).setUnlocalizedName("cookedZombieFlesh").setCreativeTab(CreativeTabs.tabFood).setTextureName("rotten_flesh_mod:cooked_zombie_flesh"));
	rottenFleshSpawner=(new RottenFleshSpawner(3002,Material.ground).setUnlocalizedName("rottenFleshSpawner").setCreativeTab(CreativeTabs.tabBlock).setTextureName("rotten_flesh_mod:rotten_flesh_spawner"));
	cookedZombieFleshSpawner=(new CookedZombieFleshSpawner(3001,Material.ground).setUnlocalizedName("cookedZombieFleshSpawner").setCreativeTab(CreativeTabs.tabBlock).setTextureName("rotten_flesh_mod:cooked_zombie_flesh_spawner"));
	rottenFleshMaterial=EnumHelper.addToolMaterial("rottenFleshMaterial", 0, 49, 1.5F, 0.0F, 15);
	rottenFleshPickaxe =(new ItemPickaxe(4745,rottenFleshMaterial).setUnlocalizedName("rottenFleshPickaxe").setCreativeTab(CreativeTabs.tabTools).setTextureName("rotten_flesh_mod:rotten_flesh_pickaxe"));
	rottenFleshAxe =(new ItemAxe(4746,rottenFleshMaterial).setUnlocalizedName("rottenFleshAxe").setCreativeTab(CreativeTabs.tabTools).setTextureName("rotten_flesh_mod:rotten_flesh_axe"));
	rottenFleshShovel =(new ItemSpade(4747,rottenFleshMaterial).setUnlocalizedName("rottenFleshShovel").setCreativeTab(CreativeTabs.tabTools).setTextureName("rotten_flesh_mod:rotten_flesh_shovel"));
	rottenFleshSword =(new ItemSword(4748,rottenFleshMaterial).setUnlocalizedName("rottenFleshSword").setCreativeTab(CreativeTabs.tabCombat).setTextureName("rotten_flesh_mod:rotten_flesh_sword"));
	rottenFleshHoe=(new ItemHoe(4749,rottenFleshMaterial).setUnlocalizedName("rottenFleshHoe").setCreativeTab(CreativeTabs.tabTools).setTextureName("rotten_flesh_mod:rotten_flesh_hoe"));
	rottenFleshRingFlyingOFF=(new RottenFleshRingFlyingOFF(4750).setUnlocalizedName("rottenFleshRingFlyingOFF").setCreativeTab(CreativeTabs.tabMisc).setTextureName("rotten_flesh_mod:rottenFleshRingFlyingOFF").setMaxStackSize(1));
	rottenFleshRingFlyingON=(new RottenFleshRingFlyingON(4751).setUnlocalizedName("rottenFleshRingFlyingON").setTextureName("rotten_flesh_mod:rottenFleshRingFlyingON").setMaxStackSize(1));
	rottenFleshRing=(new Item(4752).setUnlocalizedName("rottenFleshRing").setCreativeTab(CreativeTabs.tabMisc).setTextureName("rotten_flesh_mod:rottenFleshRing"));
	rottenFleshRingInvisOFF=(new RottenFleshRingInvisOFF(4753).setUnlocalizedName("rottenFleshRingInvisOFF").setCreativeTab(CreativeTabs.tabMisc).setTextureName("rotten_flesh_mod:rottenFleshRingInvisOFF"));
	rottenFleshRingInvisON=(new RottenFleshRingInvisON(4754).setUnlocalizedName("rottenFleshRingInvisOn").setTextureName("rotten_flesh_mod:rottenFleshRingInvisON"));
	rottenFleshStick=(new Item(4755).setUnlocalizedName("rottenFleshStick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("rotten_flesh_mod:rottenFleshStick"));
	rottenFleshWandLightning=(new RottenFleshWandLightning(4756).setUnlocalizedName("rottenFleshWandLightning").setCreativeTab(CreativeTabs.tabCombat).setTextureName("rotten_flesh_mod:rottenFleshWandLightning"));
	rottenFleshWandFireBall=(new RottenFleshWandFireBall(4757).setUnlocalizedName("rottenFleshWandFireBall").setCreativeTab(CreativeTabs.tabCombat).setTextureName("rotten_flesh_mod:rottenFleshFireBall"));
	rottenFleshWandLightningTop=(new Item(4758).setUnlocalizedName("rottenFleshWandLightningTop").setCreativeTab(CreativeTabs.tabMisc).setTextureName("rotten_flesh_mod:rottenFleshWandLightningTop"));
	rottenFleshWandFireBallTop=(new Item(4759).setUnlocalizedName("rottenFleshWandFireBallTop").setCreativeTab(CreativeTabs.tabMisc).setTextureName("rotten_flesh_mod:rottenFleshFireBallTop"));
	rottenFleshBlock=(new Block(3003,Material.ground).setUnlocalizedName("rottenFleshBlock").setCreativeTab(CreativeTabs.tabBlock).setTextureName("rotten_flesh_mod:rottenFleshBlock"));
	cookedZombieFleshBlock=(new Block(3004,Material.ground).setUnlocalizedName("cookedZombieFleshBlock").setCreativeTab(CreativeTabs.tabBlock).setTextureName("rotten_flesh_mod:cookedZombieFleshBlock"));
	rottenFleshSpeedBoots =  new SpeedBoots(4760,EnumArmorMaterial.CLOTH,proxy.addArmor("RottenFleshSpeedBoot"), 3).setUnlocalizedName("rottenFleshSpeedBoots").setCreativeTab(CreativeTabs.tabCombat).setMaxStackSize(1).setTextureName("rotten_flesh_mod:rottenFleshSpeedBoot");
	rottenFleshGrenade= new RottenFleshGrenade(4761).setUnlocalizedName("rottenFleshGrenade").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabCombat).setTextureName("rotten_flesh_mod:rottenfleshgrenade").setMaxStackSize(16);
	cookedZombieFleshSoup=(new ItemSoup(4762,10).setUnlocalizedName("cookedZombieFleshSoup").setCreativeTab(CreativeTabs.tabFood).setTextureName("rotten_flesh_mod:cooked_zombie_flesh_stew"));
	rottenFleshWandZombieTamer=(new RottenFleshWandZombieTamer(4763).setUnlocalizedName("rottenFleshWandZombieTamer").setCreativeTab(CreativeTabs.tabTools).setTextureName("rotten_flesh_mod:rottenFleshWandTaming"));
	rottenFleshWandZombieTamerTop=(new Item(4764).setUnlocalizedName("rottenFleshWandZombieTamerTop").setCreativeTab(CreativeTabs.tabMisc).setTextureName("rotten_flesh_mod:rottenFleshWandTamingTop"));
	goldenRottenFlesh=(new GoldenRottenFlesh(4765, 3, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 1, 1.0F).setUnlocalizedName("goldenRottenFlesh").setTextureName("rotten_flesh_mod:golden_rotten_flesh"));
	rottenFleshRainMaker=(new RottenFleshRainMaker(3005,Material.ground).setUnlocalizedName("rottenFleshRainMaker").setCreativeTab(CreativeTabs.tabMisc).setTextureName("rotten_flesh_mod:rottenFleshRainMaker"));
	rottenFleshNuke=(new RottenFleshNuke(3006).setHardness(0.0F).setStepSound(new StepSound("grass", 1.0F, 1.0F)).setUnlocalizedName("rottenFleshNuke").setTextureName("rotten_flesh_mod:rottenFleshNuke"));

	proxy.registerRenderers();
	EntityRegistry.registerModEntity(EntityRottenFleshGrenade.class, "Rotten Flesh Grenade", 1 ,this,64, 10, true);
	EntityRegistry.registerModEntity(EntityRottenFleshNukePrimed.class, "Rotten Flesh Nuke Primed", 2, this, 64, 10, true);


	GameRegistry.addRecipe(new ItemStack(rottenFleshSpawner,1),new Object[]{
		"XXX","XRX","XXX",'X',new ItemStack(Block.blockGold,1),'R',new ItemStack(Item.rottenFlesh,1)

	});
	GameRegistry.addRecipe(new ItemStack(cookedZombieFleshSpawner,1),new Object[]{
		"XXX","XRX","XXX",'X',new ItemStack(Block.blockDiamond,1),'R',new ItemStack(cookedZombieFlesh,1)

	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshPickaxe,1),new Object[]{
		"XXX"," S "," S ",'X',new ItemStack(Item.rottenFlesh,1),'S',new ItemStack(Item.stick,1)

	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshAxe,1),new Object[]{
		"XX ","XS "," S ",'X',new ItemStack(Item.rottenFlesh,1),'S',new ItemStack(Item.stick,1)

	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshShovel,1),new Object[]{
		" X "," S "," S ",'X',new ItemStack(Item.rottenFlesh,1),'S',new ItemStack(Item.stick,1)

	});

	GameRegistry.addRecipe(new ItemStack(rottenFleshSword,1),new Object[]{
		" X "," X "," S ",'X',new ItemStack(Item.rottenFlesh,1),'S',new ItemStack(Item.stick,1)

	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshHoe,1),new Object[]{
		"XX "," S "," S ",'X',new ItemStack(Item.rottenFlesh,1),'S',new ItemStack(Item.stick,1)

	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshRing,1),new Object[]{
		"XXX","X X","XXX",'X',new ItemStack(Item.rottenFlesh,1)

	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshRingFlyingOFF,1),new Object[]{
		"XFX","XRX","XXX",'X',new ItemStack(Block.blockDiamond,1),'F',new ItemStack(Item.feather),'R',new ItemStack(rottenFleshRing)

	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshRingInvisOFF,1),new Object[]{
		"XFX","XRX","XXX",'X',new ItemStack(Block.blockDiamond,1),'F',new ItemStack(Block.glass),'R',new ItemStack(rottenFleshRing)

	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshStick,4),new Object[]{
		"   "," X "," X ",'X',new ItemStack(Item.rottenFlesh,1)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshWandLightningTop,1),new Object[]{
		"EDN","DRD","DDD",'D',new ItemStack(Block.blockDiamond,1),'R',new ItemStack(Block.blockRedstone),'E',new ItemStack(Item.emerald),'N',new ItemStack(Item.netherStar)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshWandLightning,1),new Object[]{
		"DRD","GXG","IXI",'X',new ItemStack(rottenFleshStick,1),'R',new ItemStack(rottenFleshWandLightningTop,1),'D',new ItemStack(Item.diamond),'G',new ItemStack(Item.ingotGold),'I',new ItemStack(Item.ingotIron)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshBlock,1),new Object[]{
		"XXX","XXX","XXX",'X',new ItemStack(Item.rottenFlesh,1)
	});
	GameRegistry.addRecipe(new ItemStack(cookedZombieFleshBlock,1),new Object[]{
		"XXX","XXX","XXX",'X',new ItemStack(cookedZombieFlesh,1)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshWandFireBallTop,1),new Object[]{
		"EDN","DRD","DDD",'D',new ItemStack(Block.blockDiamond,1),'R',new ItemStack(Block.glowStone),'E',new ItemStack(Item.emerald),'N',new ItemStack(Item.netherStar)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshWandFireBall,1),new Object[]{
		"DRD","GXG","IXI",'X',new ItemStack(rottenFleshStick,1),'R',new ItemStack(rottenFleshWandFireBallTop,1),'D',new ItemStack(Item.diamond),'G',new ItemStack(Item.ingotGold),'I',new ItemStack(Item.ingotIron)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshSpeedBoots,1),new Object[]{
		"GIG","RLR","RLR",'R',new ItemStack(Item.rottenFlesh,1),'G',new ItemStack(Item.ingotGold,1),'I',new ItemStack(Item.ingotIron),'L',new ItemStack(Item.dyePowder,1,4)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshGrenade,1),new Object[]{
		"GIG","IRI","GIG",'R',new ItemStack(Item.rottenFlesh,1),'G',new ItemStack(Item.gunpowder,1),'I',new ItemStack(Item.ingotIron)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshWandZombieTamerTop,1),new Object[]{
		"EDN","DRD","DDD",'D',new ItemStack(Block.blockDiamond,1),'R',new ItemStack(Item.rottenFlesh),'E',new ItemStack(Item.emerald),'N',new ItemStack(Item.netherStar)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshWandZombieTamer,1),new Object[]{
		"DRD","GXG","IXI",'X',new ItemStack(rottenFleshStick,1),'R',new ItemStack(rottenFleshWandZombieTamerTop,1),'D',new ItemStack(Item.diamond),'G',new ItemStack(Item.ingotGold),'I',new ItemStack(Item.ingotIron)
	});
	GameRegistry.addShapelessRecipe(new ItemStack(cookedZombieFleshSoup),new ItemStack(Item.bowlEmpty),new ItemStack(cookedZombieFlesh),new ItemStack(cookedZombieFlesh));
	GameRegistry.addRecipe(new ItemStack(goldenRottenFlesh,1),new Object[]{
		"GGG","GRG","GGG",'G',new ItemStack(Item.ingotGold,1),'R',new ItemStack(Item.rottenFlesh,1)
	});
	GameRegistry.addRecipe(new ItemStack(rottenFleshRainMaker,1),new Object[]{
		"WWW","WRW","WWW",'W',new ItemStack(Item.bucketWater,1),'R',new ItemStack(Item.rottenFlesh,1)
	});



	GameRegistry.addSmelting(Item.rottenFlesh.itemID,new ItemStack(cookedZombieFlesh),0.1F);
	GameRegistry.registerItem(cookedZombieFlesh, "cookedZombieFlesh");
	GameRegistry.registerItem(rottenFleshPickaxe, "rottenFleshPickaxe");
	GameRegistry.registerItem(rottenFleshAxe, "rottenFleshAxe");
	GameRegistry.registerItem(rottenFleshShovel, "rottenFleshShovel");
	GameRegistry.registerItem(rottenFleshSword, "rottenFleshSword");
	GameRegistry.registerItem(rottenFleshHoe, "rottenFleshHoe");
	GameRegistry.registerItem(rottenFleshRingFlyingOFF, "rottenFleshRingFlyingOFF");
	GameRegistry.registerItem(rottenFleshRingFlyingON, "rottenFleshRingFlyingON");
	GameRegistry.registerItem(rottenFleshRing, "rottenFleshRing");
	GameRegistry.registerItem(rottenFleshRingInvisOFF, "rottenFleshRingInvisOFF");
	GameRegistry.registerItem(rottenFleshRingInvisON, "rottenFleshRingInvisON");
	GameRegistry.registerItem(rottenFleshStick, "rottenFleshStick");
	GameRegistry.registerItem(rottenFleshWandLightning, "rottenFleshWandLightning");
	GameRegistry.registerItem(rottenFleshWandLightningTop, "rottenFleshWandLightningTop");
	GameRegistry.registerItem(rottenFleshWandFireBall, "rottenFleshWandFireBall");
	GameRegistry.registerItem(rottenFleshWandFireBallTop, "rottenFleshWandFireBallTop");
	GameRegistry.registerItem(rottenFleshSpeedBoots, "rottenFleshSpeedBoots");
	GameRegistry.registerItem(rottenFleshGrenade, "rottenFleshGrenade");
	GameRegistry.registerItem(cookedZombieFleshSoup, "cookedZombieFleshSoup");
	GameRegistry.registerItem(rottenFleshWandZombieTamer, "rottenFleshWandZombieTamer");
	GameRegistry.registerItem(rottenFleshWandZombieTamerTop, "rottenFleshWandZombieTamerTop");
	GameRegistry.registerItem(goldenRottenFlesh, "goldenRottenFlesh");
	GameRegistry.registerBlock(cookedZombieFleshSpawner, modid+cookedZombieFleshSpawner.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(rottenFleshSpawner, modid+rottenFleshSpawner.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(rottenFleshBlock, modid+rottenFleshBlock.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(cookedZombieFleshBlock, modid+cookedZombieFleshBlock.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(rottenFleshRainMaker, modid+rottenFleshRainMaker.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(rottenFleshNuke, modid+rottenFleshNuke.getUnlocalizedName().substring(5));

	LanguageRegistry.addName(cookedZombieFlesh, "Cooked Zombie Flesh");
	LanguageRegistry.addName(rottenFleshSpawner, "Rotten Flesh Spawner");
	LanguageRegistry.addName(cookedZombieFleshSpawner, "Cooked Zombie Flesh Spawner");
	LanguageRegistry.addName(rottenFleshPickaxe, "Rotten Flesh Pickaxe");
	LanguageRegistry.addName(rottenFleshAxe, "Rotten Flesh Axe");
	LanguageRegistry.addName(rottenFleshShovel, "Rotten Flesh Shovel");
	LanguageRegistry.addName(rottenFleshSword, "Rotten Flesh Sword");
	LanguageRegistry.addName(rottenFleshHoe, "Rotten Flesh Hoe");
	LanguageRegistry.addName(rottenFleshRingFlyingOFF, "Rotten Flesh Ring Of Flying");
	LanguageRegistry.addName(rottenFleshRingFlyingON, "Rotten Flesh Ring Of Flying");
	LanguageRegistry.addName(rottenFleshRing, "Rotten Flesh Ring");
	LanguageRegistry.addName(rottenFleshRingInvisOFF, "Rotten Flesh Ring Of Invisibility");
	LanguageRegistry.addName(rottenFleshRingInvisON, "Rotten Flesh Ring Of Invisibility");
	LanguageRegistry.addName(rottenFleshStick, "Rotten Flesh Stick");
	LanguageRegistry.addName(rottenFleshWandLightning, "Rotten Flesh Wand Of Lightning");
	LanguageRegistry.addName(rottenFleshWandLightningTop, "Rotten Flesh Wand Of Lightning Top");
	LanguageRegistry.addName(rottenFleshWandFireBall, "Rotten Flesh Wand Of Fire");
	LanguageRegistry.addName(rottenFleshWandFireBallTop, "Rotten Flesh Wand Of Fire Top");
	LanguageRegistry.addName(rottenFleshBlock, "Block Of Rotten Flesh");
	LanguageRegistry.addName(cookedZombieFleshBlock, "Block of Cooked Zombie Flesh");
	LanguageRegistry.addName(rottenFleshSpeedBoots, "Rotten Flesh Speed Boots");
	LanguageRegistry.addName(rottenFleshGrenade, "Rotten Flesh Grenade");
	LanguageRegistry.addName(cookedZombieFleshSoup, "Cooked Zombie Flesh Soup");
	LanguageRegistry.addName(rottenFleshWandZombieTamer, "Rotten Flesh Wand Of Zombie Taming");
	LanguageRegistry.addName(rottenFleshWandZombieTamerTop, "Rotten Flesh Wand Of Zombie Taming Top");
	LanguageRegistry.addName(goldenRottenFlesh, "Golden Rotten Flesh");
	LanguageRegistry.addName(rottenFleshRainMaker, "Rotten Flesh Rain Maker");
	LanguageRegistry.addName(rottenFleshNuke,"Rotten Flesh Nuke");
}	
}

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

Edit: I know its called because I have another entity and the render file for that is called.

That conclusion makes no sense.

Is the render file called now or not?

 

Sorry about my bad wording. Yes it does call the render file.

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

I didn't read it in-depth, but I saw something about EntityTNTPrimed instead of your custom one -- in your Render class.

 

I think you saw par1EntityTNTPrimed. Read it in-depth and youll see what I did.

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

Ah, you're right.

 

I've heard of people have this problem.

*looks in history*

Yeah, I got it.

Can you please show me your Entity class?

 

Here you go.

 

Enitity Class:

 

package rotten_flesh_mod;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;

public class EntityRottenFleshNukePrimed extends Entity
{
    /** How long the fuse is */
    public int fuse;
    private EntityLivingBase tntPlacedBy;

    public EntityRottenFleshNukePrimed(World par1World)
    {
        super(par1World);
        this.fuse=600;
        this.preventEntitySpawning = true;
        this.setSize(0.98F, 0.98F);
        this.yOffset = this.height / 2.0F;
    }

    public EntityRottenFleshNukePrimed(World par1World, double par2, double par4, double par6, EntityLivingBase par8EntityLivingBase)
    {
        this(par1World);
        this.setPosition(par2, par4, par6);
        float f = (float)(Math.random() * Math.PI * 2.0D);
        this.motionX = (double)(-((float)Math.sin((double)f)) * 0.02F);
        this.motionY = 0.20000000298023224D;
        this.motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F);
        this.fuse = 600;
        this.prevPosX = par2;
        this.prevPosY = par4;
        this.prevPosZ = par6;
        this.tntPlacedBy = par8EntityLivingBase;
    }

    protected void entityInit() {}

    /**
     * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
     * prevent them from trampling crops
     */
    protected boolean canTriggerWalking()
    {
        return false;
    }

    /**
     * Returns true if other Entities should be prevented from moving through this Entity.
     */
    public boolean canBeCollidedWith()
    {
        return !this.isDead;
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        this.prevPosX = this.posX;
        this.prevPosY = this.posY;
        this.prevPosZ = this.posZ;
        this.motionY -= 0.03999999910593033D;
        this.moveEntity(this.motionX, this.motionY, this.motionZ);
        this.motionX *= 0.9800000190734863D;
        this.motionY *= 0.9800000190734863D;
        this.motionZ *= 0.9800000190734863D;

        if (this.onGround)
        {
            this.motionX *= 0.699999988079071D;
            this.motionZ *= 0.699999988079071D;
            this.motionY *= -0.5D;
        }

        if (this.fuse-- <= 0)
        {
            this.setDead();

            if (!this.worldObj.isRemote)
            {
                this.explode();
            }
        }
        else
        {
            this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
        }
    }

    private void explode()
    {
        float f = 30F;
        this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true);
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
    {
        par1NBTTagCompound.setByte("Fuse", (byte)this.fuse);
    }

    /**
     * (abstract) Protected helper method to read subclass entity data from NBT.
     */
    protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
    {
        this.fuse = par1NBTTagCompound.getByte("Fuse");
    }

    @SideOnly(Side.CLIENT)
    public float getShadowSize()
    {
        return 0.0F;
    }

    /**
     * returns null or the entityliving it was placed or ignited by
     */
    public EntityLivingBase getTntPlacedBy()
    {
        return this.tntPlacedBy;
    }
}

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

Did you bind your texture for your entity?

Not sure, but I found this in RenderTNTPrimed.

 

loadTexture("/terrain.png");

I dont have that in my RenderTntPrimed

What version of forge are you using?

Im using 9.11.1.965

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

9.11.1.916 for 1.6.4.

 

I really don't know. tbh.

-- iow: i don't think i can help you any further xD --

 

Oh well. I guess Ill scratch this or something. Thanks for trying though.

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

this.blockRenderer.renderBlockAsItem(Block.tnt, 0, par1EntityTNTPrimed.getBrightness(par9));
-snip-
            this.blockRenderer.renderBlockAsItem(Block.tnt, 0, 1.0F);

Are you using the vanilla tnt block for rendering here, or is it your own ?

 

Oh sorry not to update you guys. I actually changed this part to my nuke but it still didn't work. sad.gif

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

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.

Announcements



×
×
  • Create New...

Important Information

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