Jump to content

Dnomyar96

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Dnomyar96

  1. Forge's documentation has an introduction to blockstates here. Use your IDE to find the subclasses of net.minecraftforge.fml.common.eventhandler.Event . First of all, your answer helped a lot. However I'm still having some trouble. I replaced the event.block with event.state.getBlock(). However I can't figure out how to get the coordinates of the block (what currently is event.x etc). Any chance you can help me with that? EDIT: I noticed a getBlockBoundsMaxX() (also for Y, Z and min) method. Does that have anything to do with it? Not event state.getBlock() but event .getState().getBlock() If I do that I get an error saying that it's undefinded for the type BlockEvent.BreakEvent. Eclipse says that the way to fix it is to cast event, but what should I cast it to? It doesn't seem to have a direct BlockPos field. But as for the above, it says I should cast event.
  2. Forge's documentation has an introduction to blockstates here. Use your IDE to find the subclasses of net.minecraftforge.fml.common.eventhandler.Event . First of all, your answer helped a lot. However I'm still having some trouble. I replaced the event.block with event.state.getBlock(). However I can't figure out how to get the coordinates of the block (what currently is event.x etc). Any chance you can help me with that? EDIT: I noticed a getBlockBoundsMaxX() (also for Y, Z and min) method. Does that have anything to do with it?
  3. Forge's documentation has an introduction to blockstates here. Use your IDE to find the subclasses of net.minecraftforge.fml.common.eventhandler.Event . Thanks! That should help.
  4. Thanks for the answer! Could you maybe explain it a bit more or give me link to where it is explained? Also, a bit off topic, but is there any place where I can see all events? I tried googling but can't seem to find anything. (as in some kind of documentation)
  5. Hi all, I just started learning to mod minecraft with the help of a book (Minecraft modding with Forge). In that book there is an example which should make Diamond ore blocks explode. I have the following code: package org.devoxx4kids.forge.mods; import net.minecraft.init.Blocks; import net.minecraftforge.event.world.BlockEvent.BreakEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class DiamondOreTrap { @SubscribeEvent public void explode(BreakEvent event) { if(event.block != Blocks.diamond_ore) { return; } event.world.createExplosion(null, event.x, event.y, event.z, 10, true); } } At event.block I get an error stating "block cannot be resolved or is not a field." The same goes for event.x, event.y and event.z. Am I doing something wrong here? Any help is appreciated.
  6. Hello everyone, So I just downloaded the Custom NPC mod for minecraft 1.7.10. Whenever I try to create a new world or load a world, I get the "Loading World" thing from minecraft and after that the game crashes for me. I tried using the latest Forge version for 1.7.10 as well as the recommended. I'm not using any other mods. EDIT: I'm using the 1.7.10 version because I want to play with some other mods as well (chisel, railcraft, carpenter's blocks and bibliocraft). EDIT2: I just tried it only using Carpenter's Blocks and it also didn't work. So it's probably a problem with forge or java and not this mod. SOLUTION: I did a clean install of minecraft and forge. After that it worked just fine. Any help is appreciated. My crash repport: [embed=425,349]---- Minecraft Crash Report ---- // Quite honestly, I wouldn't worry myself about that. Time: 6-7-16 10:35 Description: Unexpected error java.lang.IndexOutOfBoundsException at java.nio.Buffer.checkIndex(Unknown Source) at java.nio.DirectIntBufferU.get(Unknown Source) at net.minecraft.client.renderer.RenderGlobal.func_72712_a(RenderGlobal.java:350) at net.minecraft.client.renderer.RenderGlobal.func_72732_a(RenderGlobal.java:294) at net.minecraft.client.Minecraft.func_71353_a(Minecraft.java:2216) at net.minecraft.client.Minecraft.func_71403_a(Minecraft.java:2146) at net.minecraft.client.network.NetHandlerPlayClient.func_147282_a(NetHandlerPlayClient.java:240) at net.minecraft.network.play.server.S01PacketJoinGame.func_148833_a(SourceFile:70) at net.minecraft.network.play.server.S01PacketJoinGame.func_148833_a(SourceFile:13) at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:2061) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898) at net.minecraft.client.main.Main.main(SourceFile:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at java.nio.Buffer.checkIndex(Unknown Source) at java.nio.DirectIntBufferU.get(Unknown Source) at net.minecraft.client.renderer.RenderGlobal.func_72712_a(RenderGlobal.java:350) at net.minecraft.client.renderer.RenderGlobal.func_72732_a(RenderGlobal.java:294) at net.minecraft.client.Minecraft.func_71353_a(Minecraft.java:2216) at net.minecraft.client.Minecraft.func_71403_a(Minecraft.java:2146) at net.minecraft.client.network.NetHandlerPlayClient.func_147282_a(NetHandlerPlayClient.java:240) at net.minecraft.network.play.server.S01PacketJoinGame.func_148833_a(SourceFile:70) at net.minecraft.network.play.server.S01PacketJoinGame.func_148833_a(SourceFile:13) at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) -- Affected level -- Details: Level name: MpServer All players: 0 total; [] Chunk stats: MultiplayerChunkCache: 0, 0 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (8,64,, Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 0 game time, 0 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 0 total; [] Retry entities: 0 total; [] Server brand: ~~ERROR~~ NullPointerException: null Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:373) at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2444) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:927) at net.minecraft.client.main.Main.main(SourceFile:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.7.0_79, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 132491096 bytes (126 MB) / 374988800 bytes (357 MB) up to 1060372480 bytes (1011 MB) JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAA Forge{10.13.4.1558} [Minecraft Forge] (forge-1.7.10-10.13.4.1558-1.7.10.jar) UCHIJAAAA customnpcs{1.7.10d} [CustomNpcs] (CustomNPCs_1.7.10d(21feb16).jar) GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 368.39' Renderer: 'GeForce GTX 970/PCIe/SSE2' Launched Version: 1.7.10-Forge10.13.4.1558-1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GTX 970/PCIe/SSE2 GL version 4.5.0 NVIDIA 368.39, 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)[/embed]
×
×
  • Create New...

Important Information

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