Jump to content

[SOLVED]render class not working


ralphyrafa

Recommended Posts

so the problem is that when i shoot with a certain item an entity is supposed to appear like if it was a gun, the effects work but the bullet or what you want to call it doesnt appear, and may be a problem with trying to register it i dont know here i will put the classes

 

This is the base mod

 

package medieval;

import medieval.medievalblocks.blocks.BlockRubyBlock;
import medieval.medievalblocks.blocks.BlockSapphireBlock;
import medieval.medievalblocks.ores.BlockRubyOre;
import medieval.medievalblocks.ores.BlockSapphireOre;
import medieval.medievalentities.Pixie_Entity;
import medieval.medievalitems.containers.Empty_Bag;
import medieval.medievalitems.containers.Filled_Pixiedustbag;
import medieval.medievalitems.etc.ItemRuby;
import medieval.medievalitems.etc.ItemSapphire;
import medieval.medievalitems.etc.Magesteel_Ingot;
import medieval.medievalitems.etc.Pixie_Dust;
import medieval.medievalitems.etc.Raw_Combination;
import medieval.medievalitems.maces.Diamond_Mace;
import medieval.medievalitems.maces.Golden_Mace;
import medieval.medievalitems.maces.Iron_Mace;
import medieval.medievalitems.maces.Stone_Mace;
import medieval.medievalitems.maces.Wooden_Mace;
import medieval.medievalitems.naginatas.Diamond_Naginata;
import medieval.medievalitems.naginatas.Golden_Naginata;
import medieval.medievalitems.naginatas.Iron_Naginata;
import medieval.medievalitems.naginatas.Stone_Naginata;
import medieval.medievalitems.naginatas.Wooden_Naginata;
import medieval.medievalitems.spawns.Pixie_Orb;
import medieval.medievalitems.wands.Diamond_Wand;
import medieval.medievalitems.wands.Emerald_Wand;
import medieval.medievalitems.wands.Fire_Wand;
import medieval.medievalitems.wands.Ruby_Wand;
import medieval.medievalitems.wands.Sapphire_Wand;
import medieval.medievalmodels.Pixie_Model;
import medieval.medievalprojectiles.Diamondbolt;
import medieval.medievalprojectiles.Emeraldbolt;
import medieval.medievalprojectiles.Firebolt;
import medieval.medievalprojectiles.Rubybolt;
import medieval.medievalprojectiles.Sapphirebolt;
import medieval.medievalproxy.ServerProxy;
import medieval.medievalrender.Pixie_Render;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
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="medieval", name="Medieval Mod", version="V1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class Medieval 
{

@SidedProxy(clientSide = "medieval.medievalproxy.ClientProxy", serverSide = "medieval.medievalproxy.ServerProxy")
    public static ServerProxy proxy;
public static CreativeTabs medievaltab = new Medieval_tab(CreativeTabs.getNextID(), "Medieval Mod");
public static Item LOGO;
public static Item maceW;
public static Item maceS;
public static Item maceI;
public static Item maceG;
    public static Item maceD;
    public static Item naginataW;
    public static Item naginataS;
    public static Item naginataI;
    public static Item naginataG;
    public static Item naginataD;
    public static Item wandD;
    public static Item wandE;
    public static Item wandR;
    public static Item wandSa;
    public static Item wandf;
    public static Item rawCombination;
    public static Item mageIngot;
public static Item pemerald;
public static Item pdiamond;
public static Item psapphire;
public static Item pruby;
public static Block Sappore;
    public static Item Sapphireitem;
    public static Block SapphireBlock;
    public static Block Rubyore;
    public static Item Rubyitem;
    public static Block RubyBlock;
    public static Item fireBolt;
    public static Item pdust;
    public static Item bag;
    public static Item pbag;
    public static Item porb;
  
    
    //ENTITY ID REGISTRY
    public static int getUniqueID()
{
    	int EntityID = 300;
	do
	{
		EntityID++;
	}
	while (EntityList.getStringFromID(EntityID) !=null);
	return EntityID;
}
    
    public static void registerEntityEgg(Class<? extends Entity> entity, int primarycolor, int secondarycolor)
    {
    int id = getUniqueID();
    EntityList.IDtoClassMapping.put(id, entity);
    EntityList.entityEggs.put(id, new EntityEggInfo(id, primarycolor , secondarycolor));
    }
    
@cpw.mods.fml.common.Mod.PreInit
public void PreInit(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());

config.load();

config.save();
}

@Init
public void load(FMLInitializationEvent event)
{


    
    
       //PROXY
   proxy.registerRenderThings();


   
                   //OREGENERATOR
GameRegistry.registerWorldGenerator(new medievalblockgenerate());

                           
                     //LOGO
   LOGO = new medievallogo(7000).setUnlocalizedName("logo");

   
                      //MOBS
   {
	//PIXIE

	EntityRegistry.addSpawn(Pixie_Entity.class , 10, 5, 10, EnumCreatureType.ambient, BiomeGenBase.extremeHills);
	EntityRegistry.registerGlobalEntityID(Pixie_Entity.class, "Pixie", 0);
	EntityRegistry.findGlobalUniqueEntityId();
	LanguageRegistry.instance().addStringLocalization("entity.Pixie.name", "Pixie");
        registerEntityEgg(Pixie_Entity.class, 0x05F205, 0x00F2D6);
   }
   

            //ITEMS
{

//MAGICALDUST
pdust= new Pixie_Dust(6000).setUnlocalizedName("pixiedust");
GameRegistry.registerItem(pdust, "Pixie Dust");
LanguageRegistry.addName(pdust, "Pixie Dust");

//BAG
bag= new Empty_Bag(6001).setUnlocalizedName("bag");
GameRegistry.registerItem(bag, "Bag");
LanguageRegistry.addName(bag, "Bag");


//FILLED MAGIC DUST
pbag= new Filled_Pixiedustbag(6002).setUnlocalizedName("pbag").setContainerItem(pbag);
GameRegistry.registerItem(pbag, "Bag of Pixie Dust");
LanguageRegistry.addName(pbag, "Bag of Pixie Dust");


//RAW COMBINATION
rawCombination = new Raw_Combination(6003).setUnlocalizedName("rawcombination");
GameRegistry.registerItem(rawCombination, "Raw Combination");
LanguageRegistry.addName(rawCombination, "Raw Combination");


//MAGESTEEL INGOT
mageIngot = new Magesteel_Ingot(6004).setUnlocalizedName("magesteelingot");
GameRegistry.registerItem(mageIngot, "Magesteel Ingot");
LanguageRegistry.addName(mageIngot, "Magesteel Ingot");


//SAPPHIRE ITEM
Sapphireitem = new ItemSapphire(6005).setUnlocalizedName("sapphire");
GameRegistry.registerItem(Sapphireitem, "Sapphire");
LanguageRegistry.addName(Sapphireitem, "Sapphire");


//RUBY ITEM
Rubyitem= new ItemRuby(6006).setUnlocalizedName("ruby");
GameRegistry.registerItem(Rubyitem, "Ruby");
LanguageRegistry.addName(Rubyitem, "Ruby");

//PIXIE ORB
porb = new Pixie_Orb(6007).setUnlocalizedName("porb");
GameRegistry.registerItem(porb, "Pixie Orb");
LanguageRegistry.addName(porb, "Pixie Orb");
}



                            //ORES/BLOCKS
{
//SAPPHIRE ORE
Sappore= new BlockSapphireOre(3000, 0).setHardness(0.9F).setResistance(5.0f).setUnlocalizedName("sapphireore");
GameRegistry.registerBlock(Sappore, "Sapphire Ore");
LanguageRegistry.addName(Sappore, "Sapphire Ore");



//SAPPHIRE BLOCK
SapphireBlock = new BlockSapphireBlock(3002, 0).setHardness(0.9F).setResistance(5.0f).setUnlocalizedName("sapphireblock");
GameRegistry.registerBlock(SapphireBlock, "Sapphire Block");
LanguageRegistry.addName(SapphireBlock, "Sapphire Block");


//RUBY ORE
Rubyore = new BlockRubyOre(3003, 0).setHardness(0.9F).setResistance(5.0f).setUnlocalizedName("rubyore");
GameRegistry.registerBlock(Rubyore, "Ruby Ore");
LanguageRegistry.addName(Rubyore, "Ruby Ore");



//RUBY BLOCK
RubyBlock = new BlockRubyBlock(3005, 0).setHardness(0.9F).setResistance(5.0f).setUnlocalizedName("rubyblock");
GameRegistry.registerBlock(RubyBlock, "Ruby Block");
LanguageRegistry.addName(RubyBlock, "Ruby Block");
}

                           //WEAPONS 

{	
//WOODEN MACE
maceW = new Wooden_Mace(4000, medievalweaponproperties.WOODMACE).setUnlocalizedName("macewood");
GameRegistry.registerItem(maceW, "Wooden Mace");
LanguageRegistry.addName(maceW, "Wooden Mace");


//STONE MACE
maceS = new Stone_Mace(4001, medievalweaponproperties.STONEMACE).setUnlocalizedName("macestone");
GameRegistry.registerItem(maceS, "Stone Mace");
LanguageRegistry.addName(maceS, "Stone Mace");

    
//IRON MACE
maceI = new Iron_Mace(4002, medievalweaponproperties.IRONMACE).setUnlocalizedName("maceiron");
GameRegistry.registerItem(maceI, "Iron Mace");
LanguageRegistry.addName(maceI, "Iron Mace");


//GOLDEN MACE
maceG = new Golden_Mace(4003, medievalweaponproperties.GOLDMACE).setUnlocalizedName("macegold");
GameRegistry.registerItem(maceG, "Golden Mace");        
LanguageRegistry.addName(maceG, "Golden Mace");


//DIAMOND MACE
maceD = new Diamond_Mace(4004, medievalweaponproperties.DIAMONDMACE).setUnlocalizedName("macediamond");
GameRegistry.registerItem(maceD, "Diamond Mace");
LanguageRegistry.addName(maceD, "Diamond Mace");


//WOOD NAGINATA
naginataW = new Wooden_Naginata(4005, medievalweaponproperties.WOODNAGINATA).setUnlocalizedName("naginatawood");
GameRegistry.registerItem(naginataW, "Wooden Naginata");
LanguageRegistry.addName(naginataW, "Wooden Naginata");


//STONE NAGINATA  
naginataS = new Stone_Naginata(4006, medievalweaponproperties.STONENAGINATA).setUnlocalizedName("naginatastone");
GameRegistry.registerItem(naginataS, "Stone Nigata");
LanguageRegistry.addName(naginataS, "Stone Naginata");


//IRON NAGINATA
naginataI = new Iron_Naginata(4007, medievalweaponproperties.IRONNAGINATA).setUnlocalizedName("naginatairon");
GameRegistry.registerItem(naginataI, "Iron Naginata");
LanguageRegistry.addName(naginataI, "Iron Naginata");


//GOLD NAGINATA
naginataG = new Golden_Naginata(4008, medievalweaponproperties.GOLDNAGINATA).setUnlocalizedName("naginatagold");
GameRegistry.registerItem(naginataG, "Golden Naginata");
LanguageRegistry.addName(naginataG, "Golden Naginata");


//DIAMOND NAGINATA
naginataD = new Diamond_Naginata(4009, medievalweaponproperties.DIAMONDNAGINATA).setUnlocalizedName("naginatadiamond");
GameRegistry.registerItem(naginataD, "Diamond Naginata");
LanguageRegistry.addName(naginataD, "Diamond Naginata");


//DIAMOND WAND
wandD = new Diamond_Wand(4012, medievalweaponproperties.WANDS).setUnlocalizedName("wanddiamond");
GameRegistry.registerItem(wandD, "Diamond Wand");
LanguageRegistry.addName(wandD, "Diamond Wand");


//EMERALD WAND
wandE = new Emerald_Wand(4013, medievalweaponproperties.WANDS).setUnlocalizedName("wandemerald");
GameRegistry.registerItem(wandE, "Emerald Wand");
LanguageRegistry.addName(wandE, "Emerald Wand");


//SAPPHIRE WAND
wandSa = new Sapphire_Wand(4014, medievalweaponproperties.WANDS).setUnlocalizedName("wandsapphire");
GameRegistry.registerItem(wandSa, "Sapphire Wand");
LanguageRegistry.addName(wandSa, "Sapphire Wand");


//RUBY WAND
wandR = new Ruby_Wand(4015, medievalweaponproperties.WANDS).setUnlocalizedName("wandruby");
GameRegistry.registerItem(wandR, "Ruby Wand");
LanguageRegistry.addName(wandR, "Ruby Wand");


//FIRE WAND
wandf = new Fire_Wand(4016).setUnlocalizedName("firewand");
GameRegistry.registerItem(wandf, "Fire Wand");
LanguageRegistry.addName(wandf, "Fire Wand");

}

               //PROJECTILES
{
//FIREBOLT
fireBolt = new Firebolt(5000).setUnlocalizedName("fireBolt");
GameRegistry.registerItem(fireBolt, "Firebolt");
LanguageRegistry.addName(fireBolt, "Firebolt");


//DIAMOND PROJECTILE
pdiamond = new Diamondbolt(5001).setUnlocalizedName("projectilediamond");
GameRegistry.registerItem(pdiamond, "Diamond Projectile");
LanguageRegistry.addName(pdiamond, "Diamond Projectile");



//EMERALD PROJECTILE
pemerald = new Emeraldbolt(5002).setUnlocalizedName("projectileemerald");
GameRegistry.registerItem(pemerald, "Emerald Projectile");
LanguageRegistry.addName(pemerald, "Emerald Projectile");



//SAPPHIRE PROJECTILE
psapphire = new Sapphirebolt(5003).setUnlocalizedName("projectilesapphire");
GameRegistry.registerItem(psapphire, "Sapphire Projectile");
LanguageRegistry.addName(psapphire, "Sapphire Projectile");



//RUBY PROJECTILE
pruby = new Rubybolt(5004).setUnlocalizedName("projectileruby");
GameRegistry.registerItem(pruby, "Ruby Projectile");
LanguageRegistry.addName(pruby, "Ruby Projectile");
}





                           //RECIPE/SMELTING
{	



                      //ITEMS
{
	//MAGEINGOT SMELTING
	GameRegistry.addSmelting(Medieval.rawCombination.itemID, new ItemStack(Medieval.mageIngot, 1), 1.0F);

	//RAWCOMBINATION RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.rawCombination,1), new Object[]{
    "rwr", "rlr", "pbp", 
    'r', Item.redstone,
    'b', Item.bowlEmpty,
    'w', Item.bucketWater,
    'l', Block.blockLapis,
    'p', pdust});

//BAG
GameRegistry.addRecipe(new ItemStack(Medieval.bag,1), new Object[]{
    " r ", " l ", "rrr", 
    'r', Item.leather,
    'l', Item.silk});


//PIXIEBAG
       GameRegistry.addShapelessRecipe(new ItemStack(pdust), 
	new ItemStack(Medieval.pbag.setContainerItem(Medieval.bag)));
       
}


     //BLOCKS
{
    //SAPPHIREBLOCK RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.SapphireBlock,1), new Object[]{
	"sss", "sss", "sss", 
	's', Medieval.Sapphireitem}); 

//RUBYBLOCK RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.RubyBlock,1), new Object[]{
	"sss", "sss", "sss", 
	's', Medieval.Rubyitem}); 
}


        //WEAPONS
{
//WOODENMACE RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.maceW,1), new Object[]{
	" w ", "wsw", " s ",
	's', Item.stick, 
	'w', Block.planks});

//STONEMACE RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.maceS,1), new Object[]{
        " w ", "wsw", " s ", 
        's', Item.stick, 
        'w', Block.stone});

    //IRONMACE RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.maceI,1), new Object[]{
    " w ", "wsw", " s ", 
    's', Item.stick, 
    'w', Block.blockIron});

//GOLDENMACE RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.maceG,1), new Object[]{
    " w ", "wsw", " s ", 
    's', Item.stick, 
    'w', Block.blockGold});

//DIAMONDMACE RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.maceD,1), new Object[]{
    " w ", "wsw", " s ", 
    's', Item.stick, 
    'w', Block.blockDiamond});

//WOODENNAGINATA RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.naginataW,1), new Object[]{
    "  e", " q ", "q  ", 
    'q', Item.stick, 
    'e', Item.swordWood});

//STONE RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.naginataS,1), new Object[]{
    "  e", " q ", "q  ", 
    'q', Item.stick, 
    'e', Item.swordStone});

//IRONNAGINATA RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.naginataI,1), new Object[]{
    "  e", " q ", "q  ", 
    'q', Item.stick, 
    'e', Item.swordIron});

//GOLDENNAGINATA RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.naginataG,1), new Object[]{
    "  e", " q ", "q  ", 
    'q', Item.stick, 
    'e', Item.swordGold});

//DIAMONDNAGINATA RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.naginataD,1), new Object[]{
    "  e", " q ", "q  ", 
    'q', Item.stick, 
    'e', Item.swordDiamond});


//DIAMONDWAND RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.wandD,1), new Object[]{
	  " ie", " qi", "q  ", 
	  'q', Item.stick,
	  'i', Medieval.mageIngot,
	  'e', Block.blockDiamond});

//EMERALDWAND RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.wandE,1), new Object[]{
	" ie", " qi", "q  ", 
	'q', Item.stick,
	'i', Medieval.mageIngot,
	'e', Block.blockEmerald});

//SAPPHIREWAND RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.wandSa,1), new Object[]{
	" ie", " qi", "q  ", 
	'q', Item.stick,
	'i', Medieval.mageIngot,
	'e', Medieval.SapphireBlock});

//RUBYWAND RECIPE
GameRegistry.addRecipe(new ItemStack(Medieval.wandR,1), new Object[]{
	" ie", " qi", "q  ", 
	'q', Item.stick,
	'i', Medieval.mageIngot,
	'e', Medieval.RubyBlock});

//FIREWAND RECIPE
GameRegistry.addRecipe(new ItemStack(wandf,1), new Object[]{
  " ie", " qi", "q  ", 
  'q', Item.stick,
  'i', mageIngot,
  'e', Item.fireballCharge});
}
}           
System.err.println("Medieval Basemod Loaded");
}

}

 

Here is the client proxy

package medieval.medievalproxy;

import medieval.medievalentities.Firebolt_Entity;
import medieval.medievalentities.Pixie_Entity;
import medieval.medievalmodels.Pixie_Model;
import medieval.medievalrender.Firebolt_Render;
import medieval.medievalrender.Pixie_Render;
import medieval.medievalsounds.Firebolt_Sound;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.client.registry.RenderingRegistry;



public class ClientProxy extends ServerProxy

{

@Override
public void registerRenderThings()
{


        MinecraftForge.EVENT_BUS.register(new Firebolt_Sound());
        RenderingRegistry.registerEntityRenderingHandler(Pixie_Entity.class, new Pixie_Render(new Pixie_Model(), 0.3F));
	RenderingRegistry.registerEntityRenderingHandler(Firebolt_Entity.class, new Firebolt_Render());
	System.err.println("ClientProxy Loaded");
}

}

 

here is the render file

package medieval.medievalrender;

import medieval.Medieval;
import medieval.medievalentities.Firebolt_Entity;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.util.Icon;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class Firebolt_Render extends Render
{
  


    public void doRenderfirebolt(Firebolt_Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
    {
        GL11.glPushMatrix();
        GL11.glTranslatef((float)par2, (float)par4, (float)par6);
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        Icon icon = Medieval.fireBolt.getIconFromDamage(0);
        Tessellator tessellator = Tessellator.instance;
        float f3 = icon.getMinU();
        float f4 = icon.getMaxU();
        float f5 = icon.getMinV();
        float f6 = icon.getMaxV();
        float f7 = 1.0F;
        float f8 = 0.5F;
        float f9 = 0.25F;
        GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
        tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
        tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
        tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
        tessellator.draw();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
        
        System.err.println("Firebolt Render Loaded");
    }

    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
    {
        this.doRenderfirebolt((Firebolt_Entity)par1Entity, par2, par4, par6, par8, par9);
    }

        protected ResourceLocation func_110790_a(Firebolt_Entity par1Firebolt_Entity)
        {
            return TextureMap.field_110576_c;
        }

        protected ResourceLocation func_110775_a(Entity par1Entity)
        {
            return this.func_110790_a((Firebolt_Entity)par1Entity);
        }
        
}

 

 

and while at it here is the sound :P

 

note:the println form the sound appears but the code may not be right

package medieval.medievalsounds;

import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;

public class Firebolt_Sound 

{

    @ForgeSubscribe
    public void onSound(SoundLoadEvent event)
    {
        try
        {
             String [] soundFiles = {"firebolt1.wav"};
             for (int i = 0; i < soundFiles.length; i++)
             {
            	 event.manager.soundPoolSounds.addSound("medieval"+soundFiles[i]); 
                 System.err.println("Firebolt Sound Registered");
             }
       
        }
        catch (Exception e)
        {
            System.err.println("Failed to register one or more sounds");
        }
    }
}

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Link to comment
Share on other sites

im thinking maybe you aren't registering your entities properly

 

can you make a println inside the constructor of your bullet entity ? just do see if it is ever created when you shoot the gun

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

i cant find it so it is registered wrong this time i did check the details and looked around before but eveyone has it something like this in the proxy

 

Edit: i tried using what you said to the other person which was registering the entity in the modbase wich i did 

like this

EntityRegistry.registerGlobalEntityID(Firebolt_Entity.class, "Firebolt", EntityRegistry.findGlobalUniqueEntityId());

 

but iits the same no difference

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Link to comment
Share on other sites

please dont copy paste code you dont knwo what is doing because you end up with things like this

 

EntityRegistry.findGlobalUniqueEntityId();

 

this statement does actually nothing if written this way

 

heres how I registster my entities

//entity class, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates
EntityRegistry.registerModEntity(EntityMeteor.class, "meteor", 4, this, 350, 5, false);

this is in the formerly knows as the @PreInit function

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

:D yours did somthing at first a black tile appeared and in the client it appeared firebolt render loaded but still doesnt have texture  :/

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Link to comment
Share on other sites

yes the item does appear but not the projectile and just incase here

 

package medieval.medievalprojectiles;

import java.util.Random;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import medieval.Medieval;

public class Firebolt extends Item
{

public Firebolt(int i)
{

	super(i);
	this.setCreativeTab(Medieval.medievaltab);
	maxStackSize = 64;


}
public void registerIcons(IconRegister reg) {

	this.itemIcon = reg.registerIcon("medieval:firebolt");
	}
public String Version()
{
	return "1.6.2";
}
}

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Link to comment
Share on other sites

this.itemIcon = reg.registerIcon("medieval:firebolt");

 

mean that you should have exactly

 

mcp/src/minecraft/assets/medieval/items/firebolt.png

 

note: "items" can actually be "Item", "Items" or "item" i dont remember exactly

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

hen ok, we know its not that

 

heres some code that should work

GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
Minecraft.getMinecraft().renderEngine.func_110577_a(new ResourceLocation("/assets/MODID/textures/mode/TEXTURENAME.png"));
Tessellator tessellator = Tessellator.instance;
float f3 =0;
float f4 = 1;
float f5 = 0;
float f6 = 1;
float f7 = 1.0F;
float f8 = 0.5F;
float f9 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
tessellator.draw();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();

 

try this instead

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

:D ty it worked but i had to change one thing to this   

Minecraft.getMinecraft().renderEngine.func_110577_a(new ResourceLocation("medieval","/textures/entities/firebolt.png"));

 

now for the sound and its done

 

Edit: i tought it was mi computer lagging but its not when i shoot the projectile it looks buggy is it because of the update velocityt and those things in the entity registry?

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Link to comment
Share on other sites

fixed it :D

 

and i dont want to waste your time and abuse your kindness but i just want to finish what i started so the last thing my sounds

 

to call the sound is it like this

par2World.playSoundAtEntity(par3EntityPlayer, "medieval:firebolt1", 1.0F, 1.0F);

I like helping people because i was also in a same problem and i do not like unfinished work, so a thank you will be enough for the people im helping and a thank you to the people that helped me :)

Link to comment
Share on other sites

i dont mind you taking my time but to be honest i have no idea because i havnt worked with sounds yet

 

but im sure the wiki will help, anyway if i try to help the first thign i will do is

1 check the wiki

2 use the search bar on top of forge forum  to see if i cant find anything about it

3 use call hierarchy in eclipse to understand what the method wants

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm developing a dimension, but it's kinda resource intensive so some times during player teleporting it lags behind making the player phase down into the void, so im trying to implement some kind of pregeneration to force the game loading a small set of chunks in the are the player will teleport to. Some of the things i've tried like using ServerLevel and ServerChunkCache methods like getChunk() dont actually trigger chunk generation if the chunk isn't already on persistent storage (already generated) or placing tickets, but that doesn't work either. Ideally i should be able to check when the task has ended too. I've peeked around some pregen engines, but they're too complex for my current understanding of the system of which I have just a basic understanding (how ServerLevel ,ServerChunkCache  and ChunkMap work) of. Any tips or other classes I should be looking into to understand how to do this correctly?
    • https://mclo.gs/4UC49Ao
    • Way back in the Forge 1.17 days, work started for adding JPMS (Java Platform Module Support) to ModLauncher and ForgeModLoader. This has been used internally by Forge and some libraries for a while now, but mods (those with mods.toml specifically) have not been able to take advantage of it. As of Forge 1.21.1 and 1.21.3, this is now possible!   What is JPMS and what does it mean for modders? JPMS is the Java Platform Module System, introduced in Java 9. It allows you to define modules, which are collections of packages and resources that can be exported or hidden from other modules. This allows for much more fine-tuned control over visibility, cleaner syntax for service declarations and support for sealed types across packages. For example, you might have a mod with a module called `com.example.mod` that exports `com.example.mod.api` and `com.example.mod.impl` to other mods, but hides `com.example.mod.internal` from them. This would allow you to have a clean API for other mods to use, while keeping your internal implementation details hidden from IDE hints, helping prevent accidental usage of internals that might break without prior notice. This is particularly useful if you'd like to use public records with module-private constructors or partially module-private record components, as you can create a sealed interface that only your record implements, having the interface be exported and the record hidden. It's also nice for declaring and using services, as you'll get compile-time errors from the Java compiler for typos and the like, rather than deferring to runtime errors. In more advanced cases, you can also have public methods that are only accessible to specific other modules -- handy if you want internal interactions between multiple of your own mods.   How do I bypass it? We understand there may be drama in implementing a system that prevents mods from accessing each other's internals when necessary (like when a mod is abandoned or you need to fix a compat issue) -- after all, we are already modding a game that doesn't have explicit support for Java mods yet. We have already thought of this and are offering APIs from day one to selectively bypass module restrictions. Let me be clear: Forge mods are not required to use JPMS. If you don't want to use it, you don't have to. The default behaviour is to have fully open, fully exported automatic modules. In Java, you can use the `Add-Opens` and `Add-Exports` manifest attributes to selectively bypass module restrictions of other mods at launch time, and we've added explicit support for these when loading your Forge mods. At compile-time, you can use existing solutions such as the extra-java-module-info Gradle plugin to deal with non-modular dependencies and add extra opens and exports to other modules. Here's an example on how to make the internal package `com.example.examplemod.internal` open to your mod in your build.gradle: tasks.named('jar', Jar) { manifest { attributes([ 'Add-Opens' : 'com.example.examplemod/com.example.examplemod.internal' 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors // (...) ]) } } With the above in your mod's jar manifest, you can now reflectively access the classes inside that internal package. Multiple entries are separated with a space, as per Java's official spec. You can also use Add-Exports to directly call without reflection, however you'd need to use the Gradle plugin mentioned earlier to be able to compile. The syntax for Add-Exports is the same as Add-Opens, and instructions for the compile-time step with the Gradle plugin are detailed later in this post. Remember to prefer the opens and exports keywords inside module-info.java for sources you control. The Add-Opens/Add-Exports attributes are only intended for forcing open other mods.   What else is new with module support? Previously, the runtime module name was always forced to the first mod ID in your `mods.toml` file and all packages were forced fully open and exported. Module names are now distinguished from mod IDs, meaning the module name in your module-info.java can be different from the mod ID in your `mods.toml`. This allows you to have a more descriptive module name that doesn't have to be the same as your mod ID, however we strongly recommend including your mod ID as part of your module name to aid troubleshooting. The `Automatic-Module-Name` manifest attribute is now also honoured, allowing you to specify a module name for your mod without needing to create a `module-info.java` file. This is particularly useful for mods that don't care about JPMS features but want to have a more descriptive module name and easier integration with other mods that do use JPMS.   How do I use it? The first step is to create a `module-info.java` file in your mod's source directory. This file should be in the same package as your main mod class, and should look something like this: open module com.example.examplemod { requires net.minecraftforge.eventbus; requires net.minecraftforge.fmlcore; requires net.minecraftforge.forge; requires net.minecraftforge.javafmlmod; requires net.minecraftforge.mergetool.api; requires org.slf4j; requires logging; } For now, we're leaving the whole module open to reflection, which is a good starting point. When we know we want to close something off, we can remove the open modifier from the module and open or export individual packages instead. Remember that you need to be open to Forge (module name net.minecraftforge.forge), otherwise it can't call your mod's constructor. Next is fixing modules in Gradle. While Forge and Java support modules properly, Gradle does not put automatic modules on the module path by default, meaning that the logging module (from com.mojang:logging) is not found. To fix this, add the Gradle plugin and add a compile-time module definition for that Mojang library: plugins { // (...) id 'org.gradlex.extra-java-module-info' version "1.9" } // (...) extraJavaModuleInfo { failOnMissingModuleInfo = false automaticModule("com.mojang:logging", "logging") } The automatic module override specified in your build.gradle should match the runtime one to avoid errors. You can do the same for any library or mod dependency that is missing either a module-info or explicit Automatic-Module-Name, however be aware that you may need to update your mod once said library adds one. That's all you need to get started with module support in your mods. You can learn more about modules and how to use them at dev.java.
    • Faire la mise à jour grâce à ce lien m'a aider personnellement, merci à @Paint_Ninja. https://www.amd.com/en/support 
    • When I came across the 'Exit Code: I got a 1 error in my Minecraft mods, so I decided to figure out what was wrong. First, I took a look at the logs. In the mods folder (usually where you'd find logs or crash reports), I found the latest.log file or the corresponding crash report. I read it through carefully, looking for any lines with errors or warnings. Then I checked the Minecraft Forge support site, where you can often find info on what causes errors and how to fix them. I then disabled half of my mods and tried running the game. If the error disappeared, it meant that the problem was with the disabled mod. I repeated this several times to find the problem mod.
  • Topics

×
×
  • Create New...

Important Information

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