Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. that method(or rather that entire class) was depricated since 1.7. It was implemented with net.minecraft.client.resources.I18n.format. Which didn't go anywhere.
  2. As I've said do the same TileEntityItemStackRenderer does - it initializes it's own TE and puts the banner data into it from the ItemStack passed.
  3. The banner model is stored in TileEntityBannerRenderer but it's private. You can copy what that renderer does but with your banner model.
  4. What mapping version are you using? I can't find these methods in the Packet class(es) in any mappings i've tried(default supplied, latest, stable). A fully qualified name of that Packet class would also help since there are 4 and none of them match your description of them. If I were to guess based on this line then it's the size of the internal backing array of the ByteBuffer
  5. drawTexturedModalRect assumes that the size of your texture is 256x256, so you are drawing a rect with the texture coordinates from 0, 0 to 8, 8 px. You would need to either hve a custom implementation or use one of the overloads that allows you to specify the UVs directly.
  6. Start by making a simple mod following the examples and understanding them - they are documented after all(so don't just blindly copy code, actually try to understand what it does), then build upon it, gradually adding more complex features. That's how I would do that anyway.
  7. Well, there are forge's docs which are not a tutorial but are still useful to read when you are having issues https://mcforge.readthedocs.io/en/latest/ In addition there are some modding examples here and there, like @Cadiboo's example mod Also feel free to ask here of course if you are having an issue you can't resolve or something.
  8. Don't use ItemBase, there is already an ItemBase, it's called Item. In fact if you are watching some youtube tutorial I will have to stop you right there since they are all extremely terrible. You are honestly better off learning on your own compared to using them. As for the issue - you are likely using the newer mappings where the method got renamed to setTranslationKey or something along those lines.
  9. This is not how anything works. While blocks execution untill it resolves(as literally any other statement). So not only are you not writing your line each tick(you are writing it as many times a second as your PC can handle actually, whoch explains the size of the log) your loop wouldn't ever exit, so you basically have a while(true) here. All of this is basic java. You MUST use the tick event for this purpose. https://mcforge.readthedocs.io/en/latest/events/intro/
  10. The block, not the item, but yes, either through object holders or through a field. Not a field that statically initializes said block though!
  11. Well, yes, as I've said Same applies to blocks and, well, ANY object. This is basic java.
  12. Thins means that the ItemBlock holds a different instance of the Block compared to the one you've registered.
  13. It would be easiest to do with a one-line stream Pseudo-code: ForgeRegistries.ITEMS.valueCollection().stream().filter(i -> i.getRegistryName().getDomain().equals(MYMODID)).foreach(i -> ModelRegistry.setCustomModelResourceLocation(...))
  14. https://mcforge.readthedocs.io/en/latest/concepts/registries/#injecting-registry-values-into-fields
  15. You don't have to write the value = part, but sure. Just make sure the domain of your mod is provided somehow, either in said value or in the annotation on the class itself https://mcforge.readthedocs.io/en/latest/concepts/registries/#injecting-registry-values-into-fields
  16. If you couldn't cast something to something else then you would crash with a ClassCastException. I think you need to send a packet to the client notifying them that they can fly now. Actually, scratch that, your code will never work if(w.isRemote) { PlayerFlight.setFlight(p, true, sender.getEntityWorld()); } Commands are executed on the server so this condition will always be false thus your flying code will never execute. Also IHasModel is stupid. All items need models, no exceptions, and IHasModel makes you write redundand code a lot(as in you need 3 lines PER ITEM as a bare minimum instead of ONE line and that's it). Register your models directly in the ModelRegistryEvent.
  17. Use the ObjectHolder annotation
  18. Instantinating means creating a new instance. So when you write new Thing(,,,) you are instantinating Thing.
  19. No, you have changed NOTHING. Putting your stuff in an array doesn't change the fact that it is still created in a static initalizer. Instantinate your stuff in the appropriate registry event as I've already said. Not anywhere else.
  20. No, this will crash the game because you are using an instance of Item that isn't in the game.
  21. Just send them whenever the client needs them. You know when they need it. If you have a capability you want to sync then send the packet every time the player logs in or the data changes. In case of the model capability data you would want to send it every time a player started to track another player - grab the other player and send it to the tracking player.
  22. I don't really know hpw to explain this, but basically new ItemExemple("item_exemple") != new ItemExemple("item_exemple"). These are two separate objects. So you are registering the items correctly, and those are the items that are in the game and are interacted with. Then you have these lines that now define a new item that isn't registered and thus isn't actually in game. So as a result using this Will crash the game. However since you MUST use the instance you've registered this Will also crash the game. If you need a reference to your item instances use an ObjectHolder annotation.
  23. No, it still uses static initializers which is bad and you should never do this. Actually go and complain to them that they do this since it may break their mod, may break others's mods, is against forge's guidelines, prevents forge from doing things like reloadable registries and prevents other modders from overriding their items. So yeah, if the mod is popular it doesn't mean it'w code is good. Again, don't ever use static initializers for registry entries. Instantinate your stuff in the registry event directry. This is absolutely fine
  24. https://github.com/MinecraftForge/MinecraftForge/issues/5708
×
×
  • Create New...

Important Information

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