Jump to content

[1.8] [Solved] Packet Issue


delpi

Recommended Posts

I followed a combo of these two tutorials and some general reading, plus previous experience.

 

http://www.minecraftforge.net/forum/index.php/topic,20135.0.html]]http://www.minecraftforge.net/forum/index.php/topic,20135.0.html '>

https://gist.github.com/CatDany/4a3df7fcb3c8270cf70b

 

I'm pretty stumped right now.  Any Help would be appreciated.

 

I'm getting a crash in the SimpleNetworkWrapper.  Log isn't much help on this one but i traced the error in debug to the following spoiler section.  I'm going to admit I don't get what that section of code does 100%.  however, it fails when it gets to the "return handler.newInstance();" portion.  If i check the newInstance and try to go to it in Eclipse, I get "Source not Found".  I'm using 1.7.  Can see all other source, not sure what the issue is with that.  Perhaps I'm missing something in the setup?

 

 

 

 

Main Class Call in PreInit

 

 

 

PacketHandler

 

 

package clandoolittle.custom_npc.Common.Utilities.Networking;

 

import clandoolittle.custom_npc.Custom_NPC;

import clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Faction_List;

import clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Faction_Member;

import clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Faction_Name;

import clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Particle;

import clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Spawner_Destination;

import clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Spawner_Faction;

import clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Spawner_Target;

import clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Spawner_Type;

import net.minecraftforge.fml.relauncher.Side;

 

 

public class PacketHandler {

 

// Setup Variables

    Custom_NPC instance = Custom_NPC.instance;

 

// Setup individual Variables

private int packetID= 0;

 

public void initPackets() {

 

// Register Packets

registerMessage (Faction_List.class, Faction_List.Handler.class);

registerMessage (Faction_Member.class, Faction_Member.Handler.class);

registerMessage (Faction_Name.class, Faction_Name.Handler.class);

registerMessage (Particle.class, Particle.Handler.class);

registerMessage (Spawner_Destination.class, Spawner_Destination.Handler.class);

registerMessage (Spawner_Faction.class, Spawner_Faction.Handler.class);

registerMessage (Spawner_Target.class, Spawner_Target.Handler.class);

registerMessage (Spawner_Type.class, Spawner_Type.Handler.class);

 

}

 

private void registerMessage(Class message, Class packet) {

 

// Register packet on both sides

instance.simpleNetworkWrapper().registerMessage(packet, message, packetID, Side.CLIENT);

instance.simpleNetworkWrapper().registerMessage(packet, message, packetID, Side.SERVER);

   

    // Incriment ID

    packetID++;

 

}

 

}

 

 

 

I tried commenting out the first line in "registerMessage" just to make sure the side didn't make a difference.  It didn't.

 

Faction_List (this is the first one and the one it fails on)

 

 

package clandoolittle.custom_npc.Common.Utilities.Networking.Packets;

 

import java.util.ArrayList;

import java.util.HashMap;

import java.util.List;

import java.util.Map.Entry;

 

import clandoolittle.custom_npc.Custom_NPC;

import clandoolittle.custom_npc.Common.Factions.Faction.Faction;

import io.netty.buffer.ByteBuf;

import net.minecraftforge.fml.common.network.ByteBufUtils;

import net.minecraftforge.fml.common.network.simpleimpl.IMessage;

import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;

import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

 

public class Faction_List implements IMessage {

 

// Setup Instance

    public static Custom_NPC instance = Custom_NPC.instance;

 

// Setup Variables

    private HashMap<String, Faction> factions = new HashMap<String, Faction>();

 

public Faction_List() {

 

}

 

public Faction_List(HashMap<String, Faction> factions) {

 

// Initialize variables

this.factions.putAll(factions);

 

}

 

@Override

public void fromBytes(ByteBuf buffer) {

 

// Clear old faction list

        factions.clear();

       

        // get count of factions

        int i_max = buffer.readInt();

 

        for (int i = 0; i < i_max; i++) {

       

            // Read faction name

            String faction = ByteBufUtils.readUTF8String(buffer);

           

            // Setup member variable

            List<String> members = new ArrayList<String>();

           

            // Get count of members

            int j_max = buffer.readInt();

 

            // Cycle through the specified member names

            for (int j = 0; j < j_max; j++) {

           

            // Get the member name

                String member = ByteBufUtils.readUTF8String(buffer);

 

                // Add to list if not already there

                if (!members.contains(member)) {

               

                    members.add(member);

                   

                }

               

            }

           

            // Build the faction and add it

            Faction faction_object = new Faction();

            faction_object.members_add(members);

            factions.put(faction, faction_object);

           

        }

 

}

 

@Override

public void toBytes(ByteBuf buffer) {

 

// Write the faction count

buffer.writeInt(factions.size());

 

// Loop through each faction

        for (Entry<String, Faction> item : factions.entrySet()) {

       

        // Write the name of the faction

        ByteBufUtils.writeUTF8String(buffer, item.getKey());

       

          // Write the size of the members

        buffer.writeInt(item.getValue().members().size());

 

            // Loop through each members

            for (String item_sub: item.getValue().members()) {

           

                ByteBufUtils.writeUTF8String(buffer, item_sub);

               

            }

           

        }

 

}

 

 

public class Handler implements IMessageHandler<Faction_List, IMessage> {

       

// Receive the message

        @Override

        public IMessage onMessage(Faction_List message, MessageContext ctx) {

       

        // Determine side

        if (ctx.side.isClient()) {

       

        // Clear out old factions list

        instance.faction_manager().faction_clear();

       

        // Add the new factions list

        instance.faction_manager().faction_update(factions);

       

       

        } else {

       

       

        }

       

        // Default Return

        return null;

 

        }

       

    }

 

}

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

I tried that, made no difference.  Besides in a conversation between diesieben07 and coolAlias it was clearly stated that you could.  Dany's example shows it as well. 

 

Here is the crash log

 

 

 

[12:51:38] [main/INFO] [GradleStart]: Extra: []

[12:51:38] [main/INFO] [GradleStart]: Running with arguments: [--tweakClass, net.minecraftforge.fml.common.launcher.FMLServerTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[12:51:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker

[12:51:38] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker

[12:51:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[12:51:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker

[12:51:38] [main/INFO] [FML]: Forge Mod Loader version 8.0.37.1334 for Minecraft 1.8 loading

[12:51:38] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_79, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7

[12:51:38] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[12:51:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[12:51:38] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[12:51:38] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[12:51:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[12:51:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[12:51:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[12:51:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[12:51:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[12:51:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[12:51:39] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[12:51:41] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[12:51:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[12:51:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[12:51:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[12:51:41] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[12:51:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[12:51:41] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer}

[12:51:44] [server thread/INFO]: Starting minecraft server version 1.8

[12:51:44] [server thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[12:51:44] [server thread/INFO] [FML]: MinecraftForge v11.14.1.1334 Initialized

[12:51:44] [server thread/INFO] [FML]: Replaced 204 ore recipies

[12:51:44] [server thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[12:51:44] [server thread/INFO] [FML]: Searching E:\Desktop Drop\Forge MOD\Forge-1.8-11.14.1.1334\run\mods for mods

[12:51:46] [server thread/INFO] [FML]: Forge Mod Loader has identified 6 mods to load

[12:51:46] [server thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, dimension_manager, permissions, custom_npc] at CLIENT

[12:51:46] [server thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, dimension_manager, permissions, custom_npc] at SERVER

[12:51:47] [server thread/ERROR] [dimension_manager]: The mod dimension_manager appears to have an invalid event annotation EventHandler. This annotation can only apply to methods with recognized event arguments - it will not be called

[12:51:47] [server thread/ERROR] [permissions]: The mod permissions appears to have an invalid event annotation EventHandler. This annotation can only apply to methods with recognized event arguments - it will not be called

[12:51:47] [server thread/ERROR] [custom_npc]: The mod custom_npc appears to have an invalid event annotation EventHandler. This annotation can only apply to methods with recognized event arguments - it will not be called

[12:51:47] [server thread/INFO] [FML]: Processing ObjectHolder annotations

[12:51:47] [server thread/INFO] [FML]: Found 384 ObjectHolder annotations

[12:51:47] [server thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[12:51:47] [server thread/INFO] [FML]: Applying holder lookups

[12:51:47] [server thread/INFO] [FML]: Holder lookups applied

[12:51:47] [server thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue

[12:51:47] [server thread/ERROR] [FML]:

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized

FML{8.0.37.1334} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed->Pre-initialized

Forge{11.14.1.1334} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed->Pre-initialized

dimension_manager{1.1} [Dimension Manager] (bin) Unloaded->Constructed->Pre-initialized

permissions{1.2} [Permissions] (bin) Unloaded->Constructed->Pre-initialized

custom_npc{1.1} [Custom NPC] (bin) Unloaded->Constructed->Errored

[12:51:47] [server thread/ERROR] [FML]: The following problems were captured during this phase

[12:51:47] [server thread/ERROR] [FML]: Caught exception from custom_npc

java.lang.RuntimeException: java.lang.InstantiationException: clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Faction_List$Handler

at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:116) ~[simpleNetworkWrapper.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:106) ~[simpleNetworkWrapper.class:?]

at clandoolittle.custom_npc.Common.Utilities.Networking.PacketHandler.registerMessage(PacketHandler.java:40) ~[PacketHandler.class:?]

at clandoolittle.custom_npc.Common.Utilities.Networking.PacketHandler.initPackets(PacketHandler.java:26) ~[PacketHandler.class:?]

at clandoolittle.custom_npc.Custom_NPC.preInit(Custom_NPC.java:152) ~[Custom_NPC.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_79]

at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518) ~[FMLModContainer.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_79]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?]

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_79]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?]

at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:514) [Loader.class:?]

at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88) [FMLServerHandler.class:?]

at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:355) [FMLCommonHandler.class:?]

at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:120) [DedicatedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:500) [MinecraftServer.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.7.0_79]

Caused by: java.lang.InstantiationException: clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Faction_List$Handler

at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_79]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:113) ~[simpleNetworkWrapper.class:?]

... 36 more

[12:51:47] [server thread/ERROR]: Encountered an unexpected exception

java.lang.RuntimeException: java.lang.InstantiationException: clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Faction_List$Handler

at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:116) ~[simpleNetworkWrapper.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:106) ~[simpleNetworkWrapper.class:?]

at clandoolittle.custom_npc.Common.Utilities.Networking.PacketHandler.registerMessage(PacketHandler.java:40) ~[PacketHandler.class:?]

at clandoolittle.custom_npc.Common.Utilities.Networking.PacketHandler.initPackets(PacketHandler.java:26) ~[PacketHandler.class:?]

at clandoolittle.custom_npc.Custom_NPC.preInit(Custom_NPC.java:152) ~[Custom_NPC.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_79]

at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518) ~[FMLModContainer.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_79]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?]

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_79]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) ~[LoadController.class:?]

at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:514) ~[Loader.class:?]

at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88) ~[FMLServerHandler.class:?]

at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:355) ~[FMLCommonHandler.class:?]

at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:120) ~[DedicatedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:500) [MinecraftServer.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.7.0_79]

Caused by: java.lang.InstantiationException: clandoolittle.custom_npc.Common.Utilities.Networking.Packets.Faction_List$Handler

at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_79]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:113) ~[simpleNetworkWrapper.class:?]

... 36 more

[12:51:47] [server thread/ERROR]: This crash report has been saved to: E:\Desktop Drop\Forge MOD\Forge-1.8-11.14.1.1334\run\.\crash-reports\crash-2015-07-11_12.51.47-server.txt

 

 

 

As mentioned, it doesn't show much of use.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

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

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

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