Everything posted by darty11
-
Searching the sorce code with forge gradle
Ok, thanks.
-
[1.7.2] Attack entity from
add System.out.println("Debug"); somewhere in that function. If the console spews out "Debug" but doesn't damage whatever it is supposed to, then you know there is a problem with attackentityfrom. But if it doesn't, then you are not using onEntityCollidedWithBlock right.
-
Searching the sorce code with forge gradle
Before forge gradle I was able to do a basic search in eclipse for a keyword like ".onUpdate()" and find all the times it was used in my code, forge modloader, and the minecraft source code. This really helped me decode how forge and minecraft worked, as well as debug my code or find out how minecraft did something. As of forge gradle I have not been able to find a way to even search minecrafts code. If I wanted to find where "BlaBlaBla.doRender(Bla, Bla,Bla)" was called, I would have to take an educated guess or search through all of minecrafts code. So I was wondering, is there anyway to search the attached source code?
-
Rendering a 3D item as a throwable item
Ok, try to code the correct behavior into your ball now. If you have problems, ask.
-
Rendering a 3D item as a throwable item
As to your other problem, that is because you copied all the code in the snowball class, so it is going to act like a snowball regardless of how it looks. You need to change it's behavior code to make it act like a ball.
-
Rendering a 3D item as a throwable item
That is because it seems your render class is for rendering icons. You are probably going to have to use a different render class. I made one that should help you, but it uses 1.7 code, so you might have to change up the methods. ackage Movillagers.entities.render; import Movillagers.entities.model.ModelSentry; 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.util.ResourceLocation; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBoat; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityBoat; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class RenderBall extends Render { private static final ResourceLocation BallTextures = new ResourceLocation("YourTextureHere"); /** * instance of ModelBoat for rendering */ protected ModelBase modelBall; private static final String __OBFID = "CL_00000981"; public RenderBall() { this.shadowSize = 0.5F; this.modelBall = new modelBall(); } /** * 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 par1EntityBoat, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix(); GL11.glTranslatef((float)par2, (float)par4, (float)par6); GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); this.bindEntityTexture(par1EntityBoat); GL11.glScalef(-1.0F, -1.0F, 1.0F); this.modelBall.render(par1EntityBoat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } /** * 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.BallTextures; } } You will also need to revert your RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall([insert item here]) in your client proxy back to ]RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall()
-
Rendering a 3D item as a throwable item
Ok, that's my fault. Change public static CustomItem ball; @Init public void load(FMLInitializationEvent event) { ball = new Ball(5000); LanguageRegistry.addName(ball, "Ball"); GameRegistry.registerItem(ball, "Soccer"+ball.getUnlocalizedName2()); //ItemStack diamondsStack = new ItemStack(Item.diamond, 64); MinecraftForgeClient.registerItemRenderer(5000+256, (IItemRenderer)new ItemRenderBall()); registerTileEntity(); } to public static CustomItem ball=new Ball(5000); @Init public void load(FMLInitializationEvent event) { LanguageRegistry.addName(ball, "Ball"); GameRegistry.registerItem(ball, "Soccer"+ball.getUnlocalizedName2()); //ItemStack diamondsStack = new ItemStack(Item.diamond, 64); MinecraftForgeClient.registerItemRenderer(5000+256, (IItemRenderer)new ItemRenderBall()); registerTileEntity(); }
-
Rendering a 3D item as a throwable item
So you didn't get any errors and the ball didn't render?
-
Should I Update to 1.7
A good number of the functions have been named by now, although a few of them have been renamed in a dumb fashion (like .seunlocolised name is .setblockname, but only when used with blocks, items stay the same), but the way minecraft has been changed can make it harder than the misnaming. for example, Items and blocks ids are gone, you can ONLY use the actual block or item object in any function that previously used an id. Another thing is the way blocks and items are referenced code wise. They are no longer stored in the Block and Item classes, but there are NEW classes that store all the blocks and items, named Blocks.java and Items.java.
-
Rendering a 3D item as a throwable item
Change it to Icon icon; if(this.field_94151_a!=null) { icon = this.field_94151_a.getIconFromDamage(0); } else { icon=Soccer.ball.getIconFromDamage(0); }
-
Rendering a 3D item as a throwable item
ok. I don't have a workspace set up for 1.6, so you are going ot have to do this yourself. 1. Undo the changes to your render ball class. 2. reproduce the crash. 3. in the eclipse crash report, there shouled be a hyperlink on the RenderBall.java:64 in the java.lang.NullPointerException at soccer.render.RenderBall.doRender(RenderBall.java:64) Click it and tell me the line of code that pops up.
-
Making a Block Spawn Void Particles (Or Any Particle)
Take a look at the torch code.
-
Rendering a 3D item as a throwable item
What version are you in?
-
Rendering a 3D item as a throwable item
It is invisible because the private void doRender no longer overrides the public void doRender that is used to render objects. You need to figure out what is causing the null point exception. It is probably a undefined or null variable being used. Also, make sure that the proxy.registerentities() is being called after the ball=new Ball(5000);
-
Rendering a 3D item as a throwable item
ok, your item ball is not held as a public value. In your main class @Init public void load(FMLInitializationEvent event) { CustomItem ball = new Ball(5000); LanguageRegistry.addName(ball, "Ball"); GameRegistry.registerItem(ball, "Soccer"+ball.getUnlocalizedName2()); //ItemStack diamondsStack = new ItemStack(Item.diamond, 64); MinecraftForgeClient.registerItemRenderer(5000+256, (IItemRenderer)new ItemRenderBall()); registerTileEntity(); } needs to become public static CustomItem ball; @Init public void load(FMLInitializationEvent event) { ball = new Ball(5000); LanguageRegistry.addName(ball, "Ball"); GameRegistry.registerItem(ball, "Soccer"+ball.getUnlocalizedName2()); //ItemStack diamondsStack = new ItemStack(Item.diamond, 64); MinecraftForgeClient.registerItemRenderer(5000+256, (IItemRenderer)new ItemRenderBall()); registerTileEntity(); } That way, you can use Soccer.ball to reference your item ball. Then, in your client proxy, change RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall() to RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall(Soccer.ball)
-
Rendering a 3D item as a throwable item
I agree, but he already had some of it in he common, and I was trying to work with him where he was. But you are right that in most cases it should be in the init.
-
Rendering a 3D item as a throwable item
I meant in the common proxy. Also, thornack, it looks like the rendering class has an error in it. Try defining your field field_94151_a in renderball(), or change RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall() in your client proxy to RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall([insert item here])
-
Rendering a 3D item as a throwable item
add this to your Main class init function: proxy.registerEntities() And then add this to your proxy regiserEntities: EntityRegistry.registerModEntity(EntityBall.class, "Ball", EntityRegistry.findGlobalUniqueEntityId(),Soccer.instance , 128, 1, true);
-
Rendering a 3D item as a throwable item
Show us where you register the EntityBall and it's rendering.
-
patching vanilla method to be able to place saplings on block
I think he means place vanilla saplings on his block.
-
[1.7.2]Ice stairs and slabs.
So my mod adds Ice slabs and stairs. In 1.6, my slabs and stairs worked just fine. But in 1.7.2, due to the rendering changes, I can see normal Ice, as well as other instances of my ice slabs/stairs through my slabs and stairs. I fixed this with this code: @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess blockAccess, int X, int Y, int Z, int side) { Block block = blockAccess.getBlock(X, Y, Z); return !(block==this)&&this.modelBlock.shouldSideBeRendered(blockAccess, X, Y, Z, side); } It works, but It also messes up the non-full block parts of the slabs and stairs. http://i59.tinypic.com/2vj5wyh.png I also can still see my slabs through my stairs, and visa-versa. I tried using a function that checked if it was any one of my ice blocks, or ice itself, and that worked, but I still had the invisible stair section problem. The corner of the bricks next to the stairs also would be invisible with that method. Lastly, you could still see vanilla Ice through my Ice. I am wondering what would be the best way to fix this, obviously I am going to probably have to do custom rendering, but how should I go about that?
-
[1.6.4]End of stream
Just did a test without any mods on either client or server. I still get the error. It appears that there is a problem with my build, sorry for wasting you time.
-
[1.6.4]End of stream
The mod generates another dimension. The server has that dimension loaded.
-
[VANILLA BUG][SOLVED][1.7.2] Block metadata incorrect during explosion?
getExplosionResistance(entity); is a function that gets the explosion resistance of a block. It is found in the block class.
- [1.6.4]End of stream
IPS spam blocked by CleanTalk.