• Posts

    • please don't give up on me, I want to learn this.
    • Another method to use is BlockPattern private BlockPattern pattern = FactoryBlockPattern.start().aisle( "010", "020", "030") .where('1', BlockWorldState.hasState(BlockStateMatcher.forBlock(ModBlocks.Block1))) .where('2', BlockWorldState.hasState(BlockStateMatcher.forBlock(ModBlocks.Block2))) .where('3', BlockWorldState.hasState(BlockStateMatcher.forBlock(ModBlocks.Block3))) .where('0', BlockWorldState.hasState(BlockStateMatcher.ANY)).build(); It searches in a variable radius around your center block (in this case, Block2) to find other blocks defined in your pattern.
    • Unfortunately there's no method you can use to scan the nearby area for blocks, but you can get the IBlockState at a given BlockPos with World#getBlockState, and use nested for loops to check all positions within a cube. If you want to check in a sphere, you could use the cube method but then continue whenever the BlockPos is further than the radius away.
    • When I try to run this simple mod that adds one item with a item texture, the game crashes shortly after Minecraft begins loading. It didn't do this before I tried to add the texture. My code: https://github.com/FabulousAmpharos/ModTutorial/tree/master/myfirstmod I followed McJty's tutorial. The crashlog:  java.lang.NullPointerException: null     at com.example.rubymod.ModItems.initModels(ModItems.java:16) ~[ModItems.class:?]     at com.example.rubymod.proxy.ClientProxy.registerModels(ClientProxy.java:37) ~[ClientProxy.class:?]     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_ClientProxy_registerModels_ModelRegistryEvent.invoke(.dynamic) ~[?:?]     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]     at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) ~[EventBus$1.class:?]     at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?]     at net.minecraftforge.fml.client.FMLClientHandler.fireSidedRegistryEvents(FMLClientHandler.java:1062) [FMLClientHandler.class:?]     at net.minecraftforge.fml.common.FMLCommonHandler.fireSidedRegistryEvents(FMLCommonHandler.java:764) [FMLCommonHandler.class:?]     at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629) [Loader.class:?]     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?]     at net.minecraft.client.Minecraft.init(Minecraft.java:513) [Minecraft.class:?]     at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]     at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221]     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221]     at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]     at GradleStart.main(GradleStart.java:25) [start/:?] Time: 9/18/19 5:04 PM Description: Initializing game java.lang.NullPointerException: Initializing game     at com.example.rubymod.ModItems.initModels(ModItems.java:16)     at com.example.rubymod.proxy.ClientProxy.registerModels(ClientProxy.java:37)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_ClientProxy_registerModels_ModelRegistryEvent.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.fml.client.FMLClientHandler.fireSidedRegistryEvents(FMLClientHandler.java:1062)     at net.minecraftforge.fml.common.FMLCommonHandler.fireSidedRegistryEvents(FMLCommonHandler.java:764)     at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)     at net.minecraft.client.Minecraft.init(Minecraft.java:513)     at net.minecraft.client.Minecraft.run(Minecraft.java:421)     at net.minecraft.client.main.Main.main(Main.java:118)     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)     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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)     at GradleStart.main(GradleStart.java:25) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace:     at com.example.rubymod.ModItems.initModels(ModItems.java:16)     at com.example.rubymod.proxy.ClientProxy.registerModels(ClientProxy.java:37)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_ClientProxy_registerModels_ModelRegistryEvent.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.fml.client.FMLClientHandler.fireSidedRegistryEvents(FMLClientHandler.java:1062)     at net.minecraftforge.fml.common.FMLCommonHandler.fireSidedRegistryEvents(FMLCommonHandler.java:764)     at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)     at net.minecraft.client.Minecraft.init(Minecraft.java:513) -- Initialization -- Details: Stacktrace:     at net.minecraft.client.Minecraft.run(Minecraft.java:421)     at net.minecraft.client.main.Main.main(Main.java:118)     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)     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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)     at GradleStart.main(GradleStart.java:25) -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_221, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 408599464 bytes (389 MB) / 710410240 bytes (677 MB) up to 3791650816 bytes (3616 MB)     JVM Flags: 0 total;      IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2768 5 mods loaded, 5 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State | ID         | Version      | Source                           | Signature |     |:----- |:---------- |:------------ |:-------------------------------- |:--------- |     | UCH   | minecraft  | 1.12.2       | minecraft.jar                    | None      |     | UCH   | mcp        | 9.42         | minecraft.jar                    | None      |     | UCH   | FML        | 8.0.99.99    | forgeSrc-1.12.2-14.23.5.2768.jar | None      |     | UCH   | forge      | 14.23.5.2768 | forgeSrc-1.12.2-14.23.5.2768.jar | None      |     | UCH   | examplemod | 0.0.0.0.1    | main                             | None      |     Loaded coremods (and transformers):      GL info: ' Vendor: 'Intel' Version: '4.4.0 - Build 21.20.16.4550' Renderer: 'Intel(R) HD Graphics 620'     Launched Version: 1.12.2     LWJGL: 2.9.4     OpenGL: Intel(R) HD Graphics 620 GL version 4.4.0 - Build 21.20.16.4550, Intel     GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported.     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fml,forge'     Type: Client (map_client.txt)     Resource Packs:      Current Language: English (US)     Profiler Position: N/A (disabled)     CPU: 4x Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
    • How would I do that , not sure how to Check in a radius
  • Topics

  • Who's Online (See full list)