Jump to content

Alpvax

Members
  • Posts

    304
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Alpvax

  1. Look at VoxelShapes.or for multiple shapes at once. There is a getShape for if you want to override the selection shape as well as the collision shape.
  2. Sounds like you need to sync the changes to the client when it changes.
  3. This is not how you should add capabilities to your own items, you should override IForgeItem#initCapabilities: @Nullable @Override public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) { return new IMultitool.Provider(); } I can't really tell from the snippets you have posted, do you have a git repository? Use your IDE to set breakpoints to try and find what is actually null when that function is called.
  4. Yes, that's what I'm going to continue to do. I misunderstood the following: to mean that the currently used mappings were available by default somewhere in my IDE.
  5. class Provider implements ICapabilityProvider { private Supplier<IMultitool> multitoolSup; Provider() { this(() -> Capabilities.MULTITOOL_CAPABILITY.getDefaultInstance()); } Provider(Supplier<IMultitool> sup) { multitoolSup = sup; } private LazyOptional<IMultitool> capability = LazyOptional.of(() -> multitoolSup.get()); @Nonnull @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { return cap == Capabilities.MULTITOOL_CAPABILITY ? capability.cast() : LazyOptional.empty(); } } I had the advantage that my capability currently just acts as a flag, so I don't care about storing it for later use (i.e. I can just create a new instance every time with no issues). You will probably want to save the value of `supplier.get()` if you interact with it outside of the LazyOptional.
  6. I discovered with my mod that due to the order of class loading (item registration depending on the ItemGroup from my main class) my initCapabilities method was being called before my capability instance was set, so it was attempting to call null.getDefaultInstance and throwing the error. I resolved the issue by wrapping it in an additional supplier, so the capability was definitely set by the time it was used.
  7. No, it's a bump. You need to render your custom interface in the RenderGameOverlayEvent.Post (So it is displayed in front of anything else on the screen). You also need to make sure you only listen to one of the events (see RenderGameOverlayEvent.ElementType) to prevent rendering it multiple times per frame.
  8. What are you trying to accomplish? The textures are available as individual .png files in your modding environment, for the rest you will have to render the models with the inventory variant. However, all of the assets are Mojang's property, so I'm not sure what you are planning on doing with them.
  9. The look vector is a vector (with a length/magnitude of 1) pointing in the direction the entity is looking. So the direction/velocity of your fireball should be a multiple of that vector, and the start position should be the player eye position, plus part of the look vector (to spawn just in front of the player, instead of inside it's face)
  10. How would I go about searching for srg names inside my IDE (IDEA)? It sounds far easier than using discord or irc.
  11. The only argument I have seen for not using tags is within forge itself, and is due to it having to retain vanilla compatibility (the tags wouldn't exist on the vanilla side). I personally use tags as much as possible for my interaction, as it allows compatibility to be added between mods far easier (just add to the tag).
  12. What is your data structure / why is it not compatible with NBT? You would need to make sure you load/save it at all the appropriate times. What would lead to incompatibility, if it is your own internal data it shouldn't matter.
  13. Are you sure that you are getting the correct BlockPos? You are searching with up to a 20 block range. What happens if the BlockPos is null?
  14. If you are trying to get the position of a block outside of the reach distance, you need to perform a raytrace to find that block position.
  15. You should be able to use the chunk load event. You can save the last ash amount to a chunk capability, and if that amount is less than the world ash amount, update it.
  16. @Mod now just takes a modid (i.e. `@Mod(Reference.MODID)`)
  17. I have found that every time I update my mappings it seems to restore all the source sets. It's a minor annoyance, but not the end of the world. (Just in case someone wants more info for debugging.)
  18. I am well aware of that. My issue is that I don't feel that I know enough about it to start explaining it to others (I haven't yet looked into how you would use RegistryObject for example). I would prefer that someone who knows how to use it write it, then I could learn from that.
  19. True, but there is absolutely no mention of it in the documentation. Most modders wouldn't know to look at the javadoc of a class which they haven't heard of. Either way, this is now off-topic.
  20. I have seen references to the DeferredRegister in the test mods, but it is only today that I actually started looking into how it works. The documentation makes absolutely no mention of it at all (admittedly most of the documentation is not up to date). Would be nice if someone who understood it more could update the docs and preferably give an example (I didn't know that it sort of replaced ObjectHolder fields).
  21. Where are you calling the method from? It sounds like you are changing it on the client, not the server.
  22. Server output and log files: https://gist.github.com/Alpvax/1a9f43056150afd81e3223c802d8974c Java: 1.8.0_222 (Oracle) Forge: 28.0.14, for MC 1.14.4 Error: "Can not hotload overworld. This must be loaded at all times by main Server." No mods installed, fresh install (accepted eula, but otherwise as-installed). Does anyone have any suggestions? EDIT: After a reboot, everything started to work. Presumably it was the result of java not closing properly on a previous run
  23. You haven't actually registered your recipeSerializer. @ObjectHolder is just a reference to the registered serializer, it doesn't register anything. You need to subscribe to the registry event (Just like you do for items/blocks)
  24. Sounds like you don't know Java. If that's the case, go and learn it first. Your block constructor is the thing that you call with new in front of it.
×
×
  • Create New...

Important Information

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