I need a texture artist to texture a few things for my mod.
The first one to complete it and post the texture file download link will win credit and i'll make a block/item for them.
Things I Need Currently:
1. A Jungle Door
2. A Birch Door
3. A Spruce Door
(NOTE DO NOT MAKE THE DOORS THE LOG TYPES!)
Thanks!
Cheers,
SuperBrea
I will stop taking textures after: 9/13/2013 At 10:00 p.m Eastern time zone!
I think the itemID you passed in is causing problems. I did the same thing to an item in my code and got the exact same error (and now it's stuck that way lol). Try changing it to something higher, yet still below 128, or better yet use EntityRegistry.findGlobalUniqueEntityId() in place of the 1. Start a new world and hopefully that will work.
Ahh I found the problem, for the null pointer exception.
The Client Proxy loaded before the grenade item, so when it rendered it didn't know that the grenade was loaded and ready so it returned null. So I fixed it by making it render AFTER the item loaded. Thanks for your help Omn1potent!
@Init
grenade = new ItemGrenade(GRENADE_ITEM_ID).setUnlocalizedName("BreaTech:grenade");
does the @Init stand for it being declared in your Init() method? Because the new way to do preInit, init, and postInit is using @EventHandler and FMLInitializationEvents. Otherwise your method will never be called and your item never initialized, which could contribute to the nullPointerException.
Ahh no @Init Was an example
I do it with an event handler
@EventHandler
public void preLoad(FMLPreInitializationEvent Event){
grenade = new ItemGrenade(GRENADE_ITEM_ID).setUnlocalizedName("BreaTech:grenade");
GameRegistry.registerItem(grenade, "grenade");
LanguageRegistry.addName(grenade, "grenade");
}
Just saw this and thought, well, we could really use one for loading and pasting schematics in game. Also for how to make proper schematics using mcedit. I have found a few and made a few myself that dont load properly. Also along with this should be custom structure rotation, though this should work either with schematics or just a normal world gen class.
We are also lacking a good chest loot generation tutorial, I know how to do this already, to a point anyhow, but have noticed others asking for how to do so.
Some decent tips for custom generation would be good too....like make a plant grow in a certain biome on certain blocks, or so many blocks away from a specific block, make blocks generate around a lava lake or water lake, and so on...
Ok, I didn't post all my code cause well, everyone hates those copy pasters...Anyways I did declare my item like so This is all my code basicly for the grenade in my Main.class:
[code]public static final int GRENADE_ITEM_ID = 3004;
public static Item grenade;
@Init
grenade = new ItemGrenade(GRENADE_ITEM_ID).setUnlocalizedName("BreaTech:grenade");
GameRegistry.registerItem(grenade, "grenade");
LanguageRegistry.addName(grenade , "Grenade");[/code]
Haha, you don't have to bump so much. It just took me some time to get back on.
So it looks like your Main.grenade is causing the problem. The error says a nullPointerException occurred on line 42 of RenderSnowball, which is this line:
Ok, I didn't post all my code cause well, everyone hates those copy pasters...Anyways I did declare my item like so This is all my code basicly for the grenade in my Main.class:
[CODE]
public static final int GRENADE_ITEM_ID = 3004;
public static Item grenade;
@Init
grenade = new ItemGrenade(GRENADE_ITEM_ID).setUnlocalizedName("BreaTech:grenade");
There are only two things that could cause the exception, field_94151_a or field_94150_f, and seeing as how you used the second constructor which only accepts one argument (Item) and passes the other parameter as 0 (which obviously is not null, cause it's zero), that means it can only be caused by field_94151_a, which is your item.
Looking at your Main class I do not ever see your ItemGrenade declared anywhere, which means that if you are trying to reference it in RenderSnowball, it will not exist and therefore cause the exception. If you have not already, create a grenade object in your main class and use that item as your parameter to pass into RenderSnowball. Then it should work.
RenderingRegistry.registerEntityRenderingHandler(EntityYouritem.class, new RenderSnowball(yourItem));
However, after wanting to place only in mod class myself and then having trouble later on, I would recommend placing it in your ClientProxy and coding it like this:
EntityRegistry.registerModEntity(EntityYouritem.class, "ItemName", renderID, modName.instance, 64, 10, true);
RenderingRegistry.registerEntityRenderingHandler(EntityYouritem.class, new RenderSnowball(modName.yourItem));
where "modName.instance" is the static instance defined in your base class like so:
@Instance("modID")
public static modName instance;
This should save you a bit of hassle, as when rendering entities as items you don't need a specific renderer, just RenderSnowball(). Hope that helps!
THANK YOU!
The reason i didn't want the entity registry in the clientproxy was because i couldn't quite figure out the instance thing.
I'll be sure to try it thanks!
How would I do this? I have tried MANY tutorials but all don't work.The closest one I got working only manages to use the texture every now and then. Here's my code.I don't want to register any entity except in the main class!
Main Class:
//Basic Information About BreaTech Is Defined Here:
@Mod(modid = "BreaTech", name = "BreaTech", version = "0.7")
//Client And Server Requirements Are Defined Here:
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Main {
@SidedProxy(clientSide = "BreaTech.Proxys.ClientProxy", serverSide = "BreaTech.Proxys.ServerProxy")
public static ServerProxy proxy;
@EventHandler
public void Load(FMLPreInitializationEvent Event) {
proxy.registerRenderThings();
if(FMLCommonHandler.instance().getSide().isClient())
{
MinecraftForge.EVENT_BUS.register(new SoundRegister());
System.out.println("Registered Sounds");
}
//TickRegistry.registerTickHandler(new PlayerTickHandler(EnumSet.of(TickType.PLAYER)), Side.SERVER);
EntityRegistry.registerGlobalEntityID(EntityGrenade.class, "Grenade", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(EntityGrenade.class, "Grenade", 1, this, 64, 10, true);
Render Grenade Class:
package BreaTech.Renderers;
import BreaTech.Main;
import BreaTech.Entities.Explosives.EntityGrenade;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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.item.Item;
import net.minecraft.util.Icon;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@SideOnly(Side.CLIENT)
public class RenderGrenade extends Render
{
public RenderGrenade()
{
}
public void doRenderFireball(EntityGrenade 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 = Main.grenade.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);
this.loadTexture("BreaTech:textures/items/grenade.png");
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();
}
private void loadTexture(String string) {
// TODO Auto-generated method stub
}
protected ResourceLocation func_110790_a(EntityFireball par1EntityFireball)
{
return TextureMap.field_110576_c;
}
protected ResourceLocation func_110775_a(Entity par1Entity)
{
return this.func_110790_a((EntityFireball)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.doRenderFireball((EntityGrenade)par1Entity, par2, par4, par6, par8, par9);
}
}
EntityGrenade Class:
package BreaTech.Entities.Explosives;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityGrenade extends EntityThrowable
{
public EntityGrenade(World par1World)
{
super(par1World);
}
public EntityGrenade(World par1World, EntityLivingBase par2EntityLivingBase)
{
super(par1World, par2EntityLivingBase);
}
public EntityGrenade(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
/**
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
worldObj.createExplosion(this, posX, posY, posZ, 3.0F, false);
this.setDead();
}
}
package BreaTech.Proxys;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.client.renderer.entity.RenderTNTPrimed;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import BreaTech.Main;
import BreaTech.Entities.Explosives.EntityGrenade;
import BreaTech.Entities.Explosives.EntityNitroglycerin;
import BreaTech.Entities.Weapons.EntityPhaserBolt;
import BreaTech.Renderers.RenderGrenade;
import BreaTech.Renderers.RenderNitroglycerin;
import BreaTech.Renderers.RenderPhaserBolt;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
public class ClientProxy extends ServerProxy{
public void registerRenderThings() {
int modEntityID = 0;
//Phaser
EntityRegistry.registerGlobalEntityID(EntityPhaserBolt.class, "BlasterBolt", EntityRegistry.findGlobalUniqueEntityId());
RenderingRegistry.registerEntityRenderingHandler(EntityPhaserBolt.class, new RenderPhaserBolt());
//Nitroglycerin
RenderingRegistry.registerEntityRenderingHandler(EntityNitroglycerin.class, new RenderNitroglycerin());
RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderGrenade());
}
}
Helpful information Possibly:
1. My grenade texture loads properly
2. My grenade texture is 16x16 pixels
3. My grenade texture works only sometimes
4. I mostly get pink, dark green, light green, squares not grenades
I only ask for help, not for you posting all the code.
Thank you for reviewing my topic and helping!
0
The first one to complete it and post the texture file download link will win credit and i'll make a block/item for them.
Things I Need Currently:
Thanks!
Cheers,
SuperBrea
I will stop taking textures after: 9/13/2013 At 10:00 p.m Eastern time zone!
0
Ahh I found the problem, for the null pointer exception.
The Client Proxy loaded before the grenade item, so when it rendered it didn't know that the grenade was loaded and ready so it returned null. So I fixed it by making it render AFTER the item loaded. Thanks for your help Omn1potent!
0
I'll be sure to update you about if it worked or not ;p!
Cheers,
SuperBrea
0
Ahh no @Init Was an example
I do it with an event handler
@EventHandler
public void preLoad(FMLPreInitializationEvent Event){
grenade = new ItemGrenade(GRENADE_ITEM_ID).setUnlocalizedName("BreaTech:grenade");
GameRegistry.registerItem(grenade, "grenade");
LanguageRegistry.addName(grenade, "grenade");
}
0
1. Tile Entity With Techne
2. Custom Mobs With Techne
3:
4. Trees/Plants
5. Overriding Guis
These are the things I need most!
Thanks!
Cheers,
SuperBrea
0
Hope I could be of some use!
Cheers,
SuperBrea
0
[code]public static final int GRENADE_ITEM_ID = 3004; public static Item grenade; @Init grenade = new ItemGrenade(GRENADE_ITEM_ID).setUnlocalizedName("BreaTech:grenade"); GameRegistry.registerItem(grenade, "grenade"); LanguageRegistry.addName(grenade , "Grenade");[/code]
0
0
0
0
Client Proxy:
When I shot the grenade it crashed ;(
0
THANK YOU!
The reason i didn't want the entity registry in the clientproxy was because i couldn't quite figure out the instance thing.
I'll be sure to try it thanks!
Cheers,
SuperBrea
0
0
0
Main Class:
Render Grenade Class:
EntityGrenade Class:
ItemGrenade Class:
And last but not least ClientProxy class:
Helpful information Possibly:
1. My grenade texture loads properly
2. My grenade texture is 16x16 pixels
3. My grenade texture works only sometimes
4. I mostly get pink, dark green, light green, squares not grenades
I only ask for help, not for you posting all the code.
Thank you for reviewing my topic and helping!
Cheers,
SuperBrea