Jump to content

Recommended Posts

Posted

please, I need help.

 

---- Minecraft Crash Report ----

WARNING: coremods are present:
  AstralCore (astralsorcery-1.12.2-1.10.3.jar)
  MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.1.181.jar)
  CTMCorePlugin (CTM-MC1.12.2-0.3.2.18.jar)
Contact their authors BEFORE contacting forge

// I'm sorry, Dave.

Time: 11/11/18 3:57 PM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from CTM (ctm)
Caused by: java.lang.VerifyError: Inconsistent stackmap frames at branch target 116
Exception Details:
  Location:
    net/minecraftforge/client/model/ModelLoader$VanillaModelWrapper.getTextures()Ljava/util/Collection; @116: invokestatic
  Reason:
    Type 'net/minecraftforge/client/model/IModel' (current frame, locals[1]) is not assignable to 'net/minecraft/util/ResourceLocation' (stack map, locals[1])
  Current Frame:
    bci: @14
    flags: { }
    locals: { 'net/minecraftforge/client/model/ModelLoader$VanillaModelWrapper', 'net/minecraftforge/client/model/IModel' }
    stack: { 'net/minecraftforge/client/model/IModel' }
  Stackmap Frame:
    bci: @116
    flags: { }
    locals: { 'net/minecraftforge/client/model/ModelLoader$VanillaModelWrapper', 'net/minecraft/util/ResourceLocation' }
    stack: { }
  Bytecode:
    0x0000000: 2ab4 0044 b600 9b4c 2bb8 00b5 4c2b c600
    0x0000010: 662a b400 44b4 00b8 c700 5c2b b600 9e12
    0x0000020: bab6 00bb 9900 102a b400 44b8 00bf b500
    0x0000030: b8a7 0043 2ab4 0044 2bbb 0080 59b7 0081
    0x0000040: 12c1 b600 872b b600 8a12 c3b6 0087 2ab4
    0x0000050: 0044 b600 8a12 c5b6 0087 b600 8db8 0093
    0x0000060: b900 c901 002a ba00 db00 00b6 00e1 c000
    0x0000070: 54b5 00b8 b800 e54d 2ab4 003d 2ab4 0044
    0x0000080: b800 e999 004a b200 efb9 00f2 0100 4e2d
    0x0000090: b900 6501 0099 0038 2db9 0069 0100 c000
    0x00000a0: a23a 042a b400 4419 04b6 00f6 3a05 bb00
    0x00000b0: 6b59 1905 b700 f93a 0619 0519 04b6 00bb
    0x00000c0: 9a00 0a2c 1906 b600 fc57 a7ff c52a b400
    0x00000d0: 44b4 0100 b901 0301 00b9 005d 0100 4e2d
    0x00000e0: b900 6501 0099 002a 2db9 0069 0100 c000
    0x00000f0: a23a 0419 0413 0105 b600 a69a 0011 2cbb
    0x0000100: 006b 5919 04b7 00f9 b600 fc57 a7ff d32c
    0x0000110: b601 09b0                              
  Stackmap Table:
    append_frame(@52,Object[#107])
    same_frame(@116)
    append_frame(@143,Object[#14],Object[#97])
    same_frame(@202)
    chop_frame(@205,1)
    append_frame(@223,Object[#97])
    same_frame(@268)
    chop_frame(@271,1)

    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at team.chisel.ctm.client.util.TextureMetadataHandler.<clinit>(TextureMetadataHandler.java:102)
    at team.chisel.ctm.CTM.preInit(CTM.java:43)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:624)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
    at com.google.common.eventbus.EventBus.post(EventBus.java:217)
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218)
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
    at com.google.common.eventbus.EventBus.post(EventBus.java:217)
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135)
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:627)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:466)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377)
    at net.minecraft.client.main.Main.main(SourceFile:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


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

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 320998216 bytes (306 MB) / 872415232 bytes (832 MB) up to 2147483648 bytes (2048 MB)
    JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.5.2772 Optifine OptiFine_1.12.2_HD_U_E2 51 mods loaded, 51 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

    | State | ID                  | Version           | Source                                          | Signature                                |
    |:----- |:------------------- |:----------------- |:----------------------------------------------- |:---------------------------------------- |
    | UCH   | minecraft           | 1.12.2            | minecraft.jar                                   | None                                     |
    | UCH   | mcp                 | 9.42              | minecraft.jar                                   | None                                     |
    | UCH   | FML                 | 8.0.99.99         | forge-1.12.2-14.23.5.2772.jar                   | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | UCH   | forge               | 14.23.5.2772      | forge-1.12.2-14.23.5.2772.jar                   | e3c3d50c7c986df74c645c0ac54639741c90a557 |
    | UCH   | micdoodlecore       |                   | minecraft.jar                                   | None                                     |
    | UCH   | actuallyadditions   | 1.12.2-r143       | ActuallyAdditions-1.12.2-r143.jar               | None                                     |
    | UCH   | appliedenergistics2 | rv6-stable-3      | appliedenergistics2-rv6-stable-3.jar            | dfa4d3ac143316c6f32aa1a1beda1e34d42132e5 |
    | UCH   | baubles             | 1.5.2             | Baubles-1.12-1.5.2.jar                          | None                                     |
    | UCH   | astralsorcery       | 1.10.3            | astralsorcery-1.12.2-1.10.3.jar                 | a0f0b759d895c15ceb3e3bcb5f3c2db7c582edf0 |
    | UCH   | biomesoplenty       | 7.0.1.2399        | BiomesOPlenty-1.12.2-7.0.1.2399-universal.jar   | None                                     |
    | UCH   | bookshelf           | 2.3.567           | Bookshelf-1.12.2-2.3.567.jar                    | d476d1b22b218a10d845928d1665d45fce301b27 |
    | UCH   | jei                 | 4.13.1.222        | jei_1.12.2-4.13.1.222.jar                       | None                                     |
    | UCH   | thaumcraft          | 6.1.BETA26        | Thaumcraft-1.12.2-6.1.BETA26.jar                | None                                     |
    | UCH   | botania             | r1.10-357         | Botania+r1.10-357.jar                           | None                                     |
    | UCH   | buildcraftlib       | 7.99.19           | buildcraft-7.99.19.jar                          | None                                     |
    | UCH   | buildcraftcore      | 7.99.19           | buildcraft-7.99.19.jar                          | None                                     |
    | UCH   | buildcraftbuilders  | 7.99.19           | buildcraft-7.99.19.jar                          | None                                     |
    | UCH   | buildcraftenergy    | 7.99.19           | buildcraft-7.99.19.jar                          | None                                     |
    | UCH   | buildcraftfactory   | 7.99.19           | buildcraft-7.99.19.jar                          | None                                     |
    | UCH   | buildcraftrobotics  | 7.99.19           | buildcraft-7.99.19.jar                          | None                                     |
    | UCH   | buildcrafttransport | 7.99.19           | buildcraft-7.99.19.jar                          | None                                     |
    | UCH   | buildcraftsilicon   | 7.99.19           | buildcraft-7.99.19.jar                          | None                                     |
    | UCEE  | ctm                 | MC1.12.2-0.3.2.18 | CTM-MC1.12.2-0.3.2.18.jar                       | None                                     |
    | UC    | chisel              | MC1.12.2-0.2.1.35 | Chisel-MC1.12.2-0.2.1.35.jar                    | None                                     |
    | UC    | codechickenlib      | 3.2.2.353         | CodeChickenLib-1.12.2-3.2.2.353-universal.jar   | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
    | UC    | redstoneflux        | 2.1.0             | RedstoneFlux-1.12-2.1.0.6-universal.jar         | 8a6abf2cb9e141b866580d369ba6548732eff25f |
    | UC    | cofhcore            | 4.6.1             | CoFHCore-1.12.2-4.6.1.22-universal (1).jar      | None                                     |
    | UC    | cofhworld           | 1.2.0             | CoFHWorld-1.12.2-1.2.0.5-universal.jar          | 8a6abf2cb9e141b866580d369ba6548732eff25f |
    | UC    | customspawner       | 3.11.4            | CustomMobSpawner-3.11.4.jar                     | None                                     |
    | UC    | mocreatures         | 12.0.5            | DrZharks+MoCreatures+Mod-12.0.5.jar             | None                                     |
    | UC    | durabilityviewer    | 1.4               | DurabilityViewer-1.12-forge14.21.1.2387-1.4.jar | None                                     |
    | UC    | eplus               | 5.0.174           | EnchantingPlus-1.12.2-5.0.174.jar               | d476d1b22b218a10d845928d1665d45fce301b27 |
    | UC    | mantle              | 1.12-1.3.2.24     | Mantle-1.12-1.3.2.24.jar                        | None                                     |
    | UC    | tconstruct          | 1.12.2-2.10.1.87  | TConstruct-1.12.2-2.10.1.87.jar                 | None                                     |
    | UC    | extrautils2         | 1.0               | extrautils2-1.12-1.9.8.jar                      | None                                     |
    | UC    | natura              | 1.12.2-4.3.2.62   | natura-1.12.2-4.3.2.62.jar                      | None                                     |
    | UC    | forestry            | 5.8.1.350         | forestry_1.12.2-5.8.1.350.jar                   | None                                     |
    | UC    | galacticraftcore    | 4.0.1.181         | GalacticraftCore-1.12.2-4.0.1.181.jar           | None                                     |
    | UC    | holoinventory       | 2.1.1.151         | HoloInventory-1.12.2-2.1.1.151.jar              | None                                     |
    | UC    | waila               | 1.8.26            | Hwyla-1.8.26-B41_1.12.2.jar                     | None                                     |
    | UC    | ironchest           | 1.12.2-7.0.52.837 | ironchest-1.12.2-7.0.52.837.jar                 | None                                     |
    | UC    | ironfurnaces        | 1.3.1             | ironfurnaces-1.3.1.jar                          | None                                     |
    | UC    | irontanks           | 2.1.0-beta.5      | irontanks-2.1.0-beta.5.jar                      | None                                     |
    | UC    | journeymap          | 1.12.2-5.5.2      | journeymap-1.12.2-5.5.2.jar                     | None                                     |
    | UC    | skylands            | 1.5.5             | skylands-1.5.5.jar                              | None                                     |
    | UC    | thermalfoundation   | 2.6.1             | ThermalFoundation-1.12.2-2.6.1.22-universal.jar | 8a6abf2cb9e141b866580d369ba6548732eff25f |
    | UC    | thermalexpansion    | 5.5.2             | ThermalExpansion-1.12.2-5.5.2.39-universal.jar  | 8a6abf2cb9e141b866580d369ba6548732eff25f |
    | UC    | treechopper         | 1.2.4             | TreeChopper-1.12.2-1.2.4.jar                    | None                                     |
    | UC    | uteamcore           | 2.0.2.84          | u_team_core-1.12.2-2.0.2.84.jar                 | None                                     |
    | UC    | usefulbackpacks     | 1.3.1.12          | useful_backpacks-1.12.2-1.3.1.12.jar            | None                                     |
    | UC    | waystones           | 4.0.67            | Waystones_1.12.2-4.0.67.jar                     | None                                     |

    Loaded coremods (and transformers): 
AstralCore (astralsorcery-1.12.2-1.10.3.jar)
  
MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.1.181.jar)
  micdoodle8.mods.miccore.MicdoodleTransformer
CTMCorePlugin (CTM-MC1.12.2-0.3.2.18.jar)
  team.chisel.ctm.client.asm.CTMTransformer
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 388.13' Renderer: 'GeForce GTX 1080/PCIe/SSE2'
    AE2 Version: stable rv6-stable-3 for Forge 14.23.5.2768
    Pulsar/tconstruct loaded Pulses: 
        - TinkerCommons (Enabled/Forced)
        - TinkerWorld (Enabled/Not Forced)
        - TinkerTools (Enabled/Not Forced)
        - TinkerHarvestTools (Enabled/Forced)
        - TinkerMeleeWeapons (Enabled/Forced)
        - TinkerRangedWeapons (Enabled/Forced)
        - TinkerModifiers (Enabled/Forced)
        - TinkerSmeltery (Enabled/Not Forced)
        - TinkerGadgets (Enabled/Not Forced)
        - TinkerOredict (Enabled/Forced)
        - TinkerIntegration (Enabled/Forced)
        - TinkerFluids (Enabled/Forced)
        - TinkerMaterials (Enabled/Forced)
        - TinkerModelRegister (Enabled/Forced)
        - chiselIntegration (Enabled/Not Forced)
        - wailaIntegration (Enabled/Not Forced)

    Pulsar/natura loaded Pulses: 
        - NaturaCommons (Enabled/Forced)
        - NaturaOverworld (Enabled/Not Forced)
        - NaturaNether (Enabled/Not Forced)
        - NaturaDecorative (Enabled/Not Forced)
        - NaturaTools (Enabled/Not Forced)
        - NaturaEntities (Enabled/Not Forced)
        - NaturaOredict (Enabled/Forced)
        - NaturaWorld (Enabled/Not Forced)

    OptiFine Version: OptiFine_1.12.2_HD_U_E2
    OptiFine Build: 20180728-185429
    Render Distance Chunks: 8
    Mipmaps: 4
    Anisotropic Filtering: 1
    Antialiasing: 0
    Multitexture: false
    Shaders: null
    OpenGlVersion: 4.6.0 NVIDIA 388.13
    OpenGlRenderer: GeForce GTX 1080/PCIe/SSE2
    OpenGlVendor: NVIDIA Corporation
    CpuCount: 8

Posted

Make sure the mod is the latest version, if you have a new problem please make a new topic

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.