Structure Procedure Crash

Published by morlanjo on
Status
Fixed
Issue description

I created a block with a right click action, to run this procedure: https://imgur.com/a/AQRO2Up

The structure I have imported works if I create it as a structure spawn, but if I try right clicking the block I crash.

---- Minecraft Crash Report ----
// I let you down. Sorry :(

Time: 12/13/19 12:32 PM
Description: Unexpected error

java.lang.ClassCastException: net.minecraft.client.world.ClientWorld cannot be cast to net.minecraft.world.server.ServerWorld
    at net.mcreator.mc_arpg.MCreatorMcarpgdungeongenerateproc.executeProcedure(MCreatorMcarpgdungeongenerateproc.java:41) ~[main/:?] {re:classloading}
    at net.mcreator.mc_arpg.MCreatorTest$CustomBlock.onBlockActivated(MCreatorTest.java:63) ~[main/:?] {re:classloading}
    at net.minecraft.block.BlockState.onBlockActivated(BlockState.java:296) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading}
    at net.minecraft.client.multiplayer.PlayerController.func_217292_a(PlayerController.java:299) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1286) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:1544) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1377) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:904) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:384) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222] {}
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:101) [forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {}

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
    at net.mcreator.mc_arpg.MCreatorMcarpgdungeongenerateproc.executeProcedure(MCreatorMcarpgdungeongenerateproc.java:41)
    at net.mcreator.mc_arpg.MCreatorTest$CustomBlock.onBlockActivated(MCreatorTest.java:63)
    at net.minecraft.block.BlockState.onBlockActivated(BlockState.java:296)
    at net.minecraft.client.multiplayer.PlayerController.func_217292_a(PlayerController.java:299)
    at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1286)
    at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:1544)

-- Affected level --
Details:
    All players: 1 total; [ClientPlayerEntity['Dev'/323, l='MpServer', x=-203.90, y=63.00, z=-86.13]]
    Chunk stats: Client Chunk Cache: 169, 81
    Level dimension: DimensionType{minecraft:overworld}
    Level name: MpServer
    Level seed: 0
    Level generator: ID 00 - default, ver 1. Features enabled: false
    Level generator options: {}
    Level spawn location: World: (-208,63,-87), Chunk: (at 0,3,9 in -13,-6; contains blocks -208,0,-96 to -193,255,-81), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
    Level time: 193 game time, 193 day time
    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
    Server brand: forge
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.world.ClientWorld.fillCrashReport(ClientWorld.java:425)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:1824)
    at net.minecraft.client.Minecraft.run(Minecraft.java:405)
    at net.minecraft.client.main.Main.main(Main.java:128)
    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.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:101)

-- System Details --
Details:
    Minecraft Version: 1.14.4
    Minecraft Version ID: 1.14.4
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_222, BellSoft
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode),
    Memory: 1085190256 bytes (1034 MB) / 2102394880 bytes (2005 MB) up to 3808428032 bytes (3632 MB)
    CPUs: 12
    JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
    ModLauncher: 4.1.0+62+5bfa59b
    ModLauncher launch target: fmluserdevclient
    ModLauncher naming: mcp
    ModLauncher services:
        /eventbus-1.0.0-service.jar eventbus PLUGINSERVICE
        /forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-launcher.jar object_holder_definalize PLUGINSERVICE
        /forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-launcher.jar runtime_enum_extender PLUGINSERVICE
        /accesstransformers-1.0.1-milestone.0.1+94458e7-shadowed.jar accesstransformer PLUGINSERVICE
        /forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-launcher.jar capability_inject_definalize PLUGINSERVICE
        /forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-launcher.jar runtimedistcleaner PLUGINSERVICE
        /forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-launcher.jar fml TRANSFORMATIONSERVICE
    FML: 28.1
    Forge: net.minecraftforge:28.1.104
    FML Language Providers:
        javafml@28.1
        minecraft@1
    Mod List:
        client-extra.jar Minecraft {minecraft@1.14.4 DONE}
        forge-1.14.4-28.1.104_mapped_snapshot_20190719-1.14.3-recomp.jar Forge {forge@28.1.104 DONE}
        main mc_arpg {mc_arpg@1.0.0 DONE}
    Launched Version: MOD_DEV
    LWJGL: 3.2.2 build 10
    OpenGL: GeForce GTX 1070/PCIe/SSE2 GL version 4.6.0 NVIDIA 436.30, NVIDIA Corporation
    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 'forge'
    Type: Client (map_client.txt)
    Resource Packs:
    Current Language: English (US)
    CPU: 12x AMD Ryzen 5 1600 Six-Core Processor

 

Issue comments