Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi I'm not sure exactly what you're trying to do non-standard, but I think you could probably achieve it by writing a custom IItemRenderer for Dropped entities and checking RenderItem.renderInFrame. See here for example, near the bottom http://greyminecraftcoder.blogspot.com.au/2013/09/custom-item-rendering-using.html -TGG
  2. Hi Just a thought -have you overridden Block.createNewTileEntity() properly? are you sure you are creating the tile entity at the proper location? It might help to diagnose your problem if you set a breakpoint in RenderGlobal.renderEntities below. (Suggest spawning in flatland with just your block in sight) If your TileEntity has been correctly created, it should be in tileEntities. for (i = 0; i < this.tileEntities.size(); ++i) { TileEntity tile = (TileEntity)tileEntities.get(i); if (tile.shouldRenderInPass(pass) && par2ICamera.isBoundingBoxInFrustum(tile.getRenderBoundingBox())) { TileEntityRenderer.instance.renderTileEntity(tile, par3); } } If it gets through to TileEntitySpecialRenderer.getSpecialRendererForClass then it should find your renderer in specialRendererMap. If it doesn't (recurses up to TileEntity) then you haven't registered your renderer properly (ClientRegistry.bindTileEntitySpecialRenderer) TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)this.specialRendererMap.get(par1Class); if (tileentityspecialrenderer == null && par1Class != TileEntity.class) If it retrieves your renderer properly and calls renderTileEntityAt, but it still doesn't render properly, then the problem is in your rendering code. -TGG
  3. Ah yeah you're right, that does look a bit silly That page is generated automatically, so I think probably the easiest way is 1) create a new page with the underscores in www.minecraftforge.net/wiki/Forging_A_Mod_Lecture_Series 2) copy the text from the old page to the new page 3) remove the [[Category:Tutorial Series]] from the old page so that it will disappear from the tutorial list (I'm guessing)
  4. Hmm that's frustrating. Sorry dude, I don't think I can help you any further. -TGG
  5. Hi I'm not sure why you need equippedProgress and prevEquippedProgress? - these are used by the rendering code to position the player's arm (and item) before control passes to your custom renderer, so you don't really need to worry about it? Perhaps if you could describe in a bit more detail what you're trying to do? There are a few links below which might (or might not..) be helpful http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-first-person-view-items.html http://greyminecraftcoder.blogspot.com.au/2013/09/custom-item-rendering-using.html http://greyminecraftcoder.blogspot.com.au/2013/09/sample-code-for-rendering-items.html Cheers TGG
  6. Still no luck? :-( It's certainly not obvious to me why it's not working. I can only suggest - If you create a flat land, peaceful mode to get rid of all the hostile mobs, spawn your Electricer in front, then insert your breakpoint in the entity = (Entity)list.get(i); code line, then keep running until it finds your Electricer - 1) does it reach RenderManager.instance.renderEntity(entity, par3); 2) does it reach RenderManager.renderEntityWithPosYaw 3) does it retrieve the right renderer render = this.getEntityRenderObject(par1Entity); 4) does it reach render.doRender() and trace into RenderElectricer etc etc... at some point you should notice something happening that you don't expect. It might help if you have a sample code from somewhere else which does work properly, so you can trace into that and figure out where the difference is compared to your code. TGG
  7. Hi It's not obvious to me what's wrong from looking at your code, but I would suggest that you add a couple of diagnostics to help figure out what's going wrong. For example, instead of calling isAirBlock, call blockID = worldObj.getBlockId(..) System.out.println("Block in front: " + blockID + ", i is " + i); then put a variety of different block types in the vicinity and see whether they are correctly detected. Alternatively, change your code to use worldObj.setBlock(...) to change the block "in front" of the entity. You'll see pretty quickly whether the code is looking in the right place. -TGG
  8. Hi I created a topic for you which you can edit. It should appear on the tutorials listing page in a day or two. http://www.minecraftforge.net/wiki/ForgingAModLectureSeries The easiest way to create a new page is just to type www.minecraftforge.net/wiki/NameOfYourNewPage Then add [[Category:Tutorial Series]] and perhaps {{#set:Difficulty=Beginner}} There is a tutorial/post on this wiki somewhere about creating tutorial pages, but I can't find it :-|
  9. Hi OK now I understand. Unfortunately I don't have any idea how to do it! I think it would probably be quite complicated even for an expert (which I'm not). Essentially you would need to move the camera position to a new location (into the nether), render a scene and then move the camera back to the player and render the scene again, except for the portal. DieSieben07 has made a CameraCraft mod which covers some aspects of that, he/she might have some insights. Good luck with it :-) -TGG
  10. Hi I would suggest: change your inventory.png to a test texture (for example draw some diagonal coloured stripes over your existing inventory.png) and see what renders. Your blank spot might not be where you think it is. Might also be worth setting a breakpoint just before the code that renders your potion effect, then trace it through to see why it works for jump boost and not for your intended icon. -TGG
  11. Hi A couple of comments 1) If you're using the approach with the TileEntity, you need to create the entity when you place the block, not each time it's rendered. eg Block.createTileEntity - see also code in BlockSign. To be honest I think you haven't really understood what Lycanus was suggesting. Although using TileEntities has some advantages, you might be better off forgetting about TileEntities for now. 2) I would suggest that you practice with a couple of simpler tutorials first, on custom block rendering, that should help make some of the concepts a bit clearer. Wuppy has some good ones, for example http://wuppy29.blogspot.com/2013/08/wuppys-minecraft-forge-modding_14.html -TGG
  12. Hmmm this is getting a bit trickier. I haven't tried this before so I'm just guessing here. There are two approaches that spring to mind. They both involve creating a custom Renderer instead of RenderPig. i.e. RenderPigMissile extends Render (see RenderArrow for example) Then you could either 1) Look through RenderPig and RenderLiving for the rendering code and textures, and copy them into RenderPigMissile; or 2) Create a static entityPig in RenderPigMissile, then when RenderPigMissile.doRender is called, set the relevant member variables in your static entityPig, then call RenderPig.doRender(entityPig, ...) directly. Rummaging through RenderLiving.doLiving should help you figure out what the "relevant member variables" are. PigMissile should still extend EntityThrowable in either case, because you want the game to treat it as a projectile not a pig. Good luck, should look pretty funny when it's done :-) -TGG
  13. you're welcome :-) Now I have learnt something too!
  14. what does the error message log say when the game crashes? it should look something like (for example) cpw.mods.fml.common.LoaderException: java.lang.NullPointerException at cpw.mods.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:60) at cpw.mods.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:72) at cpw.mods.fml.common.discovery.ContainerType.findMods(ContainerType.java:42) at cpw.mods.fml.common.discovery.ModCandidate.explore(ModCandidate.java:64) at cpw.mods.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:118) at cpw.mods.fml.common.Loader.identifyMods(Loader.java:354) at cpw.mods.fml.common.Loader.loadMods(Loader.java:486) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:182) at net.minecraft.client.Minecraft.startGame(Minecraft.java:462) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:788) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) Caused by: java.lang.NullPointerException at cpw.mods.fml.common.discovery.asm.ASMModParser.isBaseMod(ASMModParser.java:132) at cpw.mods.fml.common.discovery.asm.ModClassVisitor.visitMethod(ModClassVisitor.java:58) at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:852) at org.objectweb.asm.ClassReader.accept(ClassReader.java:669) at org.objectweb.asm.ClassReader.accept(ClassReader.java:506) at cpw.mods.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:55)
  15. Hi. I'd suggest the easiest way to track down the problem is to insert a breakpoint in RenderGlobal.renderEntities, perhaps here this.theWorld.theProfiler.endStartSection("entities"); for (i = 0; i < list.size(); ++i) { entity = (Entity)list.get(i); If you step through the code until it reaches yours, you should be able to see where it goes wrong, and hopefully how to fix it. -TGG
  16. Hi I've never done this, but perhaps adapting something from the vanilla code might get you there - for example this looks promising: BlockFluid:: protected void triggerLavaMixEffects(World par1World, int x, int y, int z) { par1World.playSoundEffect((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); for (int l = 0; l < 8; ++l) { par1World.spawnParticle("largesmoke", (double)x + Math.random(), (double)y + 1.2D, (double)z + Math.random(), 0.0D, 0.0D, 0.0D); } } See also RenderGlobal.doSpawnParticle for a listing of the different particle types You could place this code in one of the many places in the code that get called every tick (for example using TickHandler), spawn particles with a random chance at a random distance from the player position. -TGG
  17. I don't have quite the latest Forge installed, but I'm guessing the key will be somewhere in here: ItemRenderer.renderItemInFirstPerson at the line which looks something like Render render; RenderPlayer renderplayer; if (itemstack != null && itemstack.getItem() instanceof ItemMap) { I suspect they might have changed it to check for either a RenderType or RenderHelper or similar IItemRenderer method
  18. Ah, that is a good clue. Perhaps you might try changing your handleRenderType to say if (type == FIRST_PERSON_MAP) return false; return true;
  19. Hi I couldn't see anything in your code that tells how to render the pig? Have you used RenderingRegistry.registerEntityRenderingHandler? It should probably look something like RenderingRegistry.registerEntityRenderingHandler(EntityPigMissile.class, new RenderPig(new ModelPig(), new ModelPig(0.5F), 0.7F)); Once you have done that your renderer will be added to RenderManager and it should be called properly by the vanilla code (which for your interest starts in RenderGlobal.renderEntities just after this.theWorld.theProfiler.endStartSection("entities"); which goes through to RenderManager.renderEntityWithPosYaw
  20. Hi A couple of comments might help 1) in renderWorldBlock you need to override the texture before calling renderStandardBlock, not afterwards 2) It might be easier just to override Block.getIcon() and put your texture selection in here (see http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-standard-blocks-cubes.html) Also, Minecraft doesn't update the appearance of the blocks every tick, only when you have made a change (eg placed a block). So if you put your helmet on or off, you will need to force Minecraft to re-update the scene otherwise you won't see any change. http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-world-more-details-including.html Cheers TGG
  21. Hi That's pretty strange. Did you derive the corresponding item from an ItemMap perhaps? Does it look like a map in all item views(Inventory, First person, third person, or dropped on the ground (not placed as a block))? Perhaps you haven't registered the item properly? All I can suggest is that you insert a breakpoint in the minecraft code responsible for rendering a map (MapItemRenderer.renderMap) and then track back up the stack to see why it is being called instead of your IItemRenderer. -TGG
  22. Hi I've never done what you're looking for but I think this link might help you to understand the concepts http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-inventory-items.html The bit you are probably interested in is RenderItem.renderItemIntoGUI, about halfway down - look for requiresMultipleRenderPasses() and hasEffect(). Some of your comments make me think you might not have heard of alpha channel before? Your item images need to have alpha channel information so that Minecraft knows which part of the image is transparent. Cheers TGG
  23. Hi To be honest I don't understand your question at all. Perhaps you could add a bit more explanation, or even better a mocked-up picture of what you have in mind? -TGG
  24. Hi. I would suggest writing some custom rendering code for your block that looks to see what the adjacent block is and either copies its texture, or calls the rendering code for that block directly. A couple of keywords to search for: ISimpleBlockRenderingHandler and RenderBlocks.renderBlockByRenderType and Block.getIcon This link might help to understand how block rendering works: http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html with more detail: http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html Cheers TGG
  25. Hi It's kind of tough to give you any suggestions unless you give us some hints about what the symptoms are :-) At the risk of stating the obvious, I'd suggest you use a debugger to set break points in the code and see if you can figure out which parts of your code aren't being called. Have you remembered to register your RenderFinn class with RenderingRegistry.registerEntityRenderingHandler? Just something I noticed... if you are overriding functions from a base class that you are extending, it's considered good practice to put @Override before the function, it can help pick up subtle mistakes. http://www.javapractices.com/topic/TopicAction.do?Id=223 eg @Override protected void entityInit() { - TGG
×
×
  • Create New...

Important Information

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