Everything posted by TheGreyGhost
-
Colored bed: the player won't sleep
Hi I suggest you put a breakpoint in the following two places: EntityPlayer.sleepInBedAt() and EntityPlayer.wakeUpPlayer() That should help you narrow down whether the player is going to sleep correctly, and why they are waking up again. -TGG
-
[1.7.10] Items Render In Random Locations
Hi What's the reason you set RenderItem.renderInFrame = true? Do you notice any pattern about when it renders correctly, and when it doesn't? Could you post a couple of screenshots, one good, the other not? -TGG
-
Block with composite texture
Hi A couple of things- 1) if you are going to use brightness, you need to tessellator.setBrightness(lightValue); after every tessellator.startDrawingQuads(); because the tessellator.draw(); resets the brightness to zero. 2) for transparent blocks, the appropriate light value is the one you use, i.e. int lightValue = block.getMixedBrightnessForBlock(world, x, y, z); but for opaque blocks, you need to take the light value for each face from the adjacent block, because the light value for the block itself is zero, eg int lightValue = block.getMixedBrightnessForBlock(world, x+1, y, z); if you are drawing the east face. 3) If you are drawing the FG on top of the BG you should 'nudge' the FG face out by a very small amount to make sure it renders over the top of the BG face. Otherwise it can get partially hidden or lead to weird stripy effects. For example, for the east face, draw BG at x+1, and the FG at x+1.001; Apart from that, your code looks ok to me. Are you sure your dust.getSecondaryColor(dustStack) etc are correct? the setNormals should only be required for inventory displaying; I don't think it should hurt to have them for block rendering too but you could try commenting them out if you are still having trouble. -TGG
-
[1.7.10] Render Icon issues
Hi It sounds like your render code is changing some of the OpenGL rendering flags which is then affecting vanilla objects which are drawn afterwards. Try wrapping your render code inside this GL11.glPushAttrib(GL11.GL_ENABLE_BIT); // all your rendering code here GL11.glPopAttrib(); That should save and restore the vanilla settings so that your rendering code doesn't affect vanilla objects. -TGG
-
[1.8] How to have a custom chest render correctly in inventory?
ah yeah, next time I should better read the title huh. Still working on figuring out 1.8 rendering myself, no help from me sorry. -TGG
-
Low fps with advanced model loader
Yeah that's quite large for minecraft. Try a model with less vertices (say 120) and see if your lag goes away... if so, perhaps you should consider simplifying your model Minecraft is supposed to look blocky, after all... -TGG
-
Missing a Mapping, but tile entity is registered.
Hi >>Why is that isModLoaded there? Does it get past that? >I am not quite sure. Just a suggestion - do you know how to use the debugger and breakpoints? If not, try this http://www.vogella.com/tutorials/EclipseDebugging/article.html It's really quite awesome what you can do with the debugger and once you've learnt how to use it you'll wonder how you ever managed without it. -TGG
-
[1.7.10] Custom Tile Entity Renderer has a shadowy overlay
Hi When you tried Lars' suggestion, did you do tessellator.startDrawingQuads(); tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); or tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); tessellator.startDrawingQuads(); ? The first one is the correct one. You could also try GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glDisable(GL11.GL_LIGHTING); all your rendering here GL11.glPopAttrib(); -TGG
-
Build Artifacts with Intellij 14 and MC 1.7.10
Hi That wiki link is rather old now. You don't need to use Build Artifacts to export your mod. The easier way for you is probably to use gradlew build. The exported mod should then be in /build/libs/ -TGG
-
[1.7.10] Items Render In Random Locations
Hi Pls show your code (and class) for entMix? -TGG
-
[1.8] How to have a custom chest render correctly in inventory?
Hi You are extending BlockChest which uses a custom render type hardwired for drawing a normal chest when it's being rendered as an item. The best way for you is probably to use an ISimpleBlockRenderingHandler, last time I checked (quite a while ago admittedly) there are a few tutorials around. It has two render methods - one for rendering as an item, and one for the block render when placed (the TileEntitySpecialRenderer is also called in addition to the ISBRH block render method). An IItemRenderer is also possible, just a bit more complicated. It is used for the "item" views only, not when placed. Some more info here under the Item Rendering sections http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
-
How to handle recipes with multiple outputs (buckets)?
Hi Vanilla uses Item.hasContainerItem() and a few related methods. If you search vanilla for that, you will find how the crafting recipes handle it as Draco said. -TGG
-
Ticking memory Connection
If my version of Forge is the same as yours, the error is here this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); Given that you're using a custom gui, I'm guessing that your container does something wrong here, i.e. returns a null slot. Slot slot = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); You could test this by putting a breakpoint on the this.sendPacket line. -TGG
-
Low fps with advanced model loader
Hi I don't see any obvious problems that would cause lag. How complicated is the model? (# of vertices)? Just a thought - your AWPRender class is only created once, right? You're not creating a fresh instance every frame (or every worse - every item render?) Might be worth putting a breakpoint or System.out.println("constructed"); into the constructor. -TGG
-
Block with composite texture
Hi Your code is a bit mixed up on which face points in which direction. The Tessellator is hard to get right, when I was first getting used to it I had to hold a cardboard box and label it with a pen to get the vertices right. So for example // east face //background color tessellator.setNormal(1F, 0F, 0.0F); tessellator.setColorRGBA_I(dust.getPrimaryColor(dustStack), 0xFF); tessellator.addVertexWithUV(x + 1.0, y + 0.0, z + 0.0, maxUBG, maxVBG); tessellator.addVertexWithUV(x + 1.0, y + 1.0, z + 0.0, maxUBG, minVBG); tessellator.addVertexWithUV(x + 0, y + 1.0, z + 0, minUBG, minVBG); tessellator.addVertexWithUV(x + 0, y + 0, z + 0, minUBG, maxVBG); The east face is the one which is located with all xpos = x+1, so none of the points in the face are located with xpos = x+0. The code above has all points located at zpos = z+0, which is the north face. In order to do the east face, you need (x+1, y+0, z+0, maxUBG, maxVBG) (x+1, y+1, z+0, maxUBG, minVBG) (x+1, y+1, z+1, minUBG, minVBG) (x+1, y+0, z+1, minUBG, maxVBG) The normal is right. -TGG
-
Raycasting entities
Hi If you're looking for a vanilla example, EntityRenderer.getMouseOver() does what you need. It finds the block or entity that the player's mouse cursor is pointing to. -TGG
-
[1.8] Animations Not Working Right
Hi I'm not sure I understand your question. Your code has this in it: this.leg1.rotateAngleX = (MathHelper.cos(f * 0.8F) * f1 / 1.5F); this.leg3.rotateAngleX = (MathHelper.cos(f * 0.8F) * f1 / 1.5F); this.leg2.rotateAngleX = (MathHelper.cos(f * 0.8F) * f1 / 1.5F); this.leg4.rotateAngleX = (MathHelper.cos(f * 0.8F) * f1 / 1.5F); If you don't want all your legs to move at once, why are you setting them all to be exactly the same? Look at ModelQuadruped.setRotationAngles() for some ideas on how you might change it... -TGG
-
GL11.glRotated code not working correctly
Hi It looks to me like your placement rotation is about right, but you are rotating around the wrong centrepoint. In order to fix that, you need to do GL11.glTranslatef(dX, dY, dZ); glRotate GL11.glTranslatef(-dX, -dY, -dZ); where dX, dY and dZ are the translation you need to make your turbine rotate around its centrepoint. You should be able to find that out from the program you used to make your model, alternatively trial and error will show you pretty quickly. the final float that you've labelled 'scale' is actually partialTick. Kind of like Brandon said, it's related to the time since the last tick. It helps you make smoother animations. For example, if you're drawing a spinning wheel using the code rotationPositionInDegrees = degreesPerTick * numberOfTicks and in your tileentity you have a field integerTickCount, which gets incremented every tick, for example in onUpdate(), then if you just use numberOfTicks = integerTickCount you will get jerky animation with at most 20 frames per second. Instead, if you use numberOfTicks = integerTickCount + partialTickCount your animation will be much smoother because you get 'partial' ticks between the integer values. If your game is running at say 60 frames per second this looks much nicer. -TGG
-
GL11.glRotated code not working correctly
Hi What do you mean "it doesn't rotate correctly"? Show pictures? -TGG
-
[1.7.2]Custom Arrow
Hi Post your entire crashlog in pastebin? The line you quoted as the error isn't the actual cause of the crash. You make a delay by counting ticks in onUpdate or similar. Eg for 3 seconds, that is 3 seconds * 20 ticks / second = 60 ticks Every time onUpdate is called, count up by one. When you get to 60, explode. The error you get when using @Override before onImpact is a warning that you have a spelling mistake or incorrect parameters in your onImpact method eg onimpact(..) instead of onImpact(...) -TGG
-
Block with composite texture
Hi There's a bit about the Tessellator here http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html Here's an old example from 1.6.4 which should give you the idea of how an ISBRH works https://github.com/TheGreyGhost/ItemRendering/blob/master/src/TestItemRendering/blocks/BlockPyramidRenderer.java and https://github.com/TheGreyGhost/ItemRendering/blob/master/src/TestItemRendering/blocks/BlockPyramid.java register it with RenderingRegistry.registerBlockHandler(new BlockPyramidRenderer()); I think it still works in 1.7.10... but I haven't tried it. It should get you most of the way there at least. -TGG
-
[1.7.2]Custom Arrow
Hi You may need to derive your arrow from EntityArrow; if you don't you might get a weird symptom where the arrow sticks in the wrong place and then suddenly jumps to a new position. http://www.minecraftforge.net/forum/index.php/topic,25314.msg128902.html#msg128902 and http://www.minecraftforge.net/forum/index.php/topic,14315.msg74087.html#msg74087 -TGG
-
Grass Texture
Hi YOu might find this useful http://www.rapidtables.com/web/color/RGB_Color.htm or http://www.yellowpipe.com/yis/tools/hex-to-rgb/color-converter.php -TGG
-
ClassLoader not finding files
Or, you could write a small java program to automatically generate a text file containing the appropriate source code for registering all the items, then add that source code to your project. Probably a lot faster... -TGG
-
[1.7.10]Leaves rendering like glass
Hi This link might be helpful to explain transparency http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html shouldSideBeRendered is probably what you need to change. -TGG
IPS spam blocked by CleanTalk.