Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. You need to fetch the color stored in your TE, since you can't store enough in the metadata.
  2. You can't apply an offset to the texture. You can either have a custom model with your desired offset or a texture that has said offset. If you want your item animated in the process you can either use multiple textures like minecraft's bow does it or use forge's animation api.
  3. You would need a TESR for that, in that TESR chack the distance to the client's player and render it if the distance is less than the distance you want. And yes, you can render a BakedModel in a FastTESR.
  4. It can't because you have a syntax error that you've posted. From the looks of the error you are passing wrong arguments to the method. See the method parameters and pass what it wants.
  5. Yes. What is the mysterious "it"? The compiler? The IDE? The game? If it's the first two then you should be able to fix it, since it's just a compile error and those are easily fixable with some java knowledge. If it's the latter then post the error log.
  6. You are not including the color in your state here. What is your issue? Are item textures not there? Or those of blocks? If it's blocks then see above, otherwise you need to show how you are registering models for your itemblocks.
  7. You can't store information that is per itemstack in item fields since items are singletons. First of all the second parameter in NBTTagCompound#getTagList is not it's limit, it's the type of tag in said list. Second of all you need to account for a case where the list is not present in the tag, or the stack has no tag at all. Currently your list will be null in 2/3 cases. wasn't your point to store the dragon's UUID in a list? Why are you storing it in the item's tag? You are also not storing the list in the tag, so this Which you first need to initialize a lot like you do your nbt variable. is still the case.
  8. WorldServer#getEntityFromUuid
  9. Why are you using WorldSavedData? AFAIK that's one per minecraft save file. If you want one per dimension use capabilities.
  10. Did you set up your repository? We would need to look at your code and the blockstates/model file to see what's wrong.
  11. These reasons are the reasons I told you to use the share tag mechanics to sync your capabilities.
  12. I would advise to use the share tag mechanics, but if you absolutely must use packets here is a guide.
  13. https://github.com/V0idWa1k3r/ExPetrum/blob/master/src/main/java/v0id/api/exp/data/ExPRegistryNames.java It's just a collection of strings that are made into ResourceLocations on demand.
  14. This question answers itself. You do so by instantinating the SoundEvent first, then the SoundType. I don't think I could explain this in a more obvious way, sorry.
  15. No, the cause of the crash is because the object is instantinated before your sound event is. It can be static all you want, it's the instantination that matters. Hence the name - static initializer. That is correct. The proxy in your case is useless but in general case it isn't, you are just doing it wrong. Don't use a CommonProxy, use an interface, like an IProxy as the official docs tell you to do.
  16. To register custom sounds you also need a sounds.json in your assets/modid folder like I do here. You can read up on it's format more here, on the official minecraft wiki. You will of course need to register the SoundEvent within the appropriate RegistryEvent similar to how I do here. Make sure your registry name matches the one you have given to the sound in the sounds.json file. To actually obtain a reference to your SoundEvent to use it later(to play it for example) you would use ObjectHolders like I do here. After that you should be able to play your sound just fine similar to how I do here. As for your repo: Don't do this. Use the registry provided to you by the event. https://github.com/wsman217/Learning-Mod/blob/master/src/main/java/com/wsman217/learningmod/init/ModBlocks.java#L15 https://github.com/wsman217/Learning-Mod/blob/master/src/main/java/com/wsman217/learningmod/init/ModItems.java#L40 Don't use static initializers. Instantinate your stuff directly in the appropriate RegistryEvent. https://github.com/wsman217/Learning-Mod/blob/master/src/main/java/com/wsman217/learningmod/blocks/BlockBase.java BlockBase/ItemBase/XBase is an antipattern. There is already a BlockBase, it's called Block. https://github.com/wsman217/Learning-Mod/blob/master/src/main/java/com/wsman217/learningmod/proxy/CommonProxy.java CommonProxy makes no sense. Proxies exist to separate sided-only code. If your code is common it goes anywhere but your proxy. This makes even less sense. A server proxy provides noop implementations for client-only methods or invokes methods that would crash the physical client. A common proxy by definition can't be your server proxy. https://github.com/wsman217/Learning-Mod/blob/master/src/main/java/com/wsman217/learningmod/util/IHasModel.java IHasModel is stupid. All items need models, no exception, and nothing about model registration requires access to private/protected data. Register your models in the ModelRegistryEvent directly. https://github.com/wsman217/Learning-Mod/blob/master/src/main/java/com/wsman217/learningmod/sounds/SoundTypes.java#L13 And here is the cause of your issue - the dreaded static initializers. By the time this is constructed your SoundEvent is still null, hence your crash.
  17. 1.7.10 is no longer supported on this forum. Update to a modern version of minecraft to receive support.
  18. Entity tracking is the process of sending entity data to the clients who need it(as in are in range of the entity defined within the tracker method). EntityDataManager is responsible for syncing the data to the clients. You can add your own data to sync for your entity via a usage of DataParameters. updateFrequency is the frequency at which the data is sent to the client. sendVelocityUpdates is self-explaining.
  19. First of all NEVER EVER register things like this. If you have to access the registry directly then you are doing something VERY wrong. Use the appropriate RegistryEvent.Register<T> event and use the registry provided to you in that event. Second of all this is not enough information for the EntityEntry. You at the very least also need to provide the tracker data and the registry name/ID. Thirdly don't construct EntityEntries directly. Use EntityEntryBuilder. Your entity doesn't exist on the client because you didn't register it correctly.
  20. Considering that you need to do this on client only the best course of action would be to set the value of GameSettings.keyBindDrop field to your custom implementation that returns false when needed in KeyBinding#isPressed.
  21. You need to provide some of your code so we can help you. Ideally you would provide a github of your mod but at the very least the renderer class, the method where the renderer is registered and the method where the entity is spawned would suffice with us likely asking for more relevant information later. Judging by the fact that the entity is invisible likely the problem lies in your renderer, or, alternatively the entity isn't spawned and thus simply doesn't exist in the world but without any code I can't say much more.
  22. A property for an Item? Why? Don't use raw types. ICapabilitySerializable is generic, so you need to specify the type. As for the issue: Capabilities on items are not synced to the client by default. If you wish to sync them you need to either use packets or override Item#getNBTShareTag and write your synced data there and Item#readNBTShareTag to read the data. I am not too sure why the values are updated on the client after relogging though, I guess forge sends the initial capability data to the client too. If you don't want the data to persist at all don't implement ICapabilitySerializable.
  23. Obviously not as you can't store anything per instance of ItemStack in a field in an Item class since items are singletons. NBTUtil.createUUIDTag/NBTUtil.getUUIDFromTag
×
×
  • Create New...

Important Information

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