TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
I can't get The GuiHandler working
TheGreyGhost replied to ItsAMysteriousYT's topic in Modder Support
Hi It sounds like you are messing up the numbering of your inventory slots. This tutorial project (for 1. has a working example of a container with a lot of comments to explain how to get the numbering right. https://github.com/TheGreyGhost/MinecraftByExample - see MBE30 -TGG -
[1.8] Strange color issues with custom leaves (SOLVED)
TheGreyGhost replied to brsgamer's topic in Modder Support
I suggest - look at ItemLeaves. You have created a custom ItemBlock corresponding to your Block, yeah? This looks promising... @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int renderPass) { return this.leaves.getRenderColor(this.leaves.getStateFromMeta(stack.getMetadata())); } -TGG -
[1.8] Rendering Tips & Tricks needed
TheGreyGhost replied to Bedrock_Miner's topic in Modder Support
Hi 1. keen. 2.IBakedModel is deprecated because one of the forge team (Rainwarrior I think) wants you to use IFlexibleBakedModel instead. /* * Version of IBakedModel with less restriction on camera transformations and with explicit format of the baked array. */ Just ignore it unless you are trying to do fancy stuff with your models and you know what you're doing. 3. In order to figure out the OpenGL constants, you can do this- a) Convert the number to hexadecimal eg GlStateManager.depthFunc(514); becomes GlStateManager.depthFunc(0x202); b) Search the GL11 class for 0x202 --> GL_EQUAL = 0x202, or GlStateManager.matrixMode(5890); --> GlStateManager.matrixMode(0x1702); --> GlStateManager.matrixMode(GL_TEXTURE); This methods renders the model again, but binding the "glint" texture, using an unusual blend mode and translating/rotating the texture in a time-dependent way to give it the moving glint appearance. 4. Sorry, had no experience with B3D, can't help there... 5. How I think you could solve your problem: a) Render your 3D item or block as normal, but to a texture instead of to the screen. You now have a flat 2D texture of your item/block that looks the same as when displayed in your inventory. b) You can then convert it into an "item with thickness" exactly the same as you did in 1) The methods in that class in the repo show you how to do step a). You will need to rotate the block to be oblique view instead of direct-on to a face like that class does. -TGG -
[1.8] Strange color issues with custom leaves (SOLVED)
TheGreyGhost replied to brsgamer's topic in Modder Support
Hi look at Block.isOpaqueCube(). if your isOpaqueCube() returns true, but your leaves are see-through, this is what you get. -TGG -
[1.8][SOLVED] Textures doesn't work on items.
TheGreyGhost replied to nikko4913's topic in Modder Support
Hi This guid might be useful http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html also this tutorial project which has several examples of simple items and blocks. https://github.com/TheGreyGhost/MinecraftByExample -TGG -
-->what Lars said. You might find this tutorial project useful, it has a working example of a TESR (MBE21) https://github.com/TheGreyGhost/MinecraftByExample -TGG
-
Hi Yes it's possible The vanilla code which does this is TextureMap.loadTextureAtlas() This line puts the ".png" on the end ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation, 0); -TGG
-
[1.8] Rendering Tips & Tricks needed
TheGreyGhost replied to Bedrock_Miner's topic in Modder Support
With ICustomModelLoader and your own IBakedModel you can do this quite easily. https://github.com/MinecraftForge/MinecraftForge/blob/master/src/test/java/net/minecraftforge/debug/ModelBakeEventDebug.java or https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe05_block_smartblockmodel2/Notes.txt You've got enough rendering challenges there to last you for quite a while I think -TGG -
[1.8] Rendering Tips & Tricks needed
TheGreyGhost replied to Bedrock_Miner's topic in Modder Support
Hi 1: look in ItemModelGenerator.makeItemModel() 2: check out BlockModelRenderer 3: This link shows an example of custom layers for your item model https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe11_item_variants/Notes.txt and this one talks a bit more about layers and about the enchantment "glint" http://greyminecraftcoder.blogspot.com.au/2014/12/item-rendering-18.html See also RenderItem.renderEffect() -TGG -
Network messages are hard to get right in 1.8 because of multithreading. This guide might help http://greyminecraftcoder.blogspot.com.au/2015/01/the-client-server-division.html especially http://greyminecraftcoder.blogspot.com.au/2015/01/client-server-communication-using-your.html and http://greyminecraftcoder.blogspot.com.au/2015/01/thread-safety-with-network-messages.html Also this tutorial project which has a working example of network messages (MBE60) https://github.com/TheGreyGhost/MinecraftByExample -TGG
-
[1.8] Rendering Tips & Tricks needed
TheGreyGhost replied to Bedrock_Miner's topic in Modder Support
-
Hi YOu might also find this tutorial project useful, it has two working examples of ISmartBlockModel. https://github.com/TheGreyGhost/MinecraftByExample (see MBE04 and MBE05) -TGG
-
> Model definition for location 1.0:vamp_one Your modid is 1.0 not vamps as you expect. Looks like you swapped mod id and version in your main mod file. -TGG
-
Hi This guide might be useful http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html I'll have a look myself too , but will take a while due to AFK -TGG
-
Ah. I should have noticed that. It looks like you've uncovered a forge bug that has been introduced since I wrote that troubleshooting guide. public IModel loadModel(ResourceLocation modelLocation) { try { return loader.new VanillaModelWrapper(modelLocation, loader.loadModel(modelLocation)); } catch(IOException e) { if(loader.isLoading) { // holding error until onPostBakeEvent } else FMLLog.log(Level.ERROR, e, "Exception loading model %s with vanilla loader, skipping", modelLocation); return loader.getMissingModel(); } } It ignores the error here, "holding error until onPostBakeEvent", but onPostBakeEvent doesn't rediscover the error. I'll update the guide, maybe put a bug report too. -TGG
-
Render Item as custom Tile Entity in 1.8
TheGreyGhost replied to Bedrock_Miner's topic in Modder Support
example MBE05 in this project has an example of that https://github.com/TheGreyGhost/MinecraftByExample Not sure I understood exactly what you want to do, but MBE12 does something very similar using Item.getModel() -TGG -
Render Item as custom Tile Entity in 1.8
TheGreyGhost replied to Bedrock_Miner's topic in Modder Support
I'm not certain, but you could try Minecraft.getTextureMapBlocks().getAtlasSprite(resource name) You may need to take a look in there to see what format / prefixes the texture resource locations have -TGG -
sorry dude, I don't see it. I suggest you strip out all the other blocks and items, change all your unlocalised names, folders and filenames to lower case. If that doesn't work, you could add a breakpoint to Block.getActualState(), place the block on the ground, wait for the breakpoint to trigger, and then step out into BlockRendererDispatcher.getModelFromBlockState(). You can then step through the fetching of the block model (eg) IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(p_175022_1_); which will show you whether you're getting the correct model or not. If you are, it's probably a texturing problem. If not, something is wrong with your model registration. You might be able to tell what went wrong by looking in BlockModelShapes.bakedmodelstore, or alternatively in BlockStateMapper.putAllStateModelLocations. Either way, you'll be digging pretty deep into the registry code so I gotta warn you, you might find it frustrating...
-
Hi Pls post your latest versions of: 1) Screenshots (1=block placed down, 2=block held in your hand as an item) 2) Console error log 3) your blockstates.json 4) your block model file 5) your block registration code -TGG PS it's probably not your MicrobeExtractor class, unless you're doing something very strange
-
[1.8] Rendering two models inside a single tileentity block
TheGreyGhost replied to 10paktimbits's topic in Modder Support
Hi It should be possible, in your TileEntitySpecialRenderer, to retrieve the IBakedModel for both blocks using Minecraft mc = Minecraft.getMinecraft(); BlockRendererDispatcher blockRendererDispatcher = mc.getBlockRendererDispatcher(); BlockModelShapes blockModelShapes = blockRendererDispatcher.getBlockModelShapes(); IBakedModel ibakedmodel = blockModelShapes.getModelForState(iBlockState); and then render the appropriate face(s) of that. The hardest part will be setting up the rendering settings correctly. You could look at RenderItemFrame for inspiration. You could also use ISmartBlockModel to combine the two models together without using TESR at all. For example see here https://github.com/TheGreyGhost/MinecraftByExample (examples MBE04 and MBE05) Alternatively, if you set up a custom model for #1 with its own DynamicTexture and use the Tessellator to draw the top face, you could dynamically modify the texture as you suggested. That's probably harder though. If you are thinking of going that route, this class might be useful: https://github.com/TheGreyGhost/SpeedyTools/blob/master/src/main/java/speedytools/clientside/selections/SelectionBlockTextures.java This class is used to capture the texture of all sides of a given block and store them in a DynamicTexture. Other classes then bind the dynamic texture and use the Tessellator to render a cube in mid-air. RenderFallingBlock.doRender() shows some vanilla code which does something similar. It might also be possible, using the same technique, to use OpenGL to render your new texture directly to the blocks texture sheet TextureMap.locationBlocksTexture. If you're just learning Minecraft and/or OpenGL I think it will be a steep learning curve... -TGG -
[1.8] [SOLVED] TintIndex: Anyone gotten it to do anything useful?
TheGreyGhost replied to Zaerudath's topic in Modder Support
Wool uses different coloured textures, eg wool_colored_black.png, wool_colored_red.png, etc -TGG -
Render Item as custom Tile Entity in 1.8
TheGreyGhost replied to Bedrock_Miner's topic in Modder Support
Hi 1st question: yep http://www.minecraftforge.net/forum/index.php/topic,28873.msg148526.html#msg148526 2nd question: Yes (I think) but I'll need to test something in code first... if nobody else replies first, I'll hopefully have something that works later today. If you want to try it in the meantime, Item.getModel will be useful for changing the model in first and third person. IItemRenderer is dead, I don't even think it works in 1.8 at all. -TGG