-
Posts
1773 -
Joined
-
Last visited
-
Days Won
61
Everything posted by V0idWa1k3r
-
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.
-
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
-
[1.13.2] drawTexturedModalRect() not working in GuiScreen
V0idWa1k3r replied to RainbowLuigi281's topic in Modder Support
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. -
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.
-
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.
-
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/
-
The block, not the item, but yes, either through object holders or through a field. Not a field that statically initializes said block though!
-
Well, yes, as I've said Same applies to blocks and, well, ANY object. This is basic java.
-
Thins means that the ItemBlock holds a different instance of the Block compared to the one you've registered.
-
[Solved] RenderLayer not rendering on multiplayer
V0idWa1k3r replied to Oscarita25's topic in Modder Support
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(...)) -
https://mcforge.readthedocs.io/en/latest/concepts/registries/#injecting-registry-values-into-fields
-
[Solved] RenderLayer not rendering on multiplayer
V0idWa1k3r replied to Oscarita25's topic in Modder Support
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 -
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.
-
[Solved] RenderLayer not rendering on multiplayer
V0idWa1k3r replied to Oscarita25's topic in Modder Support
Use the ObjectHolder annotation -
[Solved] RenderLayer not rendering on multiplayer
V0idWa1k3r replied to Oscarita25's topic in Modder Support
Instantinating means creating a new instance. So when you write new Thing(,,,) you are instantinating Thing. -
[Solved] RenderLayer not rendering on multiplayer
V0idWa1k3r replied to Oscarita25's topic in Modder Support
Yep -
[Solved] RenderLayer not rendering on multiplayer
V0idWa1k3r replied to Oscarita25's topic in Modder Support
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. -
No, this will crash the game because you are using an instance of Item that isn't in the game.
-
[Solved] RenderLayer not rendering on multiplayer
V0idWa1k3r replied to Oscarita25's topic in Modder Support
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. -
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.
-
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