Jump to content

Coder

Members
  • Posts

    94
  • Joined

  • Last visited

Posts posted by Coder

  1. 1 minute ago, diesieben07 said:

    You need to stop being vague. In that specific event handler, what exactly would you do with the name, and why?

    I would like to get the item that has joined, get its name, take that name check if it is included inside an array if so, tell me that this item is there and it has the said custom name.

    I want to highlight items that spawn when you have many items on the ground it is very helpful. That's all.

  2. Just now, diesieben07 said:

    EntityJoinWorldEvent fires when an entity joins the world. There are no item stacks involved. Please clarify which ItemStack you want to access.

    I would like to get the name of every item that "joins" the world. Meaning the entity item that's on the ground.

  3. 20 hours ago, Draco18s said:

    You're likely doing something wrong. You should stop doing it wrong.

     

      Hide contents

    Post your code?

     

    Sure

    Spoiler
    
        private static final Field DATA_FIELD;
        static {
            {
                Class<?> clazz = Entity.class;
                Field f = null;
                for (Field field : clazz.getDeclaredFields()) {
                    if (field.getType() == EntityDataManager.class) {
                        f = field;
                        break;
                    }
                }
                f.setAccessible(true);
                DATA_FIELD = f;
            }
        }
        
        public static void setEntityDataManager (Entity entity, EntityDataManager manager ) {
            try {
                DATA_FIELD.set(entity, manager);
            } catch(Exception e) {
                e.printStackTrace();
            }
        }

     

     
     

     

  4. Hello,

     

    I am using reflection to get an item's display name by replacing its data manager.

    the only thing I am changing there is setEntryValues in which I find the itemStack and like this, I get the item display name.

    Sometimes when an item spawns it will disappear client side but when I will walk to the item location I will pick it up. Is it possible that forge is removing the visibility of the item for some reason?

  5. 3 minutes ago, diesieben07 said:

    I am getting text using .getName().getUnformattedComponentText() however, the server adds § to format the colors, I can't really remove it if I don't have access to how the server displays it.

    Can I compare these two "getUnformattedComponentText" that have some formatting in them?

  6. I am trying to find out if a formatted string is equal to something. When I open the game inside eclipse it works, but when I compile it, it doesn't recognize the § symbol. (my idea is it replaces it with �).

    Can I do something about this? I really need the text with the formatting codes, it is stored inside a string variable.

  7. 13 minutes ago, diesieben07 said:

    Use GLStateManager.color. You might also need RenderHelper.disableStandardItemLighting (and RenderHelper.enableStandardItemLighting after you are done).

     

    Sure.

    Awesome it worked. I am fiddling around trying to figure out how to get the custom chest name. Should it be inside getGui()?

  8. Just now, diesieben07 said:

    You have shown zero of your code.

    ScaledResolution sr = new ScaledResolution(mc);
    	    	String displayGUIText = "This is a place-holder";
    	    	e.getGui().drawString(mc.fontRenderer, displayGUIText, sr.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(displayGUIText) / 2, sr.getScaledHeight() / 2 - 85, 0xFFFFFF);
    	    	

     

    just some basic font render stuff, it's all inside the event listener I sent earlier. (DrawScreenEvent.Post)

  9. I need to add text to the chest window when the name of the chest is equal to something.

    I guess I need an event that fires every tick or so when you are inside a chest, and then render the text somehow above it.

    Are there any good examples of the events I need to use in order to achieve something like this?

  10. Hi, hello.

     

    I need to send a chat message client side only. I do it like so sender.sendMessage(new TextComponentString...

    I would love to know if there is a way of editing the message after it is already sent. Is this possible without rewriting the whole messages GUI class?

×
×
  • Create New...

Important Information

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