Jump to content

Recommended Posts

Posted

---- Minecraft Crash Report ----
// Why did you do that?

Time: 2023-11-01 14:47:48
Description: Rendering overlay

java.lang.IllegalStateException: Failed to create model for minecraft:hanging_sign
    at net.minecraft.client.renderer.blockentity.BlockEntityRenderers.m_257086_(BlockEntityRenderers.java:26) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603) ~[?:?] {}
    at net.minecraft.client.renderer.blockentity.BlockEntityRenderers.m_173598_(BlockEntityRenderers.java:22) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher.m_6213_(BlockEntityRenderDispatcher.java:125) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:supplementaries.mixins.json:BlockEntityRendererDispatcherMixin,pl:mixin:APP:entityculling.mixins.json:BlockEntityRenderDispatcherMixin,pl:mixin:A}
    at net.minecraft.server.packs.resources.ResourceManagerReloadListener.m_10759_(ResourceManagerReloadListener.java:15) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading,re:mixin}
    at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:787) ~[?:?] {}
    at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] {}
    at net.minecraft.server.packs.resources.SimpleReloadInstance.m_143940_(SimpleReloadInstance.java:69) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading}
    at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,re:computing_frames,re:classloading}
    at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:115) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
    at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1108) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:accessors.client.AccessorMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:immersive_armors.mixins.json:MixinMinecraftClient,pl:mixin:APP:konkrete.mixin.json:MixinMinecraft,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:cgm.mixins.json:client.MinecraftMixin,pl:mixin:APP:bettercombat.mixins.json:client.MinecraftClientAccessor,pl:mixin:APP:bettercombat.mixins.json:client.MinecraftClientInject,pl:mixin:APP:iceberg.mixins.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:719) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:accessors.client.AccessorMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:immersive_armors.mixins.json:MixinMinecraftClient,pl:mixin:APP:konkrete.mixin.json:MixinMinecraft,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:cgm.mixins.json:client.MinecraftMixin,pl:mixin:APP:bettercombat.mixins.json:client.MinecraftClientAccessor,pl:mixin:APP:bettercombat.mixins.json:client.MinecraftClientInject,pl:mixin:APP:iceberg.mixins.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:205) ~[forge-45.2.0.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
    at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.4-45.2.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] {}
Caused by: java.lang.IllegalArgumentException: No model for layer supplementaries:hanging_sign_extension#hanging_sign_extension
    at net.minecraft.client.model.geom.EntityModelSet.m_171103_(EntityModelSet.java:17) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading}
    at net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider$Context.m_173582_(BlockEntityRendererProvider.java:52) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,re:classloading}
    at net.minecraft.client.renderer.blockentity.HangingSignRenderer.handler$zhe000$initEnhancedSign(HangingSignRenderer.java:569) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,re:classloading,pl:mixin:APP:supplementaries-common.mixins.json:HangingSignRendererMixin,pl:mixin:A}
    at net.minecraft.client.renderer.blockentity.HangingSignRenderer.<init>(HangingSignRenderer.java:49) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,re:classloading,pl:mixin:APP:supplementaries-common.mixins.json:HangingSignRendererMixin,pl:mixin:A}
    at net.minecraft.client.renderer.blockentity.BlockEntityRenderers.m_257086_(BlockEntityRenderers.java:24) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    ... 27 more


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

-- Head --
Thread: Render thread
Stacktrace:
    at net.minecraft.client.renderer.blockentity.BlockEntityRenderers.m_257086_(BlockEntityRenderers.java:26) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603) ~[?:?] {}
    at net.minecraft.client.renderer.blockentity.BlockEntityRenderers.m_173598_(BlockEntityRenderers.java:22) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher.m_6213_(BlockEntityRenderDispatcher.java:125) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:supplementaries.mixins.json:BlockEntityRendererDispatcherMixin,pl:mixin:APP:entityculling.mixins.json:BlockEntityRenderDispatcherMixin,pl:mixin:A}
    at net.minecraft.server.packs.resources.ResourceManagerReloadListener.m_10759_(ResourceManagerReloadListener.java:15) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading,re:mixin}
    at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:787) ~[?:?] {}
    at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] {}
    at net.minecraft.server.packs.resources.SimpleReloadInstance.m_143940_(SimpleReloadInstance.java:69) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:classloading}
    at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,re:computing_frames,re:classloading}
    at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
-- Overlay render details --
Details:
    Overlay name: net.minecraft.client.gui.screens.LoadingOverlay
Stacktrace:
    at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:943) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:supplementaries-common.mixins.json:GameRendererMixin,pl:mixin:APP:tombstone.mixins.json:GameRendererMixin,pl:mixin:APP:cgm.mixins.json:client.GameRendererMixin,pl:mixin:APP:jade.mixins.json:GameRendererMixin,pl:mixin:A,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1148) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:accessors.client.AccessorMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:immersive_armors.mixins.json:MixinMinecraftClient,pl:mixin:APP:konkrete.mixin.json:MixinMinecraft,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:cgm.mixins.json:client.MinecraftMixin,pl:mixin:APP:bettercombat.mixins.json:client.MinecraftClientAccessor,pl:mixin:APP:bettercombat.mixins.json:client.MinecraftClientInject,pl:mixin:APP:iceberg.mixins.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:719) ~[client-1.19.4-20230314.122934-srg.jar%23388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:accessors.client.AccessorMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:immersive_armors.mixins.json:MixinMinecraftClient,pl:mixin:APP:konkrete.mixin.json:MixinMinecraft,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:cgm.mixins.json:client.MinecraftMixin,pl:mixin:APP:bettercombat.mixins.json:client.MinecraftClientAccessor,pl:mixin:APP:bettercombat.mixins.json:client.MinecraftClientInject,pl:mixin:APP:iceberg.mixins.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:205) ~[forge-45.2.0.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
    at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.4-45.2.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.8.jar:?] {}
    at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] {}


-- Last reload --
Details:
    Reload number: 1
    Reload reason: initial
    Finished: No
    Packs: vanilla

-- System Details --
Details:
    Minecraft Version: 1.19.4
    Minecraft Version ID: 1.19.4
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 17.0.8, Microsoft
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
    Memory: 898616912 bytes (856 MiB) / 1944059904 bytes (1854 MiB) up to 4294967296 bytes (4096 MiB)
    CPUs: 12
    Processor Vendor: GenuineIntel
    Processor Name: 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz
    Identifier: Intel64 Family 6 Model 141 Stepping 1
    Microarchitecture: unknown
    Frequency (GHz): 2.69
    Number of physical packages: 1
    Number of physical CPUs: 6
    Number of logical CPUs: 12
    Graphics card #0 name: NVIDIA GeForce RTX 3050 Laptop GPU
    Graphics card #0 vendor: NVIDIA (0x10de)
    Graphics card #0 VRAM (MB): 4095.00
    Graphics card #0 deviceId: 0x25a2
    Graphics card #0 versionInfo: DriverVersion=31.0.15.1720
    Graphics card #1 name: Intel(R) UHD Graphics
    Graphics card #1 vendor: Intel Corporation (0x8086)
    Graphics card #1 VRAM (MB): 1024.00
    Graphics card #1 deviceId: 0x9a68
    Graphics card #1 versionInfo: DriverVersion=31.0.101.3413
    Memory slot #0 capacity (MB): 8192.00
    Memory slot #0 clockSpeed (GHz): 3.20
    Memory slot #0 type: DDR4
    Memory slot #1 capacity (MB): 8192.00
    Memory slot #1 clockSpeed (GHz): 3.20
    Memory slot #1 type: DDR4
    Virtual memory max (MB): 17130.77
    Virtual memory used (MB): 12588.26
    Swap memory total (MB): 1024.00
    Swap memory used (MB): 67.43
    JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx4096m -Xms256m
    Launched Version: forge-45.2.0
    Backend library: LWJGL version 3.3.1 build 7
    Backend API: Intel(R) UHD Graphics GL version 3.2.0 - Build 31.0.101.3413, Intel
    Window size: 1024x768
    GL Caps: Using framebuffer using OpenGL 3.2
    GL debug messages: 
    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'forge'
    Type: Client (map_client.txt)
    Graphics mode: fancy
    Resource Packs: 
    Current Language: en_us
    CPU: 12x 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz
    ModLauncher: 10.0.8+10.0.8+main.0ef7e830
    ModLauncher launch target: forgeclient
    ModLauncher naming: srg
    ModLauncher services: 
        mixin-0.8.5.jar mixin PLUGINSERVICE 
        eventbus-6.0.3.jar eventbus PLUGINSERVICE 
        fmlloader-1.19.4-45.2.0.jar slf4jfixer PLUGINSERVICE 
        fmlloader-1.19.4-45.2.0.jar object_holder_definalize PLUGINSERVICE 
        fmlloader-1.19.4-45.2.0.jar runtime_enum_extender PLUGINSERVICE 
        fmlloader-1.19.4-45.2.0.jar capability_token_subclass PLUGINSERVICE 
        accesstransformers-8.0.4.jar accesstransformer PLUGINSERVICE 
        fmlloader-1.19.4-45.2.0.jar runtimedistcleaner PLUGINSERVICE 
        modlauncher-10.0.8.jar mixin TRANSFORMATIONSERVICE 
        modlauncher-10.0.8.jar fml TRANSFORMATIONSERVICE 
    FML Language Providers: 
        [email protected]
        lowcodefml@null
        javafml@null
    Mod List: 
        client-1.19.4-20230314.122934-srg.jar             |Minecraft                     |minecraft                     |1.19.4              |NONE      |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
        forge-1.19.4-45.2.0-universal.jar                 |Forge                         |forge                         |45.2.0              |NONE      |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

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.