Jump to content

SHsuperCM

Members
  • Posts

    264
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by SHsuperCM

  1. I came to modder support because my mod has a problem and I needed support to fix it.. I dont care how much he knows if he shortens his mind to something unrelated.... Again and again this forum brings this idiot to say that he knows some coding and he starts shouting that he wants people to do things his way and only his.... I dont understand why I keep trying to get help on here and listen to this fcker saying my code is wrong... fk this I'mma just get rid of this feature in the mod.. And its sad to see that thing happening on somewhere which is supposed to help modders....
  2. I will not because it works.. and again I'm not restarting this.. This thread is about something different and idc if others think a method is wrong or not.. it is coding and I'm free to do whatever I feel is right.. I came to modder support because I dont understand why something else wouldnt work..
  3. @sham1 see what I'm saying..
  4. If it didnt sync then all items wouldnt display but there are items that do correctly.. I'm trying to stay relaxed but diesieben is killing me with again and again telling me something else wont work which it does work.. I'm sorry if it annoys you I'm just working on this for hours...
  5. What makes you think that: How did you debug it: Throwing a bunch of items and some work and alot dont. How did you check that you are looking at the right item: entity.setCustomNameTag(itemstack.getDisplayName()); It sets the name to the item and I can clearly see that its wrong.. I've tried getDisplayName and also doing the nbt stuff like getDisplayName does and played with that..
  6. I'm saying again and again, its not getting the right string! nothing todo with how I display it! I want to get the item name from it but getDisplayName does not work! it returns wierd strings that I dont need..
  7. OMFG just get out of the thread already! I AM NOT TALKING ABOUT THAT! I AM TALKING ABOUT SOMETHING ELSE!
  8. Omg.. Stop talking about this... You CAN and it WORKS and AGAIN NOT WHAT I WAS MENTIONING...
  9. Why would you think I came here if I didnt try different things.. This is the one I used all along and also a few others but this one does what the first post says...
  10. Look, I know you're trying to help, but it does work and it is not what I asked for.. I'm asking for something completly different.. It doesnt have anything to do with how I display it...
  11. It workes for me really.. but changing the entity is not what I'm aksing here..
  12. public void t(Minecraft mc) { if (mc.world != null && mc.world.loadedEntityList != null && refresh.Passed()) { for (Entity entity:mc.world.loadedEntityList) { if (mc.world.loadedEntityList == null) break; if (entity instanceof EntityItem) { ItemStack itemstack = ((EntityItem) entity).getEntityItem(); if (itemstack.hasDisplayName()) { entity.setCustomNameTag(itemstack.getDisplayName()); entity.setAlwaysRenderNameTag(true); } } } } }
  13. Also on the items it does get, some items show the colors and some dont..
  14. Ok.. So.. I'm trying to get the itemstack name from an entity item and put it as an customname for the entity.. Now, this is a client side mod, meaning it does not add those items, and the items are not so much vanilla like.. Those items are generated by plugins on a server and they have custom everything, sooo, I was trying to get for example a healing potion which on the item name it says: "{LightRedFormat}Potion of Healing {DarkRedformat}[3/3]" now I'm using itemstack.getDisplayName() and it is just showing: "HEALING 19" instead of the real item name.. Thanks for anyone helping in advance..
  15. I'm sorry but I'm really trying to understand.. I have worked a ton with command blocks and I know how the Display Slots work and how its global and all of that.. I cant understand how I get for a spesific entity for that matter what it has in that slot..
  16. I'm not asking anyone to give me just a code that works, I'm trying to understand what I didnt understand when I was home on the IDE pc... I tried some things and I looked into the Scoreboard class first thing as I knew where that line exists in vanilla.. But I couldnt find anything on how to do it... I'm sorry if it makes you feel like I'm trying to get you to write me a mod but I came to modder support because I couldnt solve it by myself...
  17. I'm not on my IDE pc sadly.. I'm trying to get some information for when I come back to it..
  18. Then how would I spesificly get the one with setdisplay belowName of an entity?
  19. The problem is, is that I dont know what score it is, how would I use scoreboard properly and how do I check it per entity around player.. I need to check for Entities around the player also and I dont know how to update the line that I posted or if there is a better way.. What I mean is that I dont know how to list the mobs properly also and I need spesificly the line below the entity's name..
  20. I'm trying to get some entities around the player and then list some information about them, Googling around I found this: List<EntityMob> e = player.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getBoundingBox(player.posX - 5, player.posY - 5, player.posZ - 5, player.posX + 5, player.posY + 5, player.posZ + 5)); Though, I'm not sure if it works right on a client side mod. Other than that I need to get their names and the line below their names: This line is a vanilla scoreboard line that you create through any objective and "/scoreboard objectives setdisplay OBJECTIVE belowName" if it helps in any way. Thanks to everyone that helps!
  21. Thank you so much! I suck at math.. If anyone needs the method: public void drawString(FontRenderer fontRendererIn, String text, int x, int y, float size, int color) { GL11.glScalef(size,size,size); float mSize = (float)Math.pow(size,-1); this.drawString(fontRendererIn,text,Math.round(x / size),Math.round(y / size),color); GL11.glScalef(mSize,mSize,mSize); }
  22. That I know, but how.. I dont know how much I have to multiply it and to what..
  23. Ok, so I got this method within an extender to GuiScreen. public void drawString(FontRenderer fontRendererIn, String text, int x, int y, float size, int color) { GL11.glScalef(size,size,size); float mSize = (float)Math.pow(size,-1); this.drawString(fontRendererIn,text,x,y,color); GL11.glScalef(mSize,mSize,mSize); } which draws a string with a different scale(multiplier) and then resets GL scale to normal.. The problem is, the point of which it scales from is at x,y which means the scale will move the string bottom-right a bit.. Now, since the scalef is not linked to the width of height of anything, it will leave the text in a wierd place once I resize the minecraft screen or move computers to different resolutions.. I need to find a way to translate the text back to a point based on scale, x and y. and I just dont know how... Any help is appreciated..
  24. Yay! finally figured it! If anyone needs: public void drawString(FontRenderer fontRendererIn, String text, int x, int y, float size, int color) { GL11.glScalef(size,size,size); float mSize = (float)Math.pow(size,-1); this.drawString(fontRendererIn,text,x,y,color); GL11.glScalef(mSize,mSize,mSize); } public void drawSplitString(FontRenderer fontRenderer, String str, int x, int y, int wrapWidth, float size, float padding, int textColor) { GL11.glScalef(size,size,size); float mSize = (float)Math.pow(size,-1); int i = 0; for (String string:fontRenderer.listFormattedStringToWidth(str,wrapWidth)) { drawString(fontRenderer,string,x,y + Math.round(i * size * fontRenderer.FONT_HEIGHT * padding),size,textColor); i++; } GL11.glScalef(mSize,mSize,mSize); } Also, Tnx @Choonster for showing me FontRenderer#listFormattedStringToWidth, it helped alot!
×
×
  • Create New...

Important Information

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