Jump to content

Recommended Posts

Posted

I'm currently using 1.18.2 on the latest version of forge. Whenever i start up a world, it runs until it reaches 1% and after which it freezes then crashes and the crash report is extremely vague. The same thing happens on my server to. Here's the crash report: "The game crashed whilst exception in server tick loop Error: java.lang.NoSuchMethodError: 'void net.minecraft.server.level.DistanceManager.addRegionTicket(net.minecraft.server.level.TicketType, net.minecraft.world.level.ChunkPos, int, java.lang.Object, boolean)' Exit Code: -1."

---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3

Time: 12/7/22, 12:52 pm
Description: Exception in server tick loop

java.lang.NoSuchMethodError: 'void net.minecraft.server.level.DistanceManager.addRegionTicket(net.minecraft.server.level.TicketType, net.minecraft.world.level.ChunkPos, int, java.lang.Object, boolean)'
	at net.minecraft.server.level.ServerChunkCache.addRegionTicket(ServerChunkCache.java:429) ~[client-1.18.2-20220404.173914-srg.jar%23125!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:fantasy.mixins.json:ServerChunkManagerMixin,pl:mixin:A}
	at net.minecraft.server.level.ServerChunkCache.m_8387_(ServerChunkCache.java:425) ~[client-1.18.2-20220404.173914-srg.jar%23125!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:fantasy.mixins.json:ServerChunkManagerMixin,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_129940_(MinecraftServer.java:471) ~[client-1.18.2-20220404.173914-srg.jar%23125!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:fastload.mixins.json:MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:crafttweaker.mixins.json:common.access.server.AccessMinecraftServer,pl:mixin:APP:fantasy.mixins.json:MinecraftServerAccess,pl:mixin:APP:terrablender.mixins.json:MixinMinecraftServer,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_130006_(MinecraftServer.java:318) ~[client-1.18.2-20220404.173914-srg.jar%23125!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:fastload.mixins.json:MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:crafttweaker.mixins.json:common.access.server.AccessMinecraftServer,pl:mixin:APP:fantasy.mixins.json:MinecraftServerAccess,pl:mixin:APP:terrablender.mixins.json:MixinMinecraftServer,pl:mixin:A}
	at net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:84) ~[client-1.18.2-20220404.173914-srg.jar%23125!/:?] {re:classloading,xf:OptiFine:default}
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[client-1.18.2-20220404.173914-srg.jar%23125!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:fastload.mixins.json:MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:crafttweaker.mixins.json:common.access.server.AccessMinecraftServer,pl:mixin:APP:fantasy.mixins.json:MinecraftServerAccess,pl:mixin:APP:terrablender.mixins.json:MixinMinecraftServer,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:261) ~[client-1.18.2-20220404.173914-srg.jar%23125!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:fastload.mixins.json:MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:crafttweaker.mixins.json:common.access.server.AccessMinecraftServer,pl:mixin:APP:fantasy.mixins.json:MinecraftServerAccess,pl:mixin:APP:terrablender.mixins.json:MixinMinecraftServer,pl:mixin:A}
	at java.lang.Thread.run(Thread.java:833) [?:?] {}


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

-- System Details --
Details:
	Minecraft Version: 1.18.2
	Minecraft Version ID: 1.18.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 17.0.1, Microsoft
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
	Memory: 828957328 bytes (790 MiB) / 3221225472 bytes (3072 MiB) up to 3221225472 bytes (3072 MiB)
	CPUs: 8
	Processor Vendor: GenuineIntel
	Processor Name: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
	Identifier: Intel64 Family 6 Model 142 Stepping 12
	Microarchitecture: whiskey Lake
	Frequency (GHz): 1.80
	Number of physical packages: 1
	Number of physical CPUs: 4
	Number of logical CPUs: 8
	Graphics card #0 name: Intel(R) UHD Graphics 620
	Graphics card #0 vendor: Intel Corporation (0x8086)
	Graphics card #0 VRAM (MB): 1024.00
	Graphics card #0 deviceId: 0x3ea0
	Graphics card #0 versionInfo: DriverVersion=30.0.101.1994
	Memory slot #0 capacity (MB): 4096.00
	Memory slot #0 clockSpeed (GHz): 2.40
	Memory slot #0 type: DDR4
	Memory slot #1 capacity (MB): 4096.00
	Memory slot #1 clockSpeed (GHz): 2.40
	Memory slot #1 type: DDR4
	Virtual memory max (MB): 20360.24
	Virtual memory used (MB): 13730.05
	Swap memory total (MB): 12288.00
	Swap memory used (MB): 1303.12
	JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx3G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
	Server Running: true
	Player Count: 0 / 8; []
	Data Packs: vanilla, mod:lightmansdiscord (incompatible), mod:fastload (incompatible), mod:supermartijn642configlib, mod:jei (incompatible), mod:connectivity (incompatible), mod:clumps (incompatible), mod:cookingforblockheads (incompatible), mod:controlling (incompatible), mod:placebo (incompatible), mod:travelersbackpack (incompatible), mod:configured (incompatible), mod:lightmanscurrency (incompatible), mod:bookshelf, mod:jeed (incompatible), mod:balm (incompatible), mod:jeitweaker (incompatible), mod:vtweaks (incompatible), mod:multiworld (incompatible), mod:jeresources (incompatible), mod:crafttweaker (incompatible), mod:luckperms (incompatible), mod:cloth_config (incompatible), mod:forge, mod:vanillatweaks (incompatible), mod:mcwbridges, mod:logprot (incompatible), mod:itlt (incompatible), mod:voicechat (incompatible), mod:sound_physics_remastered (incompatible), mod:bcc (incompatible), mod:theoneprobe (incompatible), mod:terrablender (incompatible), mod:mousetweaks (incompatible), mod:crashutilities (incompatible), mod:jade, mod:ae2 (incompatible), mod:deathfinder (incompatible), mod:supermartijn642corelib, mod:spark (incompatible), mod:betterfpsdist (incompatible), mod:flywheel (incompatible), mod:create, mod:createdeco (incompatible), mod:patchouli (incompatible), mod:mantle (incompatible), mod:pamhc2foodcore, mod:collective, mod:fastbench (incompatible), mod:autoreglib (incompatible), mod:quark (incompatible), mod:securitycraft (incompatible), mod:storagedrawers (incompatible), mod:worldedit (incompatible), mod:starterkit, mod:fastfurnace (incompatible), mod:architectury (incompatible), mod:ftblibrary (incompatible), mod:ftbteams (incompatible), mod:ftbchunks (incompatible), mod:ftbranks (incompatible), mod:ftbessentials (incompatible), mod:appleskin (incompatible), mod:engineersdecor (incompatible), mod:puzzleslib (incompatible), mod:chunkloaders (incompatible), mod:jadeaddons (incompatible), mod:geckolib3 (incompatible), mod:createaddition (incompatible), mod:betteradvancements (incompatible)
	World Generation: Stable
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'forge'; Server brand changed to 'forge'
	OptiFine Version: OptiFine_1.18.2_HD_U_H7
	OptiFine Build: 20220410-185216
	Render Distance Chunks: 8
	Mipmaps: 4
	Anisotropic Filtering: 1
	Antialiasing: 0
	Multitexture: false
	Shaders: null
	OpenGlVersion: 3.2.0 - Build 30.0.101.1994
	OpenGlRenderer: Intel(R) UHD Graphics 620
	OpenGlVendor: Intel
	CpuCount: 8
	ModLauncher: 9.1.3+9.1.3+main.9b69c82a
	ModLauncher launch target: forgeclient
	ModLauncher naming: srg
	ModLauncher services: 
		 mixin PLUGINSERVICE 
		 eventbus PLUGINSERVICE 
		 slf4jfixer PLUGINSERVICE 
		 object_holder_definalize PLUGINSERVICE 
		 runtime_enum_extender PLUGINSERVICE 
		 capability_token_subclass PLUGINSERVICE 
		 accesstransformer PLUGINSERVICE 
		 runtimedistcleaner PLUGINSERVICE 
		 mixin TRANSFORMATIONSERVICE 
		 OptiFine TRANSFORMATIONSERVICE 
		 fml TRANSFORMATIONSERVICE 
	FML Language Providers: 
		minecraft@1.0
		lowcodefml@null
		javafml@null
	Mod List: 
		lightmansdiscord-1.18-0.0.3.8-server.jar          |Lightmans Discord Integration |lightmansdiscord              |1.18-0.0.3.8        |DONE      |Manifest: NOSIGNATURE
		Fastload-Reforged-1.1.5+1.18.2.jar                |Fastload                      |fastload                      |1.1.5+1.18.2        |DONE      |Manifest: NOSIGNATURE
		supermartijn642configlib-1.1.6-forge-mc1.18.jar   |SuperMartijn642's Config Libra|supermartijn642configlib      |1.1.6               |DONE      |Manifest: NOSIGNATURE
		jei-1.18.2-9.7.0.209.jar                          |Just Enough Items             |jei                           |9.7.0.209           |DONE      |Manifest: NOSIGNATURE
		connectivity-1.18.2-3.2.jar                       |Connectivity Mod              |connectivity                  |1.18.2-3.2          |DONE      |Manifest: NOSIGNATURE
		Clumps-forge-1.18.2-8.0.0+10.jar                  |Clumps                        |clumps                        |8.0.0+10            |DONE      |Manifest: NOSIGNATURE
		cookingforblockheads-forge-1.18.2-12.0.2.jar      |CookingForBlockheads          |cookingforblockheads          |12.0.2              |DONE      |Manifest: NOSIGNATURE
		Controlling-forge-1.18.2-9.0+21.jar               |Controlling                   |controlling                   |9.0+21              |DONE      |Manifest: NOSIGNATURE
		Placebo-1.18.2-6.4.1.jar                          |Placebo                       |placebo                       |6.4.1               |DONE      |Manifest: NOSIGNATURE
		TravelersBackpack-1.18.2-7.1.3.jar                |Traveler's Backpack           |travelersbackpack             |7.1.3               |DONE      |Manifest: NOSIGNATURE
		configured-1.5.3-1.18.2.jar                       |Configured                    |configured                    |1.5.3               |DONE      |Manifest: NOSIGNATURE
		lightmanscurrency-1.18.2-1.1.6.3a.jar             |Lightman's Currency           |lightmanscurrency             |1.18.2-1.1.6.3a     |DONE      |Manifest: NOSIGNATURE
		Bookshelf-Forge-1.18.2-13.2.37.jar                |Bookshelf                     |bookshelf                     |13.2.37             |DONE      |Manifest: eb:c4:b1:67:8b:f9:0c:db:dc:4f:01:b1:8e:61:64:39:4c:10:85:0b:a6:c4:c7:48:f0:fa:95:f2:cb:08:3a:e5
		jeed-1.18.2-1.11.jar                              |Just Enough Effect Description|jeed                          |1.18.2-1.11         |DONE      |Manifest: NOSIGNATURE
		balm-3.1.0+0.jar                                  |Balm                          |balm                          |3.1.0+0             |DONE      |Manifest: NOSIGNATURE
		JEITweaker-1.18.2-3.0.0.8.jar                     |JEI Tweaker                   |jeitweaker                    |3.0.0.8             |DONE      |Manifest: NOSIGNATURE
		VTweaks-1.18.2-3.6.3.jar                          |V-Tweaks                      |vtweaks                       |3.6.3               |DONE      |Manifest: NOSIGNATURE
		Multiworld-Forge-1.4.1.jar                        |Multiworld                    |multiworld                    |1.4.1               |DONE      |Manifest: NOSIGNATURE
		JustEnoughResources-1.18.2-0.14.1.171.jar         |Just Enough Resources         |jeresources                   |0.14.1.171          |DONE      |Manifest: NOSIGNATURE
		CraftTweaker-forge-1.18.2-9.1.164.jar             |CraftTweaker                  |crafttweaker                  |9.1.164             |DONE      |Manifest: NOSIGNATURE
		LuckPerms-Forge-5.4.26.jar                        |LuckPerms                     |luckperms                     |5.4.26              |DONE      |Manifest: NOSIGNATURE
		cloth-config-6.2.62-forge.jar                     |Cloth Config v4 API           |cloth_config                  |6.2.62              |DONE      |Manifest: NOSIGNATURE
		forge-1.18.2-40.1.60-universal.jar                |Forge                         |forge                         |40.1.60             |DONE      |Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90
		VanillaTweaks-forge-1.18.2-1.5.57.jar             |VanillaTweaks                 |vanillatweaks                 |1.5.57              |DONE      |Manifest: NOSIGNATURE
		client-1.18.2-20220404.173914-srg.jar             |Minecraft                     |minecraft                     |1.18.2              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
		mcw-bridges-2.0.3-mc1.18.2.jar                    |Macaw's Bridges               |mcwbridges                    |2.0.3               |DONE      |Manifest: NOSIGNATURE
		logprot-1.18.2-1.6.jar                            |Logprot                       |logprot                       |1.4                 |DONE      |Manifest: NOSIGNATURE
		itlt-1.18.x-2.1.2.jar                             |It's The Little Things        |itlt                          |2.1.2               |DONE      |Manifest: NOSIGNATURE
		voicechat-forge-1.18.2-2.2.49.jar                 |Simple Voice Chat             |voicechat                     |1.18.2-2.2.49       |DONE      |Manifest: NOSIGNATURE
		soundphysics-forge-1.18.2-1.0.6.jar               |Sound Physics Remastered      |sound_physics_remastered      |1.18.2-1.0.6        |DONE      |Manifest: NOSIGNATURE
		BetterCompatibilityChecker-1.1.15-build.29+mc1.18.|Better Compatibility Checker  |bcc                           |1.1.15-build.29+mc1.|DONE      |Manifest: NOSIGNATURE
		theoneprobe-1.18-5.1.0.jar                        |The One Probe                 |theoneprobe                   |1.18-5.1.0          |DONE      |Manifest: NOSIGNATURE
		TerraBlender-forge-1.18.2-1.1.0.102.jar           |TerraBlender                  |terrablender                  |1.18.2-1.1.0.102    |DONE      |Manifest: NOSIGNATURE
		MouseTweaks-forge-mc1.18-2.21.jar                 |Mouse Tweaks                  |mousetweaks                   |2.21                |DONE      |Manifest: NOSIGNATURE
		crashutilities-4.1.jar                            |Crash Utilities               |crashutilities                |4.1                 |DONE      |Manifest: NOSIGNATURE
		Jade-1.18.2-forge-5.2.3.jar                       |Jade                          |jade                          |5.2.3               |DONE      |Manifest: NOSIGNATURE
		appliedenergistics2-11.1.4.jar                    |Applied Energistics 2         |ae2                           |11.1.4              |DONE      |Manifest: NOSIGNATURE
		DeathFinder-v3.2.0-1.18.2-Forge.jar               |Death Finder                  |deathfinder                   |3.2.0               |DONE      |Manifest: 9a:09:85:98:65:c4:8c:11:c5:49:f6:d6:33:23:39:df:8d:b4:ff:92:84:b8:bd:a5:83:9f:ac:7f:2a:d1:4b:6a
		supermartijn642corelib-1.0.19-forge-mc1.18.jar    |SuperMartijn642's Core Lib    |supermartijn642corelib        |1.0.19              |DONE      |Manifest: NOSIGNATURE
		spark-1.9.11-forge.jar                            |spark                         |spark                         |1.9.11              |DONE      |Manifest: NOSIGNATURE
		betterfpsdist-1.18.2-1.5.jar                      |betterfpsdist mod             |betterfpsdist                 |1.18.2-1.5          |DONE      |Manifest: NOSIGNATURE
		flywheel-forge-1.18-0.6.4.jar                     |Flywheel                      |flywheel                      |1.18-0.6.4.87       |DONE      |Manifest: NOSIGNATURE
		create-mc1.18.2_v0.5.0b.jar                       |Create                        |create                        |0.5.0b              |DONE      |Manifest: NOSIGNATURE
		createdeco-1.2.8-1.18.2.jar                       |Create Deco                   |createdeco                    |1.2.8-1.18.2        |DONE      |Manifest: NOSIGNATURE
		Patchouli-1.18.2-71.1.jar                         |Patchouli                     |patchouli                     |1.18.2-71.1         |DONE      |Manifest: NOSIGNATURE
		Mantle-1.18.2-1.9.27.jar                          |Mantle                        |mantle                        |1.9.27              |DONE      |Manifest: NOSIGNATURE
		pamhc2foodcore-1.18.2-1.0.1.jar                   |Pam's HarvestCraft 2 - Food Co|pamhc2foodcore                |1.0.1               |DONE      |Manifest: NOSIGNATURE
		collective-1.18.2-4.28.jar                        |Collective                    |collective                    |4.28                |DONE      |Manifest: NOSIGNATURE
		FastWorkbench-1.18.2-6.0.2.jar                    |Fast Workbench                |fastbench                     |6.0.2               |DONE      |Manifest: NOSIGNATURE
		AutoRegLib-1.7-53.jar                             |AutoRegLib                    |autoreglib                    |1.7-53              |DONE      |Manifest: NOSIGNATURE
		Quark-3.2-358.jar                                 |Quark                         |quark                         |3.2-358             |DONE      |Manifest: NOSIGNATURE
		[1.18.2]+SecurityCraft+v1.9.2.jar                 |SecurityCraft                 |securitycraft                 |1.9.2               |DONE      |Manifest: NOSIGNATURE
		StorageDrawers-1.18.2-10.2.1.jar                  |Storage Drawers               |storagedrawers                |10.2.1              |DONE      |Manifest: NOSIGNATURE
		worldedit-mod-7.2.10.jar                          |WorldEdit                     |worldedit                     |7.2.10+1742f98      |DONE      |Manifest: NOSIGNATURE
		starterkit_1.18.2-3.2.jar                         |Starter Kit                   |starterkit                    |3.2                 |DONE      |Manifest: NOSIGNATURE
		FastFurnace-1.18.2-6.0.3.jar                      |FastFurnace                   |fastfurnace                   |6.0.3               |DONE      |Manifest: NOSIGNATURE
		architectury-4.5.76-forge.jar                     |Architectury                  |architectury                  |4.5.76              |DONE      |Manifest: NOSIGNATURE
		ftb-library-forge-1802.3.6-build.123.jar          |FTB Library                   |ftblibrary                    |1802.3.6-build.123  |DONE      |Manifest: NOSIGNATURE
		ftb-teams-forge-1802.2.6-build.51.jar             |FTB Teams                     |ftbteams                      |1802.2.6-build.51   |DONE      |Manifest: NOSIGNATURE
		ftb-chunks-forge-1802.3.6-build.147.jar           |FTB Chunks                    |ftbchunks                     |1802.3.6-build.147  |DONE      |Manifest: NOSIGNATURE
		ftb-ranks-forge-1802.1.8-build.34.jar             |FTB Ranks                     |ftbranks                      |1802.1.8-build.34   |DONE      |Manifest: NOSIGNATURE
		ftb-essentials-1802.1.7-build.42.jar              |FTB Essentials                |ftbessentials                 |1802.1.7-build.42   |DONE      |Manifest: NOSIGNATURE
		appleskin-forge-mc1.18-2.4.0.jar                  |AppleSkin                     |appleskin                     |2.4.0+mc1.18        |DONE      |Manifest: NOSIGNATURE
		engineersdecor-1.18.2-1.1.23.jar                  |Engineer's Decor              |engineersdecor                |1.1.23              |DONE      |Manifest: bf:30:76:97:e4:58:41:61:2a:f4:30:d3:8f:4c:e3:71:1d:14:c4:a1:4e:85:36:e3:1d:aa:2f:cb:22:b0:04:9b
		PuzzlesLib-v3.3.5-1.18.2-Forge.jar                |Puzzles Lib                   |puzzleslib                    |3.3.5               |DONE      |Manifest: 9a:09:85:98:65:c4:8c:11:c5:49:f6:d6:33:23:39:df:8d:b4:ff:92:84:b8:bd:a5:83:9f:ac:7f:2a:d1:4b:6a
		chunkloaders-1.1.12-mc1.18.jar                    |Chunk Loaders                 |chunkloaders                  |1.1.12              |DONE      |Manifest: NOSIGNATURE
		JadeAddons-1.18.2-2.2.0.jar                       |Jade Addons                   |jadeaddons                    |2.2.0               |DONE      |Manifest: NOSIGNATURE
		geckolib-forge-1.18-3.0.28.jar                    |GeckoLib                      |geckolib3                     |3.0.28              |DONE      |Manifest: NOSIGNATURE
		createaddition-1.18.2-20220712a.jar               |Create Crafts & Additions     |createaddition                |1.18.2-20220712a    |DONE      |Manifest: NOSIGNATURE
		BetterAdvancements-1.18.2-0.2.1.132.jar           |Better Advancements           |betteradvancements            |0.2.1.132           |DONE      |Manifest: NOSIGNATURE
	Crash Report UUID: d3e01514-8fb1-47bd-8b56-b2182c4b8d2f
	FML: 40.1
	Forge: net.minecraftforge:40.1.60
	Flywheel Backend: GL33 Instanced Arrays

 

  • 2 weeks later...
Posted
3 hours ago, Jubby said:

Yeah but, What if you want optifine on it. You  just can't?

im not sure if you can go down but my recomendation and what im going to do for when the servers are back up is to downgrade to 40.0.24 which is, as i believe, is the highest compatable fml version for the latest Optifine for 1.18.2

Posted

It is 40.1.57 that is compatible, anything after that hits this problem:

https://github.com/sp614x/optifine/issues/6974

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

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

    • 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() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

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