-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Alpha Blending with DynamicTexture (in a GUI)
Draco18s replied to Draco18s's topic in Modder Support
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. -
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();
-
You need to register the renderer with the Render....(RenderManager? RenderEngine? One sec...oh, right the RenderingRegistry)
-
If you're trying to change the look, you can use texture packs.
-
[SOLVED] Problems With Tick Handlers (Casting World to Object[])
Draco18s replied to Mitchellbrine's topic in Modder Support
How much other programming experience did you have prior, though? -
How to know if a block is natural generated or not
Draco18s replied to zerozhou's topic in Modder Support
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. -
Placing/removing blocks depending on redstone state
Draco18s replied to Flenix's topic in Modder Support
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) -
[1.6.4] How to make "meta items" based on NBT Tags.
Draco18s replied to SackCastellon's topic in Modder Support
I need a better idea of what the goal you have in mind is, first. -
Alpha Blending with DynamicTexture (in a GUI)
Draco18s replied to Draco18s's topic in Modder Support
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). -
[1.6.4] How to make "meta items" based on NBT Tags.
Draco18s replied to SackCastellon's topic in Modder Support
https://github.com/Draco18s/Artifacts -
Ah, the magic of Static.
-
NameOfClassWhereIntegerLives.IncreaseThatThing(); function int IncreaseThatThing() { NameOfStaticInteger += 1; setDirty(); return NameOfStaticInteger; }
-
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?
-
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.
-
[solved]Sync client and server Extended Properties
Draco18s replied to Bedrock_Miner's topic in Modder Support
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. -
How to know if a block is natural generated or not
Draco18s replied to zerozhou's topic in Modder Support
...You might want to actually get the various xray cheats and check.... -
Not that I am aware of. Probably possible, but I haven't looked into it.
-
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
-
How to know if a block is natural generated or not
Draco18s replied to zerozhou's topic in Modder Support
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. -
Forge 1.6.2 - Item/Block textures will not work
Draco18s replied to gabe_oz's topic in Modder Support
And where are your textures when you zip things up? -
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)
-
How to know if a block is natural generated or not
Draco18s replied to zerozhou's topic in Modder Support
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. -
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.