Jump to content

java.lang.IllegalArgumentException: Cannot get property PropertyInteger{name=moisture, clazz=class java.lang.Integer, values}


Recommended Posts

Posted

HELP PLEASE

that is crash report, what i need to do?

 

 

---- Minecraft Crash Report ----

WARNING: coremods are present:
  FarseekCoreMod (Farseek-1.12-2.5.jar)
  Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)
  OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)
  CoreMod (Aroma1997Core-1.12.2-2.0.0.2.b167.jar)
  DLFMLCorePlugin (DynamicLights-1.12.2.jar)
  TLSkinCapeHookLoader (tlskincape_1.12.2-1.4.jar)
Contact their authors BEFORE contacting forge

// Why did you do that?

Time: 6/10/24 10:26 AM
Description: Ticking block entity

java.lang.IllegalArgumentException: Cannot get property PropertyInteger{name=moisture, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4, 5, 6, 7]} as it does not exist in BlockStateContainer{block=minecraft:sand, properties=[variant]}
    at net.minecraft.block.state.BlockStateContainer$StateImplementation.func_177229_b(BlockStateContainer.java:209)
    at ic2.core.crop.TileEntityCrop.updateTerrainHumidity(TileEntityCrop.java:621)
    at ic2.core.crop.TileEntityCrop.performTick(TileEntityCrop.java:232)
    at ic2.core.crop.TileEntityCrop.updateEntityServer(TileEntityCrop.java:200)
    at ic2.core.block.TileEntityBlock.func_73660_a(TileEntityBlock.java:326)
    at net.minecraft.world.World.func_72939_s(World.java:1838)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:279)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
    at java.lang.Thread.run(Thread.java:745)


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

-- Head --
Thread: Server thread
Stacktrace:
    at net.minecraft.block.state.BlockStateContainer$StateImplementation.func_177229_b(BlockStateContainer.java:209)
    at ic2.core.crop.TileEntityCrop.updateTerrainHumidity(TileEntityCrop.java:621)
    at ic2.core.crop.TileEntityCrop.performTick(TileEntityCrop.java:232)
    at ic2.core.crop.TileEntityCrop.updateEntityServer(TileEntityCrop.java:200)
    at ic2.core.block.TileEntityBlock.func_73660_a(TileEntityBlock.java:326)

-- Block entity being ticked --
Details:
    Name: ic2:crop // ic2.core.crop.TileEntityCrop
    Block type: ID #386 (ic2.te // ic2.core.block.BlockTileEntity // ic2:te)
    Block data value: 11 / 0xB / 0b1011
    Block location: World: (-103,63,-525), Chunk: (at 9,3,3 in -7,-33; contains blocks -112,0,-528 to -97,255,-513), Region: (-1,-2; contains chunks -32,-64 to -1,-33, blocks -512,0,-1024 to -1,255,-513)
    Actual block type: ID #386 (ic2.te // ic2.core.block.BlockTileEntity // ic2:te)
    Actual block data value: 11 / 0xB / 0b1011
Stacktrace:
    at net.minecraft.world.World.func_72939_s(World.java:1838)
    at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613)

-- Affected level --
Details:
    Level name: zalupaboyyy
    All players: 1 total; [EntityPlayerMP['PrivetYaKoza'/336, l='zalupaboyyy', x=-114.26, y=70.00, z=-669.25]]
    Chunk stats: ServerChunkCache: 1097 Drop: 0
    Level seed: 1849535847176540143
    Level generator: ID 00 - default, ver 1. Features enabled: true
    Level generator options:
    Level spawn location: World: (-60,64,252), Chunk: (at 4,4,12 in -4,15; contains blocks -64,0,240 to -49,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
    Level time: 555008 game time, 558469 day time
    Level dimension: 0
    Level storage version: 0x04ABD - Anvil
    Level weather: Rain time: 46592 (now: false), thunder time: 46011 (now: false)
    Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
Stacktrace:
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:279)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
    at java.lang.Thread.run(Thread.java:745)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 6799607328 bytes (6484 MB) / 9093251072 bytes (8672 MB) up to 10502537216 bytes (10016 MB)
    JVM Flags: 7 total; -Xmx9995M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
    IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 96
    FML: MCP 9.42 Powered by Forge 14.23.5.2860 Optifine OptiFine_1.12.2_HD_U_G5 74 mods loaded, 74 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                                |
    |:------ |:--------------------------- |:------------------------ |:--------------------------------------------- |:---------------------------------------- |
    | LCHIJA | minecraft                   | 1.12.2                   | minecraft.jar                                 | None                                     |
    | LCHIJA | mcp                         | 9.42                     | minecraft.jar                                 | None                                     |
    | LCHIJA | FML                         | 8.0.99.99                | forge-1.12.2-14.23.5.2860.jar                 | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | LCHIJA | forge                       | 14.23.5.2860             | forge-1.12.2-14.23.5.2860.jar                 | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | LCHIJA | openmodscore                | 0.12.2                   | minecraft.jar                                 | None                                     |
    | LCHIJA | buildcraftlib               | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | buildcraftcore              | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | buildcraftfactory           | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | buildcrafttransport         | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | buildcraftsilicon           | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | additionalpipes             | 6.0.0.8                  | additionalpipes_1.12.2_6.0.0.8.jar            | None                                     |
    | LCHIJA | appliedenergistics2         | rv6-stable-7             | appliedenergistics2-rv6-stable-7.jar          | dfa4d3ac143316c6f32aa1a1beda1e34d42132e5 |
    | LCHIJA | bdlib                       | 1.14.3.12                | bdlib-1.14.3.12-mc1.12.2.jar                  | None                                     |
    | LCHIJA | ae2stuff                    | 0.7.0.4                  | ae2stuff-0.7.0.4-mc1.12.2.jar                 | None                                     |
    | LCHIJA | aroma1997core               | 2.0.0.2.b167             | Aroma1997Core-1.12.2-2.0.0.2.b167.jar         | dfbfe4c473253d8c5652417689848f650b2cbe32 |
    | LCHIJA | baubles                     | 1.5.2                    | Baubles-1.12-1.5.2.jar                        | None                                     |
    | LCHIJA | bibliocraft                 | 2.4.5                    | BiblioCraft[v2.4.5][MC1.12.2].jar             | None                                     |
    | LCHIJA | biomesoplenty               | 7.0.1.2444               | BiomesOPlenty-1.12.2-7.0.1.2444-universal.jar | None                                     |
    | LCHIJA | guideapi                    | 1.12-2.1.8-63            | Guide-API-1.12-2.1.8-63.jar                   | None                                     |
    | LCHIJA | bloodmagic                  | 1.12.2-2.4.3-105         | BloodMagic-1.12.2-2.4.3-105.jar               | None                                     |
    | LCHIJA | bookshelf                   | 2.3.585                  | Bookshelf-1.12.2-2.3.585.jar                  | d476d1b22b218a10d845928d1665d45fce301b27 |
    | LCHIJA | jei                         | 4.15.0.291               | jei_1.12.2-4.15.0.291.jar                     | None                                     |
    | LCHIJA | thaumcraft                  | 6.1.BETA26               | Thaumcraft-1.12.2-6.1.BETA26.jar              | None                                     |
    | LCHIJA | botania                     | r1.10-361                | Botania+r1.10-361.jar                         | None                                     |
    | LCHIJA | codechickenlib              | 3.2.3.358                | CodeChickenLib-1.12.2-3.2.3.358-universal.jar | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
    | LCHIJA | redstoneflux                | 2.1.1                    | RedstoneFlux-1.12-2.1.1.1-universal.jar       | None                                     |
    | LCHIJA | brandonscore                | 2.4.18                   | BrandonsCore-1.12.2-2.4.18.210-universal.jar  | None                                     |
    | LCHIJA | buildcraftbuilders          | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | buildcraftenergy            | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | ic2                         | 2.8.187-ex112            | industrialcraft-2-2.8.187-ex112.jar           | de041f9f6187debbc77034a344134053277aa3b0 |
    | LCHIJA | forestry                    | 5.8.2.422                | forestry_1.12.2-5.8.2.422.jar                 | None                                     |
    | LCHIJA | buildcraftcompat            | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | buildcraftrobotics          | 7.99.24.6                | buildcraft-all-7.99.24.6.jar                  | None                                     |
    | LCHIJA | cofhcore                    | 4.6.6                    | CoFHCore-1.12.2-4.6.6.1-universal.jar         | None                                     |
    | LCHIJA | cofhworld                   | 1.4.0                    | CoFHWorld-1.12.2-1.4.0.1-universal.jar        | None                                     |
    | LCHIJA | dynamiclights               | 1.4.9                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_onfire        | 1.0.7                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_creepers      | 1.0.6                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_dropitems     | 1.1.0                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_entityclasses | 1.0.1                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_mobequipment  | 1.1.0                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_flamearrows   | 1.0.1                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_floodlights   | 1.0.3                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_otherplayers  | 1.0.9                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | dynamiclights_theplayer     | 1.1.3                    | DynamicLights-1.12.2.jar                      | None                                     |
    | LCHIJA | eleccore                    | 1.9.453                  | ElecCore-1.12.2-1.9.453.jar                   | None                                     |
    | LCHIJA | waila                       | 1.8.26                   | Hwyla-1.8.26-B41_1.12.2.jar                   | None                                     |
    | LCHIJA | extrabotany                 | 58                       | ExtraBotany-r1.1-58r.jar                      | None                                     |
    | LCHIJA | extracells                  | 2.6.5                    | ExtraCells-1.12.2-2.6.5.jar                   | None                                     |
    | LCHIJA | extrautils2                 | 1.0                      | extrautils2-1.12-1.9.9.jar                    | None                                     |
    | LCHIJA | farseek                     | 2.5                      | Farseek-1.12-2.5.jar                          | None                                     |
    | LCHIJA | fastleafdecay               | v14                      | FastLeafDecay-v14.jar                         | None                                     |
    | LCHIJA | gendustry                   | 1.6.5.8                  | gendustry-1.6.5.8-mc1.12.2.jar                | None                                     |
    | LCHIJA | inventorytweaks             | 1.63+release.109.220f184 | InventoryTweaks-1.63.jar                      | 55d2cd4f5f0961410bf7b91ef6c6bf00a766dcbe |
    | LCHIJA | jeibees                     | 0.9.0.5                  | jeibees-0.9.0.5-mc1.12.2.jar                  | None                                     |
    | LCHIJA | journeymap                  | 1.12.2-5.7.1             | journeymap-1.12.2-5.7.1.jar                   | None                                     |
    | LCHIJA | jee                         | 1.0.8                    | JustEnoughEnergistics-1.12.2-1.0.8.jar        | None                                     |
    | LCHIJA | jeresources                 | 0.9.2.60                 | JustEnoughResources-1.12.2-0.9.2.60.jar       | None                                     |
    | LCHIJA | libraryex                   | 1.1.2                    | LibraryEx-1.12.2-1.1.2.jar                    | None                                     |
    | LCHIJA | mcjtylib_ng                 | 3.5.4                    | mcjtylib-1.12-3.5.4.jar                       | None                                     |
    | LCHIJA | mousetweaks                 | 2.10                     | MouseTweaks-2.10-mc1.12.2.jar                 | None                                     |
    | LCHIJA | netherex                    | 2.1.4                    | NetherEx-1.12.2-2.1.4.jar                     | None                                     |
    | LCHIJA | openmods                    | 0.12.2                   | OpenModsLib-1.12.2-0.12.2.jar                 | d2a9a8e8440196e26a268d1f3ddc01b2e9c572a5 |
    | LCHIJA | openblocks                  | 1.8.1                    | OpenBlocks-1.12.2-1.8.1.jar                   | d2a9a8e8440196e26a268d1f3ddc01b2e9c572a5 |
    | LCHIJA | rftools                     | 7.73                     | rftools-1.12-7.73.jar                         | None                                     |
    | LCHIJA | streams                     | 0.4.8                    | Streams-1.12-0.4.8.jar                        | None                                     |
    | LCHIJA | thaumicjei                  | 1.6.0                    | ThaumicJEI-1.12.2-1.6.0-27.jar                | None                                     |
    | LCHIJA | tlauncher_custom_cape_skin  | 1.4                      | tlskincape_1.12.2-1.4.jar                     | None                                     |
    | LCHIJA | twilightforest              | 3.10.1013                | twilightforest-1.12.2-3.10.1013-universal.jar | None                                     |
    | LCHIJA | wanionlib                   | 1.12.2-2.4               | WanionLib-1.12.2-2.4.jar                      | None                                     |
    | LCHIJA | wawla                       | 2.6.275                  | Wawla-1.12.2-2.6.275.jar                      | d476d1b22b218a10d845928d1665d45fce301b27 |
    | LCHIJA | betteranimalsplus           | 9.0.1                    | betteranimalsplus-1.12.2-9.0.1.jar            | None                                     |
    | LCHIJA | eleccoreloader              | 1.9.453                  | ElecCore-1.12.2-1.9.453.jar                   | None                                     |
    | LCHIJA | unidict                     | 1.12.2-2.9.6             | UniDict-1.12.2-2.9.6.jar                      | None                                     |

    Loaded coremods (and transformers):
FarseekCoreMod (Farseek-1.12-2.5.jar)
  farseek.core.FarseekClassTransformer
Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)
  invtweaks.forge.asm.ContainerTransformer
OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)
  openmods.core.OpenModsClassTransformer
CoreMod (Aroma1997Core-1.12.2-2.0.0.2.b167.jar)
 
DLFMLCorePlugin (DynamicLights-1.12.2.jar)
  atomicstryker.dynamiclights.common.DLTransformer
TLSkinCapeHookLoader (tlskincape_1.12.2-1.4.jar)
  gloomyfolken.hooklib.minecraft.PrimaryClassTransformer
    GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
    OpenModsLib class transformers: [llama_null_fix:FINISHED],[horse_base_null_fix:FINISHED],[pre_world_render_hook:FINISHED],[player_render_hook:FINISHED],[horse_null_fix:FINISHED]
    AE2 Version: stable rv6-stable-7 for Forge 14.23.5.2768
    List of loaded APIs:
        * apAPI (3) from additionalpipes_1.12.2_6.0.0.8.jar
        * appliedenergistics2|API (rv6) from appliedenergistics2-rv6-stable-7.jar
        * Baubles|API (1.4.0.2) from Baubles-1.12-1.5.2.jar
        * bloodmagic-api (2.0.0) from BloodMagic-1.12.2-2.4.3-105.jar
        * BotaniaAPI (93) from Botania+r1.10-361.jar
        * buildcraftapi_blocks (1.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_boards (2.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_core (2.2) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_crops (1.1) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_enums (1.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_events (2.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_facades (1.1) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_filler (5.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_fuels (2.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_gates (4.1) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_items (1.1) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_library (2.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_lists (1.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_power (1.3) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_recipes (3.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_robotics (3.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_statements (1.1) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_tiles (1.2) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_tools (1.0) from buildcraft-all-7.99.24.6.jar
        * buildcraftapi_transport (5.0) from buildcraft-all-7.99.24.6.jar
        * cofhapi (2.5.0) from CoFHCore-1.12.2-4.6.6.1-universal.jar
        * ElecCoreAPI (1.0.0) from ElecCore-1.12.2-1.9.453.jar
        * ForestryAPI|apiculture (5.0.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|arboriculture (4.3.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|book (5.8.1) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|circuits (3.1.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|climate (5.0.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|core (5.7.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|farming (5.8.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|food (1.1.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|fuels (3.0.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|genetics (5.7.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|gui (5.8.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|hives (4.1.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|lepidopterology (1.4.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|mail (3.1.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|modules (5.7.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|multiblock (3.0.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|recipes (5.4.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|storage (5.0.0) from forestry_1.12.2-5.8.2.422.jar
        * ForestryAPI|world (2.1.0) from forestry_1.12.2-5.8.2.422.jar
        * gendustryAPI (2.3.0) from gendustry-1.6.5.8-mc1.12.2.jar
        * Guide-API|API (2.0.0) from Guide-API-1.12-2.1.8-63.jar
        * jeresources|API (0.9.2.60) from JustEnoughResources-1.12.2-0.9.2.60.jar
        * journeymap|client-api (1.4) from journeymap-1.12.2-5.7.1.jar
        * journeymap|client-api-display (1.4) from journeymap-1.12.2-5.7.1.jar
        * journeymap|client-api-event (1.4) from journeymap-1.12.2-5.7.1.jar
        * journeymap|client-api-model (1.4) from journeymap-1.12.2-5.7.1.jar
        * journeymap|client-api-util (1.4) from journeymap-1.12.2-5.7.1.jar
        * JustEnoughItemsAPI (4.13.0) from jei_1.12.2-4.15.0.291.jar
        * MouseTweaks|API (1.0) from MouseTweaks-2.10-mc1.12.2.jar
        * openblocks|api (1.2) from OpenBlocks-1.12.2-1.8.1.jar
        * redstonefluxapi (2.1.1) from RedstoneFlux-1.12-2.1.1.1-universal.jar
        * Thaumcraft|API (6.0.2) from Thaumcraft-1.12.2-6.1.BETA26.jar
        * WailaAPI (1.3) from Hwyla-1.8.26-B41_1.12.2.jar
    AE2 Integration: IC2:ON, RC:OFF, MFR:OFF, Waila:ON, InvTweaks:ON, JEI:ON, Mekanism:OFF, OpenComputers:OFF, THE_ONE_PROBE:OFF, TESLA:OFF, CRAFTTWEAKER:OFF
    Profiler Position: N/A (disabled)
    Player Count: 1 / 8; [EntityPlayerMP['PrivetYaKoza'/336, l='zalupaboyyy', x=-114.26, y=70.00, z=-669.25]]
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    OptiFine Version: OptiFine_1.12.2_HD_U_G5
    OptiFine Build: 20210124-142939
    Render Distance Chunks: 14
    Mipmaps: 4
    Anisotropic Filtering: 1
    Antialiasing: 0
    Multitexture: false
    Shaders: null
    OpenGlVersion: 4.6.0 NVIDIA 546.17
    OpenGlRenderer: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
    OpenGlVendor: NVIDIA Corporation
    CpuCount: 8

Guest
This topic is now closed to further replies.

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)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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