Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. I haven't actually tried it yet, but I'm pretty sure that's it. Edit: Got a moment to drop a glDisable in. Works perfectly.
  2. For shits and giggles, compare to the code I used: Tessellator tessellator = Tessellator.instance; byte byte0 = 0; GL11.glDisable(3553); tessellator.disableColor(); tessellator.startDrawingQuads(); int j = fontrenderer.getStringWidth(s) / 2; tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.35F); tessellator.addVertex(-j - 1, -1 + byte0, 0.0D); tessellator.addVertex(-j - 1, 8 + byte0, 0.0D); tessellator.addVertex(j + 1, 8 + byte0, 0.0D); tessellator.addVertex(j + 1, -1 + byte0, 0.0D); tessellator.draw(); //tessellator.func_78381_a(); GL11.glEnable(3553); fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, byte0, 553648127); GL11.glEnable(2929); GL11.glDepthMask(true); fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, byte0, -1); GL11.glEnable(2896); GL11.glDisable(3042); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix();
  3. You need to register the renderer with the Render....(RenderManager? RenderEngine? One sec...oh, right the RenderingRegistry)
  4. If you're trying to change the look, you can use texture packs.
  5. How much other programming experience did you have prior, though?
  6. It's called a Race Condition. If you change the block hardness, that effects ALL players. What the hardness is would depend on the last player to start mining the block.
  7. Yes. Use a bitflag (as metadata) to save its powered/unpowered state. All you should need to do is check for power in the onNeighborBlockChanged function, if it has it, set its powered flag (if not, clear it) then schedule an updateTick (which is where the code you have should be already)
  8. I need a better idea of what the goal you have in mind is, first.
  9. Ah ha! Fantastic. I knew something like that was floating around somewhere, but I had no idea where to look or what to look for (I don't typically deal with OGL).
  10. https://github.com/Draco18s/Artifacts
  11. Ah, the magic of Static.
  12. NameOfClassWhereIntegerLives.IncreaseThatThing(); function int IncreaseThatThing() { NameOfStaticInteger += 1; setDirty(); return NameOfStaticInteger; }
  13. .... if(Block.blocksList[world.getBlockId(x, y, z)] instanceof BlockPipes) { } Now you don't need the variable, or the try/catch (which is SLOW).
  14. Uh. You know there's only one instance of each block class, yes? This is not how you store per-block information.
  15. public void render(int left, int top, int width, int height) { Tessellator tessellator = Tessellator.instance; TextureManager renderEngine = FMLClientHandler.instance().getClient().getTextureManager(); renderEngine.bindTexture(renderEngine.getDynamicTextureLocation("link", bufferedimage)); GL11.glEnable(GL11.GL_BLEND); tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double)(left), (double)(128+top), 0.0D, 0.0D, 1.0D); tessellator.addVertexWithUV((double)(128 + left), (double)(128+top), 0.0D, 1.0D, 1.0D); tessellator.addVertexWithUV((double)(128 + left), (double)(top), 0.0D, 1.0D, 0.0D); tessellator.addVertexWithUV((double)(left), (double)(top), 0.0D, 0.0D, 0.0D); tessellator.draw(); GL11.glDisable(GL11.GL_BLEND); } This works with one slight issue: Any pixels in the bufferedimage with an alpha value lower than 26 (0x1A) aren't drawn at all. Other values are drawn as expected with the appropriate amount of transparency. How do I fix it?
  16. If you can't figure it out, give XCompWiz a poke. He's gotten Mystcraft to have dynamic sky colors (including rainbow hue shifts over time). Mystcraft isn't open source, but XCW is pretty helpful about getting specific features working the way (generic) you want them to for your mod.
  17. EntityPlayerMP (and it's relatives, like EntityPlayerClientMP) only exist either Server side or Client side, not both. You should check for if(world.isRemote) or if(!world.isRemote) (e.entity.worldObject being an appropriate stand-in if you don't have a world object already) After you've determine you are on the client (or server, as appropriate) can you check for typecasting.
  18. ...You might want to actually get the various xray cheats and check....
  19. Not that I am aware of. Probably possible, but I haven't looked into it.
  20. Well first off....item right clicks are handled client side... So you'd need a packet handler... But to answer the question: NameOfClassWhereIntegerLives.NameOfStaticInteger += 1
  21. Silk Touch would get you "natural" stone, but there's no ability to "cheat" resources there, as once its broken by not-silk-touch it drops the resource and not the stone. So it's still one-for-one.
  22. And where are your textures when you zip things up?
  23. Zaa! http://www.minecraftforge.net/wiki/Mob_Spawners And for an example: https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/worldgen/StructureMasterTower.java (all the way at the bottom)
  24. No and Yes. If you do it as an IWorldGenerator, yes, but only at chunk generation. If you make new blocks and shove them into the blocksList at the old block's ID (essentially getting around the conflicting ID problem) you can cheat, but keep in mind that this may cause compatibility issues with other mods.* But you won't have any extra chunk generation lag. *As an example I used Block.furnaceIdle to get the furnace texture to use on one of my blocks, but someone paired my mod with a mod that replaced the vanilla furnace in the above manner, leaving the vanilla furnace to never register its textures, thus making a null pointer error in my mod.
  25. Just checking. In any case, I've not directly used the onCreated method, so all I can offer is: Use debug statements and break points to figure out if onCreated is getting called or not. I based my reply on the Javadocs that said that's when the function is called.
×
×
  • Create New...

Important Information

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