TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
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
-
[1.8] Custom Fluid Rendering (Invisible Fluid)
TheGreyGhost replied to TricliniumAlegorium's topic in Modder Support
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 -
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
-
[1.8] Any way to make vanilla dirt a falling block?
TheGreyGhost replied to Anon10W1z's topic in Modder Support
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 -
[1.7.10] EntityLargeFireball Explosion Question
TheGreyGhost replied to grand_mind1's topic in Modder Support
Hi I thought that the entity for the cause of the explosion is (say) the Blaze that fired it, not the fireball? -TGG -
[1.8] Custom Fluid Rendering (Invisible Fluid)
TheGreyGhost replied to TricliniumAlegorium's topic in Modder Support
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 -
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
-
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
-
[1.7.10] NBT.setFloat and NBT.getFloat not working
TheGreyGhost replied to Alanzote's topic in Modder Support
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 -
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
-
[1.7.10] Block with glowing parts in the darkness
TheGreyGhost replied to SantacreeperLP's topic in Modder Support
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 -
[1.7.10/1.8] Drawing beneath the hotbar.
TheGreyGhost replied to 61352151511's topic in Modder Support
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 -
LivingUpdateEvent occurs on both client and server I think. Are you checking for that? -TGG
-
[1.7.10/1.8] Drawing beneath the hotbar.
TheGreyGhost replied to 61352151511's topic in Modder Support
Hi Before rendering your red mask, try turn off drawing to the depth mask as well GL11.glDepthMask(false); -TGG -
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
-
[1.7.10/1.8] Drawing beneath the hotbar.
TheGreyGhost replied to 61352151511's topic in Modder Support
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 -
Hi You might find the info on this site useful. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
-
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
-
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
-
[1.7.10] Colliding Entity with block
TheGreyGhost replied to yanksrock1019's topic in Modder Support
Hi A breakpoint in your TeleporterPuplet.makePortal() should very quickly show you what's wrong. -TGG -
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
-
[SOLVED] [1.7.10] Custom Rendered Block Lighting Bug
TheGreyGhost replied to TheNuclearDuck's topic in Modder Support
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 -
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
-
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
-
[SOLVED] [1.8] Registering Multiple Textures
TheGreyGhost replied to PlasmaBlazer's topic in Modder Support
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