Everything posted by Alpvax
-
[1.14.4]How to make multi collision boxes
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.
-
[Solved][1.14.4] Capability NullPointerException
Sounds like you need to sync the changes to the client when it changes.
-
[Solved][1.14.4] Capability NullPointerException
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.
-
[SOLVED] [1.15.2] Game Rule registration
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.
-
[Solved][1.14.4] Capability NullPointerException
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.
-
[Solved][1.14.4] Capability NullPointerException
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.
-
How to add interface on the main play screen
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.
-
1.14 Saving 3D inventory icons to an image
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.
-
[1.15] How to set direction of fireball?
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)
-
[SOLVED] [1.15.2] Game Rule registration
How would I go about searching for srg names inside my IDE (IDEA)? It sounds far easier than using discord or irc.
-
[1.15.2] Should I use tags for functional features
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).
-
[General] Means of storing data.
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.
-
(SOLVED) [1.14.4] Get Biome of targeted Block
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?
-
[1.15.1] How to get a block from it's position
world.getblockstate(pos).getBlock()
-
(SOLVED) [1.14.4] Get Biome of targeted Block
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.
-
Non loaded world change simulation - best method
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.
-
The attribute modid is undefined for annotation type Mod
@Mod now just takes a modid (i.e. `@Mod(Reference.MODID)`)
-
[1.15.1] Multiple source sets / Bytecode is different than source
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.)
-
[1.15.1] DeferredRegister vs RegistryEvent
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.
-
[1.15.1] DeferredRegister vs RegistryEvent
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.
-
[1.15.1] DeferredRegister vs RegistryEvent
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).
-
[1.14] Dodge move
Where are you calling the method from? It sounds like you are changing it on the client, not the server.
-
[1.14.4]Unable to launch dedicated server [RESOLVED]
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
-
(1.14) Custom IRecipe RecipeManager Help
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)
-
[1.14.3] How to add harvest level to blocks?
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.
IPS spam blocked by CleanTalk.