Started by
Dary
on
Topic category: Advanced modding
Hello,
I'm trying to create slab like in vanilla minecraft.When I tried to modify slab class to extend .BlockSlab it doesn't compile:
C:\Users\Dary\MCreatorWorkspaces\travelers_dream_blocks\build\sources\main\java\net\mcreator\travelers_dream_blocks\MCreatorSlabAlter.java:59: error: BlockCustom is not abstract and does not override abstract method getTypeForItem(ItemStack) in BlockSlab
public static class BlockCustom extends BlockSlab {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
When I made some changes, this log and the next ones asked me (mostly changing some static to abstract etc) to make it built without showing any errors,the client shut up on initialization silently.I exported .jar and tested in other client and it crashes with that:
PM
Description: Initializing game
java.lang.NullPointerException: Initializing game
at net.mcreator.travelers_dream_blocks.MCreatorSlabAlter.lambda$initElements$0(MCreatorSlabAlter.java:43)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:545)
at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:438)
at net.mcreator.travelers_dream_blocks.travelers_dream_blocks.registerItems(travelers_dream_blocks.java:92)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_261_travelers_dream_blocks_registerItems_Register.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:807)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:628)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
slab class:
* that class is after adding import and extending BlockSlab, but before any other changes, which I did without any understanding))
There is a lot to do to override vanilla slab. We would add support for them if we had it figured out but we did not yet.
Thank you for the reply!