Jump to content

Recommended Posts

Posted (edited)

I just recently installed Forge version 1.12.2 and have been putting together a modded server for my friends and I to play on. I got all the mods I wanted on the server and the server launches and runs just fine. However, I haven't been able to connect to the server because when I launch my Minecraft launcher with my Forge 1.12 profile, it crashes on the Mojang loading screen every time. It crashes after it has constructed and initialized all the mods and just when it starts loading the Model Manager. It always gives me the error message "Error: java.lang.NullPointerException: Initializing game". I have 45 mods on my Forge profile, the exact same amount I have on the server that runs just fine, so they must all be compatible. I have taken out a couple of the big mods, including Biomes O' Plenty (Many forum threads on errors similar to this that I have seen are resolved by removing Biomes O' Plenty), to test if they were the problem but the launcher always crashes at the exact same point during start up. I have also tried launching with LiteLoader and Forge together but I get the same exact problem. I will paste the crash report below and any help on this subject would be greatly appreciated!

Spoiler


---- Minecraft Crash Report ----

WARNING: coremods are present:
  Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)
  MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.1.177.jar)
  BCModPlugin (backpacks+1.12.2+-+3.5.0.jar)
Contact their authors BEFORE contacting forge

// My bad.

Time: 5/22/18 3:14 PM
Description: Initializing game

java.lang.NullPointerException: Initializing game
    at biomesoplenty.common.handler.LeavesModelEventHandler$ModelLeaves.<init>(LeavesModelEventHandler.java:61)
    at biomesoplenty.common.handler.LeavesModelEventHandler.onModelBake(LeavesModelEventHandler.java:52)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_250_LeavesModelEventHandler_onModelBake_ModelBakeEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
    at net.minecraftforge.client.ForgeHooksClient.onModelBake(ForgeHooksClient.java:386)
    at net.minecraft.client.renderer.block.model.ModelManager.func_110549_a(ModelManager.java:30)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:121)
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:512)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377)
    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:483)
    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 --
Thread: Client thread
Stacktrace:
    at biomesoplenty.common.handler.LeavesModelEventHandler$ModelLeaves.<init>(LeavesModelEventHandler.java:61)
    at biomesoplenty.common.handler.LeavesModelEventHandler.onModelBake(LeavesModelEventHandler.java:52)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_250_LeavesModelEventHandler_onModelBake_ModelBakeEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
    at net.minecraftforge.client.ForgeHooksClient.onModelBake(ForgeHooksClient.java:386)
    at net.minecraft.client.renderer.block.model.ModelManager.func_110549_a(ModelManager.java:30)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:121)
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:512)

-- Initialization --
Details:
Stacktrace:
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377)
    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:483)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_25, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 2353036968 bytes (2244 MB) / 3976200192 bytes (3792 MB) up to 8589934592 bytes (8192 MB)
    JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.3.2655 Optifine OptiFine_1.12.2_HD_U_D3 45 mods loaded, 45 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                | forge-1.12.2-14.23.3.2655.jar                   | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | UCH   | forge               | 14.23.3.2655             | forge-1.12.2-14.23.3.2655.jar                   | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | UCH   | micdoodlecore       |                          | minecraft.jar                                   | None                                     |
    | UCH   | appliedenergistics2 | rv5-stable-11            | appliedenergistics2-rv5-stable-11.jar           | None                                     |
    | UCH   | backpacks16840      | 3.5.0                    | backpacks+1.12.2+-+3.5.0.jar                    | None                                     |
    | UCH   | baubles             | 1.5.2                    | Baubles-1.12-1.5.2.jar                          | None                                     |
    | UCH   | biomesoplenty       | 7.0.1.2384               | BiomesOPlenty-1.12.2-7.0.1.2384-universal.jar   | None                                     |
    | UCH   | buildcraftlib       | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftcore      | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftbuilders  | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftenergy    | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftfactory   | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftrobotics  | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcrafttransport | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftsilicon   | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | chisel              | MC1.12.2-0.2.0.31        | Chisel-MC1.12.2-0.2.0.31.jar                    | None                                     |
    | UCH   | codechickenlib      | 3.1.8.341                | CodeChickenLib-1.12.2-3.1.8.341-universal.jar   | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
    | UCH   | redstoneflux        | 2.0.1                    | RedstoneFlux-1.12-2.0.1.2-universal.jar         | d4f1503fbacd9b9fb767720420c5395104239ec9 |
    | UCH   | cofhcore            | 4.4.1                    | CoFHCore-1.12.2-4.4.1.12-universal.jar          | None                                     |
    | UCH   | customspawner       | 3.11.4                   | CustomMobSpawner-3.11.4.jar                     | None                                     |
    | UCH   | ptrmodellib         | 1.0.2                    | PTRLib-1.0.2.jar                                | None                                     |
    | UCH   | props               | 2.6.0                    | Decocraft-2.6.0_1.12.2.jar                      | None                                     |
    | UCH   | mocreatures         | 12.0.4                   | DrZharks MoCreatures Mod-12.0.4.jar             | None                                     |
    | UCH   | energyconverters    | 1.0.1.2                  | Energy-Converters-Mod-1.12.1.jar                | None                                     |
    | UCH   | ic2                 | 2.8.73-ex112             | industrialcraft-2-2.8.73-ex112.jar              | de041f9f6187debbc77034a344134053277aa3b0 |
    | UCH   | mantle              | 1.12-1.3.2.24            | Mantle-1.12-1.3.2.24.jar                        | None                                     |
    | UCH   | jei                 | 4.8.5.159                | jei_1.12.2-4.8.5.159.jar                        | None                                     |
    | UCH   | tconstruct          | 1.12.2-2.9.0.55          | Tinkers-Construct-Mod-1.12.2.jar                | None                                     |
    | UCH   | galacticraftcore    | 4.0.1.177                | GalacticraftCore-1.12.2-4.0.1.177.jar           | None                                     |
    | UCH   | galacticraftplanets | 4.0.1.177                | Galacticraft-Planets-1.12.2-4.0.1.177.jar       | None                                     |
    | UCH   | waila               | 1.8.24                   | Hwyla-1.8.24-B39_1.12.jar                       | None                                     |
    | UCH   | icbmclassic         | 1.12.2-3.0.0.29          | ICBM-classic-1.12.2-3.0.0b29.jar                | None                                     |
    | UCH   | inventorytweaks     | 1.63+release.109.220f184 | InventoryTweaks-1.63.jar                        | 55d2cd4f5f0961410bf7b91ef6c6bf00a766dcbe |
    | UCH   | ironchest           | 1.12.2-7.0.40.824        | ironchest-1.12.2-7.0.40.824.jar                 | None                                     |
    | UCH   | journeymap          | 1.12.2-5.5.2             | journeymap-1.12.2-5.5.2.jar                     | None                                     |
    | UCH   | nei                 | 2.4.1                    | NotEnoughItems-1.12.2-2.4.1.233-universal.jar   | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
    | UCH   | nuclearcraft        | 2.10m                    | NuclearCraft-2.10m--1.12.2.jar                  | None                                     |
    | UCH   | harvestcraft        | 1.12.2u                  | Pam's+HarvestCraft+1.12.2u.jar                  | None                                     |
    | UCH   | projecte            | 1.12-PE1.3.0             | ProjectE-1.12-PE1.3.0.jar                       | None                                     |
    | UCH   | ropebridge          | 2.0.5                    | ropebridge-1.12-2.0.7.jar                       | None                                     |
    | UCH   | thaumcraft          | 6.1.BETA13               | Thaumcraft-1.12.2-6.1.BETA13.jar                | None                                     |
    | UCH   | thermalfoundation   | 2.4.1                    | ThermalFoundation-1.12.2-2.4.1.15-universal.jar | 8a6abf2cb9e141b866580d369ba6548732eff25f |
    | UCH   | thermalexpansion    | 5.4.2                    | ThermalExpansion-1.12.2-5.4.2.27-universal.jar  | 8a6abf2cb9e141b866580d369ba6548732eff25f |

    Loaded coremods (and transformers): 
Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)
  invtweaks.forge.asm.ContainerTransformer
MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.1.177.jar)
  micdoodle8.mods.miccore.MicdoodleTransformer
BCModPlugin (backpacks+1.12.2+-+3.5.0.jar)
  brad16840.core.ClassTransformer
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 388.13' Renderer: 'GeForce GTX 970/PCIe/SSE2'
    AE2 Version: stable rv5-stable-11 for Forge 14.23.1.2554
    Pulsar/tconstruct loaded Pulses: 
        - TinkerCommons (Enabled/Forced)
        - TinkerWorld (Enabled/Not Forced)
        - TinkerTools (Enabled/Not Forced)
        - TinkerHarvestTools (Enabled/Forced)
        - TinkerMeleeWeapons (Enabled/Forced)
        - TinkerRangedWeapons (Enabled/Forced)
        - TinkerModifiers (Enabled/Forced)
        - TinkerSmeltery (Enabled/Not Forced)
        - TinkerGadgets (Enabled/Not Forced)
        - TinkerOredict (Enabled/Forced)
        - TinkerIntegration (Enabled/Forced)
        - TinkerFluids (Enabled/Forced)
        - TinkerMaterials (Enabled/Forced)
        - TinkerModelRegister (Enabled/Forced)
        - chiselIntegration (Enabled/Not Forced)
        - wailaIntegration (Enabled/Not Forced)
        - TinkerDebug (Enabled/Not Forced)

    Launched Version: 1.12.2-forge1.12.2-14.23.3.2655
    LWJGL: 2.9.4
    OpenGL: GeForce GTX 970/PCIe/SSE2 GL version 4.6.0 NVIDIA 388.13, 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 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    CPU: 4x Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
    OptiFine Version: OptiFine_1.12.2_HD_U_D3
    OptiFine Build: 20180515-125031
    Render Distance Chunks: 12
    Mipmaps: 4
    Anisotropic Filtering: 1
    Antialiasing: 0
    Multitexture: false
    Shaders: Wisdom-Shaders-V3.2-Release-Build3230.zip
    OpenGlVersion: 4.6.0 NVIDIA 388.13
    OpenGlRenderer: GeForce GTX 970/PCIe/SSE2
    OpenGlVendor: NVIDIA Corporation
    CpuCount: 4

 

 

Edited by diesieben07
spoiler
Posted (edited)

Ok I will contact the author but I did remove Biomes O' Plenty and relaunched Forge and it still crashed with the same error message. Below is crash report without Biomes O' Plenty in the mods folder>

Spoiler


---- Minecraft Crash Report ----

WARNING: coremods are present:
  Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)
  MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.1.177.jar)
  BCModPlugin (backpacks+1.12.2+-+3.5.0.jar)
Contact their authors BEFORE contacting forge

// Who set us up the TNT?

Time: 5/22/18 3:59 PM
Description: Initializing game

java.lang.NullPointerException: The validated object is null
    at org.apache.commons.lang3.Validate.notNull(Validate.java:225)
    at org.apache.commons.lang3.Validate.notNull(Validate.java:206)
    at net.minecraft.util.registry.RegistrySimple.func_82595_a(SourceFile:35)
    at slimeknights.tconstruct.tools.ToolClientEvents.onModelBake(ToolClientEvents.java:88)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_358_ToolClientEvents_onModelBake_ModelBakeEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
    at net.minecraftforge.client.ForgeHooksClient.onModelBake(ForgeHooksClient.java:386)
    at net.minecraft.client.renderer.block.model.ModelManager.func_110549_a(ModelManager.java:30)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:121)
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:512)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377)
    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:483)
    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 --
Thread: Client thread
Stacktrace:
    at org.apache.commons.lang3.Validate.notNull(Validate.java:225)
    at org.apache.commons.lang3.Validate.notNull(Validate.java:206)
    at net.minecraft.util.registry.RegistrySimple.func_82595_a(SourceFile:35)
    at slimeknights.tconstruct.tools.ToolClientEvents.onModelBake(ToolClientEvents.java:88)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_358_ToolClientEvents_onModelBake_ModelBakeEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
    at net.minecraftforge.client.ForgeHooksClient.onModelBake(ForgeHooksClient.java:386)
    at net.minecraft.client.renderer.block.model.ModelManager.func_110549_a(ModelManager.java:30)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:121)
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:512)

-- Initialization --
Details:
Stacktrace:
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377)
    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:483)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_25, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 3049024096 bytes (2907 MB) / 4898947072 bytes (4672 MB) up to 8589934592 bytes (8192 MB)
    JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.3.2655 Optifine OptiFine_1.12.2_HD_U_D3 44 mods loaded, 44 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                | forge-1.12.2-14.23.3.2655.jar                   | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | UCH   | forge               | 14.23.3.2655             | forge-1.12.2-14.23.3.2655.jar                   | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | UCH   | micdoodlecore       |                          | minecraft.jar                                   | None                                     |
    | UCH   | appliedenergistics2 | rv5-stable-11            | appliedenergistics2-rv5-stable-11.jar           | None                                     |
    | UCH   | backpacks16840      | 3.5.0                    | backpacks+1.12.2+-+3.5.0.jar                    | None                                     |
    | UCH   | baubles             | 1.5.2                    | Baubles-1.12-1.5.2.jar                          | None                                     |
    | UCH   | buildcraftlib       | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftcore      | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftbuilders  | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftenergy    | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftfactory   | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftrobotics  | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcrafttransport | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftsilicon   | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | chisel              | MC1.12.2-0.2.0.31        | Chisel-MC1.12.2-0.2.0.31.jar                    | None                                     |
    | UCH   | codechickenlib      | 3.1.8.341                | CodeChickenLib-1.12.2-3.1.8.341-universal.jar   | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
    | UCH   | redstoneflux        | 2.0.1                    | RedstoneFlux-1.12-2.0.1.2-universal.jar         | d4f1503fbacd9b9fb767720420c5395104239ec9 |
    | UCH   | cofhcore            | 4.4.1                    | CoFHCore-1.12.2-4.4.1.12-universal.jar          | None                                     |
    | UCH   | customspawner       | 3.11.4                   | CustomMobSpawner-3.11.4.jar                     | None                                     |
    | UCH   | ptrmodellib         | 1.0.2                    | PTRLib-1.0.2.jar                                | None                                     |
    | UCH   | props               | 2.6.0                    | Decocraft-2.6.0_1.12.2.jar                      | None                                     |
    | UCH   | mocreatures         | 12.0.4                   | DrZharks MoCreatures Mod-12.0.4.jar             | None                                     |
    | UCH   | energyconverters    | 1.0.1.2                  | Energy-Converters-Mod-1.12.1.jar                | None                                     |
    | UCH   | ic2                 | 2.8.73-ex112             | industrialcraft-2-2.8.73-ex112.jar              | de041f9f6187debbc77034a344134053277aa3b0 |
    | UCH   | mantle              | 1.12-1.3.2.24            | Mantle-1.12-1.3.2.24.jar                        | None                                     |
    | UCH   | jei                 | 4.8.5.159                | jei_1.12.2-4.8.5.159.jar                        | None                                     |
    | UCH   | tconstruct          | 1.12.2-2.9.0.55          | Tinkers-Construct-Mod-1.12.2.jar                | None                                     |
    | UCH   | galacticraftcore    | 4.0.1.177                | GalacticraftCore-1.12.2-4.0.1.177.jar           | None                                     |
    | UCH   | galacticraftplanets | 4.0.1.177                | Galacticraft-Planets-1.12.2-4.0.1.177.jar       | None                                     |
    | UCH   | waila               | 1.8.24                   | Hwyla-1.8.24-B39_1.12.jar                       | None                                     |
    | UCH   | icbmclassic         | 1.12.2-3.0.0.29          | ICBM-classic-1.12.2-3.0.0b29.jar                | None                                     |
    | UCH   | inventorytweaks     | 1.63+release.109.220f184 | InventoryTweaks-1.63.jar                        | 55d2cd4f5f0961410bf7b91ef6c6bf00a766dcbe |
    | UCH   | ironchest           | 1.12.2-7.0.40.824        | ironchest-1.12.2-7.0.40.824.jar                 | None                                     |
    | UCH   | journeymap          | 1.12.2-5.5.2             | journeymap-1.12.2-5.5.2.jar                     | None                                     |
    | UCH   | nei                 | 2.4.1                    | NotEnoughItems-1.12.2-2.4.1.233-universal.jar   | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
    | UCH   | nuclearcraft        | 2.10m                    | NuclearCraft-2.10m--1.12.2.jar                  | None                                     |
    | UCH   | harvestcraft        | 1.12.2u                  | Pam's+HarvestCraft+1.12.2u.jar                  | None                                     |
    | UCH   | projecte            | 1.12-PE1.3.0             | ProjectE-1.12-PE1.3.0.jar                       | None                                     |
    | UCH   | ropebridge          | 2.0.5                    | ropebridge-1.12-2.0.7.jar                       | None                                     |
    | UCH   | thaumcraft          | 6.1.BETA13               | Thaumcraft-1.12.2-6.1.BETA13.jar                | None                                     |
    | UCH   | thermalfoundation   | 2.4.1                    | ThermalFoundation-1.12.2-2.4.1.15-universal.jar | 8a6abf2cb9e141b866580d369ba6548732eff25f |
    | UCH   | thermalexpansion    | 5.4.2                    | ThermalExpansion-1.12.2-5.4.2.27-universal.jar  | 8a6abf2cb9e141b866580d369ba6548732eff25f |

    Loaded coremods (and transformers): 
Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)
  invtweaks.forge.asm.ContainerTransformer
MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.1.177.jar)
  micdoodle8.mods.miccore.MicdoodleTransformer
BCModPlugin (backpacks+1.12.2+-+3.5.0.jar)
  brad16840.core.ClassTransformer
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 388.13' Renderer: 'GeForce GTX 970/PCIe/SSE2'
    AE2 Version: stable rv5-stable-11 for Forge 14.23.1.2554
    Pulsar/tconstruct loaded Pulses: 
        - TinkerCommons (Enabled/Forced)
        - TinkerWorld (Enabled/Not Forced)
        - TinkerTools (Enabled/Not Forced)
        - TinkerHarvestTools (Enabled/Forced)
        - TinkerMeleeWeapons (Enabled/Forced)
        - TinkerRangedWeapons (Enabled/Forced)
        - TinkerModifiers (Enabled/Forced)
        - TinkerSmeltery (Enabled/Not Forced)
        - TinkerGadgets (Enabled/Not Forced)
        - TinkerOredict (Enabled/Forced)
        - TinkerIntegration (Enabled/Forced)
        - TinkerFluids (Enabled/Forced)
        - TinkerMaterials (Enabled/Forced)
        - TinkerModelRegister (Enabled/Forced)
        - chiselIntegration (Enabled/Not Forced)
        - wailaIntegration (Enabled/Not Forced)
        - TinkerDebug (Enabled/Not Forced)

    Launched Version: 1.12.2-forge1.12.2-14.23.3.2655
    LWJGL: 2.9.4
    OpenGL: GeForce GTX 970/PCIe/SSE2 GL version 4.6.0 NVIDIA 388.13, 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 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    CPU: 4x Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
    OptiFine Version: OptiFine_1.12.2_HD_U_D3
    OptiFine Build: 20180515-125031
    Render Distance Chunks: 12
    Mipmaps: 4
    Anisotropic Filtering: 1
    Antialiasing: 0
    Multitexture: false
    Shaders: Wisdom-Shaders-V3.2-Release-Build3230.zip
    OpenGlVersion: 4.6.0 NVIDIA 388.13
    OpenGlRenderer: GeForce GTX 970/PCIe/SSE2
    OpenGlVendor: NVIDIA Corporation
    CpuCount: 4

 

 

Edited by diesieben07
spoiler
Posted

Yes. Even without Optifine and shaders it still crashes. WWithout Tinker's Construct, it loaded all the way to right before the game screen pops up and then crashed. Normally it crashes when it is loading the Model Manager, but this time I saw the dirt wall right before the game screen. Below is crash report without Optifine, shaders, and Tinker's Construct.

 

---- Minecraft Crash Report ----

WARNING: coremods are present:
  Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)
  MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.1.177.jar)
  BCModPlugin (backpacks+1.12.2+-+3.5.0.jar)
Contact their authors BEFORE contacting forge

// I let you down. Sorry :(

Time: 5/22/18 4:07 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
    at mcp.mobius.waila.overlay.WailaTickHandler.tickClient(WailaTickHandler.java:56)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_45_WailaTickHandler_tickClient_ClientTickEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
    at net.minecraftforge.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:343)
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1706)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1096)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397)
    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:483)
    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:
---------------------------------------------------------------------------------------

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_25, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 2522639704 bytes (2405 MB) / 4110417920 bytes (3920 MB) up to 8589934592 bytes (8192 MB)
    JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.3.2655 43 mods loaded, 43 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                | forge-1.12.2-14.23.3.2655.jar                   | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | UCH   | forge               | 14.23.3.2655             | forge-1.12.2-14.23.3.2655.jar                   | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | UCH   | micdoodlecore       |                          | minecraft.jar                                   | None                                     |
    | UCH   | appliedenergistics2 | rv5-stable-11            | appliedenergistics2-rv5-stable-11.jar           | None                                     |
    | UCH   | backpacks16840      | 3.5.0                    | backpacks+1.12.2+-+3.5.0.jar                    | None                                     |
    | UCH   | baubles             | 1.5.2                    | Baubles-1.12-1.5.2.jar                          | None                                     |
    | UCH   | buildcraftlib       | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftcore      | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftbuilders  | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftenergy    | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftfactory   | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftrobotics  | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcrafttransport | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | buildcraftsilicon   | 7.99.17                  | buildcraft-7.99.17.jar                          | None                                     |
    | UCH   | chisel              | MC1.12.2-0.2.0.31        | Chisel-MC1.12.2-0.2.0.31.jar                    | None                                     |
    | UCH   | codechickenlib      | 3.1.8.341                | CodeChickenLib-1.12.2-3.1.8.341-universal.jar   | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
    | UCH   | redstoneflux        | 2.0.1                    | RedstoneFlux-1.12-2.0.1.2-universal.jar         | d4f1503fbacd9b9fb767720420c5395104239ec9 |
    | UCH   | cofhcore            | 4.4.1                    | CoFHCore-1.12.2-4.4.1.12-universal.jar          | None                                     |
    | UCH   | customspawner       | 3.11.4                   | CustomMobSpawner-3.11.4.jar                     | None                                     |
    | UCH   | ptrmodellib         | 1.0.2                    | PTRLib-1.0.2.jar                                | None                                     |
    | UCH   | props               | 2.6.0                    | Decocraft-2.6.0_1.12.2.jar                      | None                                     |
    | UCH   | mocreatures         | 12.0.4                   | DrZharks MoCreatures Mod-12.0.4.jar             | None                                     |
    | UCH   | energyconverters    | 1.0.1.2                  | Energy-Converters-Mod-1.12.1.jar                | None                                     |
    | UCH   | ic2                 | 2.8.73-ex112             | industrialcraft-2-2.8.73-ex112.jar              | de041f9f6187debbc77034a344134053277aa3b0 |
    | UCH   | mantle              | 1.12-1.3.2.24            | Mantle-1.12-1.3.2.24.jar                        | None                                     |
    | UCH   | galacticraftcore    | 4.0.1.177                | GalacticraftCore-1.12.2-4.0.1.177.jar           | None                                     |
    | UCH   | galacticraftplanets | 4.0.1.177                | Galacticraft-Planets-1.12.2-4.0.1.177.jar       | None                                     |
    | UCH   | waila               | 1.8.24                   | Hwyla-1.8.24-B39_1.12.jar                       | None                                     |
    | UCH   | icbmclassic         | 1.12.2-3.0.0.29          | ICBM-classic-1.12.2-3.0.0b29.jar                | None                                     |
    | UCH   | inventorytweaks     | 1.63+release.109.220f184 | InventoryTweaks-1.63.jar                        | 55d2cd4f5f0961410bf7b91ef6c6bf00a766dcbe |
    | UCH   | ironchest           | 1.12.2-7.0.40.824        | ironchest-1.12.2-7.0.40.824.jar                 | None                                     |
    | UCH   | jei                 | 4.8.5.159                | jei_1.12.2-4.8.5.159.jar                        | None                                     |
    | UCH   | journeymap          | 1.12.2-5.5.2             | journeymap-1.12.2-5.5.2.jar                     | None                                     |
    | UCH   | nei                 | 2.4.1                    | NotEnoughItems-1.12.2-2.4.1.233-universal.jar   | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
    | UCH   | nuclearcraft        | 2.10m                    | NuclearCraft-2.10m--1.12.2.jar                  | None                                     |
    | UCH   | harvestcraft        | 1.12.2u                  | Pam's+HarvestCraft+1.12.2u.jar                  | None                                     |
    | UCH   | projecte            | 1.12-PE1.3.0             | ProjectE-1.12-PE1.3.0.jar                       | None                                     |
    | UCH   | ropebridge          | 2.0.5                    | ropebridge-1.12-2.0.7.jar                       | None                                     |
    | UCH   | thaumcraft          | 6.1.BETA13               | Thaumcraft-1.12.2-6.1.BETA13.jar                | None                                     |
    | UCH   | thermalfoundation   | 2.4.1                    | ThermalFoundation-1.12.2-2.4.1.15-universal.jar | 8a6abf2cb9e141b866580d369ba6548732eff25f |
    | UCH   | thermalexpansion    | 5.4.2                    | ThermalExpansion-1.12.2-5.4.2.27-universal.jar  | 8a6abf2cb9e141b866580d369ba6548732eff25f |

    Loaded coremods (and transformers): 
Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)
  invtweaks.forge.asm.ContainerTransformer
MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.1.177.jar)
  micdoodle8.mods.miccore.MicdoodleTransformer
BCModPlugin (backpacks+1.12.2+-+3.5.0.jar)
  brad16840.core.ClassTransformer
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 388.13' Renderer: 'GeForce GTX 970/PCIe/SSE2'
    AE2 Version: stable rv5-stable-11 for Forge 14.23.1.2554
    Launched Version: 1.12.2-forge1.12.2-14.23.3.2655
    LWJGL: 2.9.4
    OpenGL: GeForce GTX 970/PCIe/SSE2 GL version 4.6.0 NVIDIA 388.13, 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 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: 
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    CPU: 4x Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • It is 1.12.2 - I have no idea if there is a 1.12 pack
    • Okay, but does the modpack works with 1.12 or just with 1.12.2, because I need the Forge client specifically for Minecraft 1.12, not 1.12.2
    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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