Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi The reason for introducing BlockModels is for the benefit of the resource pack creators, not the programmers. IMHO that's the way it should be, no more ridiculous switch() statements in RenderBlocks for every type of block and special cases and instance of all over the place. Much more extensible and modular too. But yeah it is a lot more complicated for us. -TGG
  2. Forge does have support for fluids but I've never used it so I'm not sure. Also, I think it may not have been updated for 1.8 yet. If you do figure it out, please let me know, I'd like to do a tutorial / MinecraftByExample topic on it at some point... Cheers TGG
  3. Hi RenderPlayer.renderFirstPersonArm() does all that, called from renderItemInFirstPerson, so I imagine you would just need to copy the setup code out of there that you need. for example this.mc.getTextureManager().bindTexture(entityclientplayermp.getLocationSkin()); and this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, p_82441_1_); -TGG
  4. Hi I've noticed something in Forge that might help GameRegistry.addSubstitutionAlias(). I've never used it and it may be useless... but it does look promising. -TGG
  5. Hi I thought that the entity for the cause of the explosion is (say) the Blaze that fired it, not the fireball? -TGG
  6. Hi Fluids aren't rendered the same way as normal blocks. Vanilla does it this way, fluid blocks return 1 for getRenderType(). BlockRendererDispatcher:: public boolean func_175018_a(IBlockState p_175018_1_, BlockPos p_175018_2_, IBlockAccess p_175018_3_, WorldRenderer p_175018_4_) { try { int i = p_175018_1_.getBlock().getRenderType(); if (i == -1) { return false; } else { switch (i) { case 1: return this.fluidRenderer.func_178270_a(p_175018_3_, p_175018_1_, p_175018_2_, p_175018_4_); // here case 2: return false; case 3: IBakedModel ibakedmodel = this.getModelFromBlockState(p_175018_1_, p_175018_3_, p_175018_2_); return this.blockModelRenderer.func_178259_a(p_175018_3_, ibakedmodel, p_175018_1_, p_175018_2_, p_175018_4_); default: return false; } } } Unfortunately I don't know how to get it to show the fluid texture. You may need to use ASM+Reflection to force a call to your own renderer from this switch. -TGG
  7. Yes it's one of your classes to blame. This link explains it a bit more. You need to cleanly separate your code into server side and client side using @SidedProxy. http://greyminecraftcoder.blogspot.com.au/2013/11/how-forge-starts-up-your-code.html (The section on Proxies) -TGG
  8. Hi You can have as many states or flags combined in IBlockState as you want. You can't store more than 4 bits' worth in metadata, but that doesn't matter: Some multiblock structures, such as BlockDoor or BlockBed, use a third method called Block.getActualState() which checks the IBlockState of the other blocks in the multiblock - this allows the multiblock to synchronise the state of all blocks in the multiblock (eg BlockBed - OCCUPIED); and/or store more than 4 bits' worth information- for example BlockDoor: - the upper block of the door stores the HINGE position (LEFT/RIGHT), and whether the door is POWERED or not. - the lower block of the door stores the FACING (NORTH, SOUTH, EAST, WEST) and whether the door is OPEN or not. The same method Block.getActualState() is also used by blocks which change appearance depending on their neighbours - for example BlockFence, BlockRedstoneWire. Block.getActualState() is generally called just before a render, to make sure the block has the correct appearance. -TGG
  9. Hi I'm not seeing an obvious problem. You could use this tool to help troubleshoot: NBTexplorer is a very useful tool to examine the structure of your NBT saved data and make sure it's correct: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1262665-nbtexplorer-nbt-editor-for-windows-and-mac Just a wild guess - try using lower case i.e. power instead of POWER -TGG
  10. Hi. I guess you didn't try what I suggested? The crash is on your line 45: GameRegistry.registerItem(electricshard, electricshard.getUnlocalizedName()); A null pointer exception here means electricshard is null. If you're not keen to learn about the debugger, you can also check this using this command: System.out.println("electricshard:" + String.valueOf(electricshard)); GameRegistry.registerItem(electricshard, electricshard.getUnlocalizedName()); electricshard is set here 33: electricshard = new Item ().setUnlocalizedName("electricshard").setCreativeTab(MCreativeTabs.tabItems).setTextureName(RefStrings.MODID + ":electricshard").getItemFromBlock(MBlocks.electrico); Something in this line must be setting electricshard to null. Hint - I think you have misunderstood how to use this method correctly. When you register a block, it automatically registers an ItemBlock (extends Item) for you as well. You can use this method to retrieve it, but you don't need all the new Item() since it is a static method, i.e. you can write Item.getItemFromBlock. The block must have been instantiated and registered already. public static Item getItemFromBlock(Block p_150898_0_) { return getItemById(Block.getIdFromBlock(p_150898_0_)); } -TGG
  11. Hi This sample project has a TileEntitySpecialRenderer in it which does that https://github.com/TheGreyGhost/MinecraftByExample see MBE21. It's for 1.8 but the rendering is almost identical for 1.7. -TGG
  12. Try saving and restoring the settings instead of just setting them to off after your render. GL11.glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT); //.. render here GL11.glPopAttrib(); -TGG
  13. LivingUpdateEvent occurs on both client and server I think. Are you checking for that? -TGG
  14. Hi Before rendering your red mask, try turn off drawing to the depth mask as well GL11.glDepthMask(false); -TGG
  15. Are you messing with the Entity Tracker on client side code? This error means that the server thread is trying to access an EntityTracker object which another thread has just modified. Probably it was you... These errors can be a real pain to track down. You might be able to get some clues if you put a breakpoint on ConcurrentModificationException with Pause All Threads, then see what the other threads are doing / have just done when the breakpoint triggers. -TGG
  16. Hi Did you try rendering in pre and turning blending on using OpenGL? Item.isFull3D() is what you need to change for the bottle in 1.7.10. -TGG
  17. Hi You might find the info on this site useful. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
  18. Hi Depending on what you want to do, an ISmartBlockModel might help. The github for Forge has an example on how to use it. https://github.com/MinecraftForge/MinecraftForge/blob/master/src/test/java/net/minecraftforge/debug/ModelBakeEventDebug.java Haven't tried it myself, yet. -TGG
  19. Perhaps... I'll add it to the list.... at the moment I'm working on converting a mod of mine to 1.8, it is taking ages. After that I plan a few tutorials on weapon damage, storage locations for your data, redstone, and entities (in that order). So probably not for a few months at that rate -TGG
  20. Hi A breakpoint in your TeleporterPuplet.makePortal() should very quickly show you what's wrong. -TGG
  21. hi Minecraft.getMinecraft().thePlayer.getEquipmentInSlot(1) == new ItemStack("Armor I want") == won't work here. http://greyminecraftcoder.blogspot.com.au/2013/12/items.html (see first general note) -TGG
  22. Hi You need to set the appropriate lighting settings otherwise you will carry over from the previous object rendered. The two main settings to watch out for are the item model lighting and the block lighting (multitexturing). This link explains it a bit. http://greyminecraftcoder.blogspot.com.au/2014/12/lighting-18.html This is a TESR example in 1.8 which renders reliably (uses the Tessellator): https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe21_tileentityspecialrenderer/TileEntitySpecialRendererMBE21.java Some further info on the steps it uses http://greyminecraftcoder.blogspot.co.at/2014/12/the-tessellator-and-worldrenderer-18.html The classes in 1.8 are slightly different to 1.7 but the logic is identical. You might also find this tool useful to find out what the opengl settings are - dumpAllIsEnabled() for a good render, dumpAllIsEnabled() for a bad render, and spot the difference. https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/usefultools/OpenGLdebugging.java -TGG
  23. Hi Almost certainly you are registering an item that you haven't instantiated yet (i.e. using new() ). at com.James.item.MItems.registerItem(MItems.java:45) These links will help you understand how to troubleshoot this type of error yourself. It will save you an awful of time and frustration... http://www.terryanderson.ca/debugging/run.html http://www.vogella.com/tutorials/EclipseDebugging/article.html -TGG
  24. Hi Well that's strange. if your getRenderType returns -1, I thought it doesn't look for a json. I could be wrong. You could get rid of the error message by creating a dummy json which doesn't draw anything, eg has no elements. Or alternatively if that doesn't work, a json which has a single transparent face. For more info on how to do that see here (the three block rendering topics) http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
  25. Hi You'll probably find this example project useful, it has an example of multiple textures for different item variants (metadata) in it. https://github.com/TheGreyGhost/MinecraftByExample See package MBE11. -TGG
×
×
  • Create New...

Important Information

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