Jump to content

RadioactiveStud

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by RadioactiveStud

  1. @diesieben07 Removed all the gl stuff, didn't work. @Nephroid Will take a look. (For the record, I did do the static final, but I didn't copy it to this forum) Edit: Thanks for the examples. I understand a lot better now. I don't think it helps me with my problem though.
  2. That is very true . In my defence though, I wrote the function without the gl stuff but the color problem presented itself, and I asked someome helping me if they knew how to fix it. They did.
  3. I need the glColor because if I don't have it, the new GUI changes colors depending on other renders I added to the screen. I believe that I need to other gl stuff for the glColor to work.
  4. Oh that's slightly outdated code. GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); GL11.glColor4f(1, 1, 1, 1); ResourceLocation r = new ResourceLocation(Reference.PREFIX + "textures/gui/armorBar.png"); res = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); int x = (res.getScaledWidth() / 2) - 11; int y = res.getScaledHeight() - 49; switch(EventArmorTick.size) { case 1: Minecraft.getMinecraft().getTextureManager().bindTexture(r); Util.drawTexturedModalRect(x, y, 0, 0, 9, 9); break; } GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); Here's drawTexturedModalRect. Pretty sure this is the same as the normal drawTexturedModalRect, I don't remember why I added it. public static void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { float f = 0.00390625F; float f1 = 0.00390625F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), 1D, (double)((float)(par3 + 0) * f), (double)((float)(par4 + par6) * f1)); tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), 1D, (double)((float)(par3 + par5) * f), (double)((float)(par4 + par6) * f1)); tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), 1D, (double)((float)(par3 + par5) * f), (double)((float)(par4 + 0) * f1)); tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), 1D, (double)((float)(par3 + 0) * f), (double)((float)(par4 + 0) * f1)); tessellator.draw(); }
  5. Oh, if I replace gui.drawArmor() with a drawString method like you did, it draws behind the chat. So it's not the event that's the problem it's drawArmor(). (drawArmor() can be seen in the OP)
  6. Well it's the exact same as shown but with the changed event. Do I need to change something? public void renderOverlay(RenderGameOverlayEvent.Post event){ if(event.isCanceled() || event.type != ElementType.EXPERIENCE) return; if((EventArmorTick.size != 0) && !Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) { gui.drawArmor(); } }
  7. Basically what he is saying is that you need to do tileEntity = (TileEntityStoneCauldron) entity; instead of getting the TileEntity from the world.
  8. Put setLightLevel(1.0F); in the block's constructor.
  9. Using Pre was just a suggestion by someone helping me. I've also tried using Post.
  10. Okay so, kinda forgot about this, but what ever I tried, it didn't fix the problem. Tried ElementType.Armor and some others. Nothing worked. Tried RenderGameOverlayEvent.Pre with and without event.isCanceled() Am I doing something wrong? Using recommended (1230) forge by the way.
  11. I actually tried to do that earlier but I don't know how to set an ElementType.
  12. I figured that was the case. I just don't know what to change to fix that. The function is being called with the RenderGameOverlayEvent which is being called in the ClientProxy in the preInit.
  13. I have run forge and it works as expected. Server seems to work but I have not tested thoroughly.
  14. I have a working GUI that draws to the screen just fine, but it renders in front of the chat instead of behind. What should I do? Image: Code: GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1, 1, 1, 1); ResourceLocation r = new ResourceLocation(Reference.PREFIX + "textures/gui/armorBar.png"); res = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); int x = (res.getScaledWidth() / 2) - 11; int y = res.getScaledHeight() - 49; GL11.glPushMatrix(); Minecraft.getMinecraft().getTextureManager().bindTexture(r); Util.drawTexturedModalRect(x, y, 0, 0, 9, 9); GL11.glPopMatrix(); GL11.glDisable(GL11.GL_BLEND); I can show other code if you wish.
  15. Hello. I am attempting to teleport the player to another (custom) dimension when he/she right clicks the block. When I use the code below, Minecraft crashes when I right click the block. I think the problem is how I am getting EntityPlayerMP. Am I doing something wrong? Is this even possible? public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { if(player.isSneaking()) return false; player.travelToDimension(ConfigurationHelper.vethea); EntityPlayerMP MPPlayer = (EntityPlayerMP)player; MPPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(MPPlayer, ConfigurationHelper.vethea); //Crashes. Need to find correct way to get EntityPlayerMP I think. return true; }
  16. What you want is to use onItemUse(). So public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { Block target = world.getBlock(x, y, z); if (target == Blocks.leaves) { itemStack.damageItem(1, player); else if (target == Blocks.cobblestone) itemStack.damageItem(5, player); }
  17. Hello, I am drawing image onto the main screen. For some reason, the image I am trying to draw is coming out completely transparent, but any other image I draw with the same exact method is working fine. I might have exported it out of gimp wrong or something. Any ideas? Other images working: But not the one I want: Here's my code:
  18. I had a total derp and for got about e.entity.attackEntityFrom(DamageSource.onFire, 16);
  19. Okay, so @SubscribeEvent public void onLightningStrike(EntityStruckByLightningEvent e) { e.entity.dealFireDamage(16); } does not work, because dealFireDamage is private. So how would I go about doing this.
  20. Oh, sorry. I was messing around and copied that from the wrong class. I was trying to make a custom lightning, but I was having issues. I'll try the EntityStruckByLightningEvent.
  21. Hello, I'm spawning a lightning bolt when I right click an item, and I know that this method in "Entity" tells the mod how much damage lightning does: public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt) { this.dealFireDamage(5); ++this.fire; if (this.fire == 0) { this.setFire(; } } So how would I go about changing how much damage the bolt does.
  22. Oh sorry. I thought all that just told it where to spawn exactly. My bad. Thanks.
  23. Eclipse ignores case ('G' or 'g') in images. Normal Minecraft does not. Make the names of the images are the exact same as what you set them to. So if setTextureName(prefix + "genericIngot"); Then the image should be named "genericIngot"
×
×
  • Create New...

Important Information

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