
querpressverband
Members-
Posts
9 -
Joined
-
Last visited
Everything posted by querpressverband
-
[1.7.10] Getting metadata from Block object
querpressverband replied to querpressverband's topic in Modder Support
Thank you GreyGhost, this is most helpful! Now I also understand block directions (I found some examples where integers were just hardcoded and wondered what meant what). Thank you! -
So this problem persists and I really am extremely puzzled. Here's some code I have @SubscribeEvent public void eventChunkLoad(ChunkEvent.Load event) { Chunk chunk = event.getChunk(); if (chunk == null) { sink.debug("Chunk is null"); return; } if (!chunk.isChunkLoaded) { sink.debug("Chunk " + chunk.xPosition + " / " + chunk.zPosition + " is not loaded (" + chunk.worldObj.getChunkProvider().getLoadedChunkCount() + " loaded chunks)"); return; } And my log shows this: DEBUG: WorldLoad 0 DEBUG: Chunk 12 / 13 is not loaded (1 loaded chunks) DEBUG: Chunk 7 / 16 is not loaded (2 loaded chunks) DEBUG: Chunk 7 / 15 is not loaded (3 loaded chunks) DEBUG: Chunk 7 / 14 is not loaded (4 loaded chunks) DEBUG: Chunk 7 / 13 is not loaded (5 loaded chunks) DEBUG: Chunk 7 / 12 is not loaded (6 loaded chunks) DEBUG: Chunk 7 / 11 is not loaded (7 loaded chunks) DEBUG: Chunk 7 / 10 is not loaded (8 loaded chunks) DEBUG: Chunk 7 / 9 is not loaded (9 loaded chunks) DEBUG: Chunk 7 / 8 is not loaded (10 loaded chunks) DEBUG: Chunk 6 / 16 is not loaded (11 loaded chunks) DEBUG: Chunk 6 / 15 is not loaded (12 loaded chunks) DEBUG: Chunk 6 / 14 is not loaded (13 loaded chunks) DEBUG: Chunk 6 / 13 is not loaded (14 loaded chunks) So apparently the events fire whenever a chunk is loaded, but within that event I cannot access the chunk data (not loaded). The chunk provider however seems to think that all these chunks are loaded (and it increases nicely the loaded chunk count). Does anyone have an idea what might be going on here? As said before, when I test from Eclipse on a SP server this problem is not existent at all! Any help greatly appreciated, Henrik
-
[1.7.10] Getting metadata from Block object
querpressverband replied to querpressverband's topic in Modder Support
Ok, I first thought that passing a Chunk instance to my handler class would be sufficient. I get the Chunk from the OnChunLoad() event. I retrieve it from chunk using event.getChunk(). Not sure where I get the world from (chunk has a chunk.worldObj instance, is that what you meant?). Cheers, Henrik -
[1.7.10] Getting metadata from Block object
querpressverband replied to querpressverband's topic in Modder Support
Aaaaah okay, I was so stuck within searching for a method of the Block class because it said there were methods in the docs. WIth your hint I looked in the Chunk class (of which I extract my block) and sure enough, there is Chunk.getBlockMetadata(x, y, z) which I think does what I want! Thank you very much for the pointer, I was completely blind :-) I would also like to know what the daylight light value of that block is and Chunk seems to offer that, too: Chunk.getBlockLightValue() - but it takes 4 parameters which are undocumented (they're only named p_76629_1_ through p_76629_4_). Is there any way to find out more documentation of this method? If I could find out where the docs to stuff like this is I'd have to ask fewer dumb questions :-) Thank you again so much! Cheers, Henrik -
Hey forum, so another newbie question from me: How does one get the metadata from a block object? I've read the tutorial and it says The problem is, I don't have the world, so I can't use getBlockMetadata. And I can't find a single method of the "many methods" that would return the metadata value. I get the ID by using Block's static method Block.getIdFromBlock(b), but there's no Block.getMetadataFromBlock() equivalent. If you could help me out, that'd be awesome. Thanks a lot! Cheers Henrik
-
Hey forum, so I'm writing my first mod and ran into another problem: I subscibe to eventChunkLoad and determine the surface of the chunks that I get. This works brilliantly in singleplayer (!event.world.isRemote). I can access and dump the data I need for my mod. Then I built a production JAR using "gradlew build", placed it in my MinecraftForge mods/ directory and tried the exact same thing with an MP server. There, it doesn't work, however: eventChunkLoad() gets called, and event.chunk() yields a non-null chunk, but chunk.isChunkLoaded is always false and the chunk doesn't contain any data. If someone could hint me as to what I'm doing wrong I'd greatly appreciate it. Cheers, Henrik
-
Modding help: SP works, MP doesn't
querpressverband replied to querpressverband's topic in Modder Support
Thank you so much! Have an awesome day, Henrik -
Modding help: SP works, MP doesn't
querpressverband replied to querpressverband's topic in Modder Support
Aaaah! I see! Hadn't thought of that at all, thank you a lot. So since I don't want to dev on my remote server, how can I generate a JAR that I can include with my (production) Minecraft installation and drop into the mods/ directory of it? Cheers, Henrik -
Hi forum, I'm getting started with Forge modding and want to start something minimap-like to check out the capabilities of Forge. I've already set up a basic skeleton that calls a hook when a Chunk is loaded (which looks very good so far to me!). That's pretty much what I wanted. But it only works when I do singleplayer. As soon as I try to connect to a MP server, it instantly crashes the game: [23:26:49] [Client thread/INFO] [FML]: Holder lookups applied Starting up SoundSystem... Initializing LWJGL OpenAL (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) OpenAL initialized. [23:26:50] [sound Library Loader/INFO]: Sound engine started [23:26:50] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [23:26:50] [Client thread/INFO]: Created: 256x256 textures/items-atlas [23:26:50] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods [23:26:50] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:ExampleMapper [23:26:50] [Client thread/INFO]: Created: 256x256 textures/items-atlas [23:26:51] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas SoundSystem shutting down... Author: Paul Lamb, www.paulscode.com Starting up SoundSystem... Initializing LWJGL OpenAL (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) OpenAL initialized. [23:26:51] [sound Library Loader/INFO]: Sound engine started [23:26:54] [Client thread/INFO]: Connecting to spornkuller.de, 25565 [23:26:55] [Client thread/FATAL]: Reported exception thrown! net.minecraft.util.ReportedException: Ticking screen at net.minecraft.client.Minecraft.runTick(Minecraft.java:1765) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:961) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_65] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_65] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_65] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_65] at GradleStart.bounce(GradleStart.java:107) [start/:?] at GradleStart.startClient(GradleStart.java:100) [start/:?] at GradleStart.main(GradleStart.java:55) [start/:?] Caused by: java.lang.NullPointerException at com.mojang.util.UUIDTypeAdapter.fromUUID(UUIDTypeAdapter.java:22) ~[uUIDTypeAdapter.class:?] at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:13) ~[uUIDTypeAdapter.class:?] at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:10) ~[uUIDTypeAdapter.class:?] at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) ~[TypeAdapterRuntimeTypeWrapper.class:?] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) ~[ReflectiveTypeAdapterFactory$1.class:?] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) ~[ReflectiveTypeAdapterFactory$Adapter.class:?] at com.google.gson.Gson.toJson(Gson.java:593) ~[Gson.class:?] at com.google.gson.Gson.toJson(Gson.java:572) ~[Gson.class:?] at com.google.gson.Gson.toJson(Gson.java:527) ~[Gson.class:?] at com.google.gson.Gson.toJson(Gson.java:507) ~[Gson.class:?] at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) ~[YggdrasilAuthenticationService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.joinServer(YggdrasilMinecraftSessionService.java:76) ~[YggdrasilMinecraftSessionService.class:?] at net.minecraft.client.network.NetHandlerLoginClient.handleEncryptionRequest(NetHandlerLoginClient.java:62) ~[NetHandlerLoginClient.class:?] at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:54) ~[s01PacketEncryptionRequest.class:?] at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:62) ~[s01PacketEncryptionRequest.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) ~[NetworkManager.class:?] at net.minecraft.client.multiplayer.GuiConnecting.updateScreen(GuiConnecting.java:116) ~[GuiConnecting.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1751) ~[Minecraft.class:?] ... 16 more ---- Minecraft Crash Report ---- // Who set us up the TNT? Time: 31.08.14 23:26 Description: Ticking screen java.lang.NullPointerException: Ticking screen at com.mojang.util.UUIDTypeAdapter.fromUUID(UUIDTypeAdapter.java:22) at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:13) at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:10) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) at com.google.gson.Gson.toJson(Gson.java:593) at com.google.gson.Gson.toJson(Gson.java:572) at com.google.gson.Gson.toJson(Gson.java:527) at com.google.gson.Gson.toJson(Gson.java:507) at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.joinServer(YggdrasilMinecraftSessionService.java:76) at net.minecraft.client.network.NetHandlerLoginClient.handleEncryptionRequest(NetHandlerLoginClient.java:62) at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:54) at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:62) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) at net.minecraft.client.multiplayer.GuiConnecting.updateScreen(GuiConnecting.java:116) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1751) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) at net.minecraft.client.Minecraft.run(Minecraft.java:961) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:55) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.mojang.util.UUIDTypeAdapter.fromUUID(UUIDTypeAdapter.java:22) at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:13) at com.mojang.util.UUIDTypeAdapter.write(UUIDTypeAdapter.java:10) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195) at com.google.gson.Gson.toJson(Gson.java:593) at com.google.gson.Gson.toJson(Gson.java:572) at com.google.gson.Gson.toJson(Gson.java:527) at com.google.gson.Gson.toJson(Gson.java:507) at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.joinServer(YggdrasilMinecraftSessionService.java:76) at net.minecraft.client.network.NetHandlerLoginClient.handleEncryptionRequest(NetHandlerLoginClient.java:62) at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:54) at net.minecraft.network.login.server.S01PacketEncryptionRequest.processPacket(S01PacketEncryptionRequest.java:62) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) at net.minecraft.client.multiplayer.GuiConnecting.updateScreen(GuiConnecting.java:116) -- Affected screen -- Details: Screen name: net.minecraft.client.multiplayer.GuiConnecting Stacktrace: at net.minecraft.client.Minecraft.runTick(Minecraft.java:1751) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) at net.minecraft.client.Minecraft.run(Minecraft.java:961) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:55) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Linux (amd64) version 3.13.0-24-generic Java Version: 1.7.0_65, Oracle Corporation Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 973478120 bytes (928 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available ExampleMapper{0.01} [ExampleMapper] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GTX 660/PCIe/SSE2 GL version 4.4.0 NVIDIA 331.38, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. 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) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1) #@!@# Game crashed! Crash report saved to: #@!@# /home/henrik/mcforge/forge/eclipse/./crash-reports/crash-2014-08-31_23.26.55-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Here's the basic mod code package com.examplemapper; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @Mod(modid = ExampleMapperMod.MODID, version = ExampleMapperMod.VERSION) public class ExampleMapperMod { public static final String MODID = "ExampleMapper"; public static final String VERSION = "0.01"; @Instance(ExampleMapperMod.MODID) public static ExampleMapperMod instance; @SidedProxy(clientSide = "com.examplemapper.ClientProxy", serverSide = "com.examplemapper.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.preInit(event.getSuggestedConfigurationFile()); } @EventHandler public void load(FMLInitializationEvent event) { proxy.load(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(); } } where the CommonProxy code is completely empty and the ClientProxy code just registeres my event handling class to the MinecraftForge.EVENT_BUS. A side note: I cannot seem to find the JAR that is built for my mod. If I want to make a release, where would I find it? Thanks for your help, Henrik