Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by DavidM

  1. Use the instanceof keyword.
  2. The predicate need to return true if the given Entity matches what you are looking for. In this case, it should return true if the given Entity if a villager.
  3. Something is null at line 41. We need more code to figure out what it is. Either post code as a GitHub repo or find the culprit with the debugger.
  4. 1. Do not name your class with lower cases. The convention is to camel case and capitalize the first letter. 2. Your info method does nothing as of now. You need to override Item#addInformation instead.
  5. Check out GuiContainer#handleMouseClick. Simply iterate through every ItemStack in the opened chest container, and invoke GuiContainer#handleMouseClick with the appropriate slot for each ItemStack.
  6. People other than the author of the mod are not necessarily familiar with the mod. Please report this phenomenon to the author of the mod.
  7. Since the rendering of the player is done by OpenGL in a 3D space, the coordinate is a 3D coordinate in regards to the OpenGL rendering position (in relation to the screen view).
  8. You do have to include it unless the annotation is attached to a class inside the main mod class (which would have the mod ID passed in as a parameter in the @Mod annotation), which is not the case here.
  9. Make a static field that stores the last chat message received. Subscribe to ClientChatReceivedEvent and compare the received message to the last message variable. Cancel the event if they have the same content, else set the last message variable to the received message. I might have misunderstood the question.
  10. Subscribe to RenderPlayeEvent.Post and do your rendering there. The render position of the player is passed in via the event.
  11. setRegistryName takes in a ResourceLocation; you cannot replace it with a class. However, you can register any instance of Block, therefore you could create a new class extending Block.
  12. The mods you install have to implement a config page. Consider asking the mod author about implementing the in-game config page.
  13. Packet handling and the game are on different threads. Therefore, any actions concerning the game should be in a scheduled task (i.e. world manipulation, tile entity manipulation, etc).
  14. This is actually not caused by not enough memory for the OS. Java's garbage collector tend to clear the memory when the allocated RAM is full. If the allocated RAM is little (i.e. 2GB), the clearing would be fast as it only need to clear 2GB, and the delay would be negligible to the user. However, if the allocated RAM is large (i.e. >10GB), then each clearing would take up significant longer time, thus lagging the game.
  15. Both of those are client-only mods and do nothing on a server...
  16. Allocating too much RAM will also cause lag spikes. Most modpacks require around 6GB Ram.
  17. A fake player is not an Entity that can be added to the world. What are you trying to achieve?
  18. Note that you need to install the deobfuscated version of the mod.
  19. SpecialMobs' problem. Remove it and report to its author.
  20. You need to replace the block with your own by overriding it in the block registry.
  21. I am creating a helmet that, when worn, displays the location of nearby dropped items. I would like to create an outline effect similar to the glowing effect of LivingEntity. What is the best way to approach this?
  22. Note that the client can lie about whether an Entity should be rendered. The server should implement some checks to make sure the client's information is in legal range.
  23. The tracking distance determines whether the entity should be rendered at a certain distance. It does not affect aspects like teleportation and explosion.
×
×
  • Create New...

Important Information

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