SHsuperCM
Members-
Posts
264 -
Joined
-
Last visited
-
Days Won
1
Everything posted by SHsuperCM
-
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
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.... -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
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.. -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
@sham1 see what I'm saying.. -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
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... -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
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.. -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
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.. -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
OMFG just get out of the thread already! I AM NOT TALKING ABOUT THAT! I AM TALKING ABOUT SOMETHING ELSE! -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
Omg.. Stop talking about this... You CAN and it WORKS and AGAIN NOT WHAT I WAS MENTIONING... -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
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... -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
-
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
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... -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
It workes for me really.. but changing the entity is not what I'm aksing here.. -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
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); } } } } } -
[1.11] [Client-Mod] Get itemstack name being wierd
SHsuperCM replied to SHsuperCM's topic in Modder Support
Also on the items it does get, some items show the colors and some dont.. -
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..
-
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...
-
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..
-
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!
-
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); }
-
That I know, but how.. I dont know how much I have to multiply it and to what..
-
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..
-
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!