Everything posted by Asweez
-
Render a cube with a texture
Ok it won't render. Here's what I have: Render: package com.apmods.swbf2.client; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import com.apmods.swbf2.entity.EntityGrenade; import com.apmods.swbf2.main.Battlefront; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderGrenade extends Render { private static final ResourceLocation arrowTextures = new ResourceLocation(Battlefront.MODID + ":textures/entity/grenade.png"); private static RenderItem itemRender = new RenderItem(); public ModelGrenade model; public RenderGrenade(){ model = new ModelGrenade(); } /** * 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 func_76986_a(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(EntityGrenade entity, double par1, double par2, double par3, float par4, float par5) { this.bindTexture(arrowTextures); model.cube.showModel = true; model.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityGrenade p_110775_1_) { return arrowTextures; } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return this.getEntityTexture((EntityGrenade)p_110775_1_); } /** * 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 func_76986_a(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 p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityGrenade)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } } Model: package com.apmods.swbf2.client; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelGrenade extends ModelBase{ public ModelRenderer cube; public ModelGrenade(){ this.cube = new ModelRenderer(this, 0, 0); this.cube.addBox(-2.5f, 0, -2.5f, 5, 5, 5, 1); } public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { this.cube.render(p_78088_7_); } }
-
Render a cube with a texture
I want to make one of my entities just a cube with a 5x5 px texture. How would I do that?
-
Adding more damage to a sword if a player is sprinting
Nope none of that worked Heres the code: public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase target, EntityLivingBase attacker) { if(attacker.isSprinting()){ System.out.println("sprint"); target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)attacker), 15); } return true; } "sprint" never comes up in the console. And I don't need to damage the sword so that's why that's not there.
-
Projectile Firing faster than once per tick
Could you give a code example because I'm not very experienced with Vectors and that kind of stuff?
-
Projectile Firing faster than once per tick
How do I make it farther out?
-
Adding more damage to a sword if a player is sprinting
I have a sword and want it to do more damage to something if the player hits it while the player is sprinting. How would I do so?
-
Projectile Firing faster than once per tick
Yes, there is already a thread for this. I was wondering, however, how I would make the second projectile offset from the player to create a faster fire effect? link to the other thread http://www.minecraftforge.net/forum/index.php?topic=21851.0
-
Opening a player's inventory on another player's screen
I get all of that, but can someone show me what to do to open the Gui and what to put in my GuiHandler because that's where I'm confused
-
Opening a player's inventory on another player's screen
Then how am I supposed to send the other player variable to the Guihandler which creates the container?
-
Opening a player's inventory on another player's screen
Please anyone I need to know this
-
Opening a player's inventory on another player's screen
No what method would make the GUI open?
-
Opening a player's inventory on another player's screen
How would I make the game show a container with another players inv slots? And why would I need a GuiHandler?
-
Opening a player's inventory on another player's screen
Anyone know? I'm stuck here with my mod and I can't do much right now until I get this solved.
-
Opening a player's inventory on another player's screen
Exactly what the title says. How would I do so?
-
Making a player gui open from entity
Where do I put the GuiContainer and Container?
-
Making a player gui open from entity
Ok so I have an entity and whenever it hits another player I want it to show the player that created the entity to see, but not interact with, the hit player's inventory. I have it set up so the entity onImpact calls MainClass.proxy.method() and in that method in my client proxy I open a guiScreen for the players inventory. However, when I am on a server with another user, whenever the entity hits the other player, it calls the commonProxy method. How would I make this work?
-
Tile Entity Problems
Ahh thanks everyone! It works now!
-
Tile Entity Problems
Ok so i have a Tile Entity and block to go with it. I want one of my entities to set that block, then modify something in it's tile Entity. It keeps coming up with a NullPointerException. Code: Block: Relevant Entity code: TileEntity: Crash Report:
-
Making an Entity attack another Entity
No but how do I identify an entity based on its UUID
-
Making an Entity attack another Entity
How would I set the target based on UUID?
-
Making an Entity attack another Entity
I have an bird entity that I want to be able to attack other entities. I know how to do this, but I want the player to be able to change which entity nearby birds will attack. How would I make a sort of NBT that can hold the entity field that the player selects?
-
[1.8] Trying to make a custom sword set the hit mob on fire
Static, because you don't know, is a field/method that is available anywhere even if you don't have an instance of that class. And NBT Is not necessary because all instances of that sword will set fire. However, if you want some swords to set fire and others to do lightning but use the same item, then you should use NBT.
- Weird Problem
-
Weird Problem
So I made an entity that I create with a packet. I have the entity exploding when it hits the ground. It works, and all the particles and sound go off and the blocks are deleted. But whenever I try to go into the exploded area, it doesn't let me and the blocks that look like they were exploded come back as I get near them. Anyone know what's causing this? Code: @Override protected void onImpact(MovingObjectPosition mop) { this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3.0f, true); }
-
Packet problem
Wow thanks!! That worked! Thanks for all the info everyone and helping me to understand how all this stuff works
IPS spam blocked by CleanTalk.