Jump to content

Extended Properties Crash on external Server while working in eclipse


Recommended Posts

Posted

Heyho Guys!

I created a extendedProperties class. When an EntityConstructingEvent is fired for a player, these properties are assigned to him. While initializing the properties, a array list is created.

When an EntityJoinWorldEvent is then fired for the player, an update package is sent to the client side.

 

This works fine on a Server started by Eclipse. But the compiled mod on a server crashes because the array list is null. Why can this happen?! The EntityConstructing is fired before and had no errors.

Posted

Extended Properties:

 

public class PropertiesElements implements IExtendedEntityProperties {

private EntityPlayer entity;
private boolean serverSide;

public PropertiesElements(EntityPlayer entity) {
	this.entity = entity;
	this.serverSide = entity instanceof EntityPlayerMP;
	this.activeElements = new ArrayList<Elements>(); //"Elements" is a enum I use
	this.cooldown = new int[10];
}

private List<Elements> activeElements;
private int[] cooldown;

//...

//Getter and Setter

public void updateElements() { //Called while EntityJoinEvent is active
	if (this.serverSide) {
		Main.packetHandler.sendTo(new PropertiesElementsPacket(this.getActiveElements()), (EntityPlayerMP) this.entity);
	}
}

public List<Elements> getActiveElements() { //Called by updateElements()
	Main.log("ArrayList == null ? " + (this.activeElements == null)); //Prints out true!
	return new ArrayList<Elements>(this.activeElements); //Here it crashes!
}
}

 

 

EventHandler:

@SubscribeEvent
public void onEntityConstructing(EntityConstructing e) {
	if (e.entity instanceof EntityPlayer) {
		Main.log("Called Constructing");
		e.entity.registerExtendedProperties(PropertiesElements.IDENTIFIER, new PropertiesElements((EntityPlayer) e.entity));
	}
}

@SubscribeEvent
public void onEntityJoinWorld(EntityJoinWorldEvent e) {
	if (!e.world.isRemote && e.entity instanceof EntityPlayer) {
		Main.log("Called Join for " + e.entity.getCommandSenderName());
		PropertiesElements.get((EntityPlayer) e.entity).updateElements();
	}
}

 

 

Both of the events are called, the constructing event first, then the join event.

Posted

Are the packets really that important? It crashes before the first one is sent...

 

PropertiesElementsPacket:

 

public class PropertiesElementsPacket extends BasePacket {

private List<Elements> elements;

public PropertiesElementsPacket() {}

public PropertiesElementsPacket(List<Elements> elements) {
	this.elements = new ArrayList<Elements>(elements);
}

@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
	buffer.writeByte(this.elements.size());
	for (Elements e : this.elements) {
		buffer.writeByte(e.getID());
	}
}

@Override
public void decodeFrom(ChannelHandlerContext ctx, ByteBuf buffer) {
	byte size = buffer.readByte();
	this.elements = new ArrayList<Elements>();
	for (byte b = 0; b < size; b ++) {
		byte id = buffer.readByte();
		if (id > 0)
			this.elements.add(Elements.values()[id]);
	}
}

@Override
public void handleClientSide(EntityPlayer player) {
	PropertiesElements.get(player).setActiveElements(this.elements);
}

@Override
public void handleServerSide(EntityPlayer player) {
}

@Override
public boolean doesHandleSide(Side side) {
	return side == Side.CLIENT;
}

}

 

 

Superclass BasePacket:

 

/**
* AbstractPacket class. Should be the parent of all packets wishing to use the PacketPipeline.
*/
public abstract class BasePacket {

    /**
     * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See @link{cpw.mods.fml.common.network.ByteBuffUtils})
     *
     * @param ctx    channel context
     * @param buffer the buffer to encode into
     */
    public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer);

    /**
     * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See @link{cpw.mods.fml.common.network.ByteBuffUtils})
     *
     * @param ctx    channel context
     * @param buffer the buffer to decode from
     */
    public abstract void decodeFrom(ChannelHandlerContext ctx, ByteBuf buffer);

    /**
     * Returns true if the packet should be called on the given side. If it returns false the packets are ignored.
     */
    public abstract boolean doesHandleSide(Side side);

    /**
     * Handle a packet on the client side. Note this occurs after decoding has completed.
     *
     * @param player the player reference
     */
    public abstract void handleClientSide(EntityPlayer player);

    /**
     * Handle a packet on the server side. Note this occurs after decoding has completed.
     *
     * @param player the player reference
     */
    public abstract void handleServerSide(EntityPlayer player);
}

 

 

Packet Handler:

 

@PacketHandler.Sharable
public class PacketHandler extends MessageToMessageCodec<FMLProxyPacket, BasePacket> {

    private EnumMap<Side, FMLEmbeddedChannel> channels;
    private final LinkedList<Class<? extends BasePacket>> packets = new LinkedList<Class<? extends BasePacket>>();
    private boolean isPostInitialised = false;

    /**
     * Register your packet with the pipeline. Discriminators are automatically set.
     *
     * @param clazz the class to register
     *
     * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the registry already contains this packet
     */
    public boolean registerPacket(Class<? extends BasePacket> clazz) {
        if (this.packets.size() > 256) {
        	FMLLog.warning("Packetcount exceeded!", new Object[0]);
            return false;
        }

        if (this.packets.contains(clazz)) {
            FMLLog.warning("The Packet " + clazz.getName() + " is already registered!", new Object[0]);
            return false;
        }

        if (this.isPostInitialised) {
        	FMLLog.warning("Registration in postInitializing mode not possible!", new Object[0]);
            return false;
        }

        this.packets.add(clazz);
        return true;
    }

    @Override
    protected void encode(ChannelHandlerContext ctx, BasePacket msg, List<Object> out) throws Exception {
        ByteBuf buffer = Unpooled.buffer();
        Class<? extends BasePacket> clazz = msg.getClass();
        if (!this.packets.contains(msg.getClass())) {
            throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName());
        }

        byte discriminator = (byte) this.packets.indexOf(clazz);
        buffer.writeByte(discriminator);
        msg.encodeInto(ctx, buffer);
        FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get());
        out.add(proxyPacket);
    }

    @Override
    protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List<Object> out) throws Exception {
        ByteBuf payload = msg.payload();
        byte discriminator = payload.readByte();
        Class<? extends BasePacket> clazz = this.packets.get(discriminator);
        if (clazz == null) {
            throw new NullPointerException("No packet registered for discriminator: " + discriminator);
        }

        BasePacket pkt = clazz.newInstance();

        if (!pkt.doesHandleSide(FMLCommonHandler.instance().getEffectiveSide())) {
        	FMLLog.warning("Cannot handle packet \"" + clazz.getCanonicalName() + "\" on " + FMLCommonHandler.instance().getEffectiveSide().name().toLowerCase() + " side. The send call for the packet should be removed!", new Object[0]);
        	return;
        }

        pkt.decodeFrom(ctx, payload.slice());

        EntityPlayer player;
        switch (FMLCommonHandler.instance().getEffectiveSide()) {
            case CLIENT:
                player = this.getClientPlayer();
                pkt.handleClientSide(player);
                break;

            case SERVER:
                INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
                player = ((NetHandlerPlayServer) netHandler).playerEntity;
                pkt.handleServerSide(player);
                break;

            default:
        }

        out.add(pkt);
    }

    public void initialise(String modid) {
        this.channels = NetworkRegistry.INSTANCE.newChannel(modid, this);
    }

    public void postInitialise() {
        if (this.isPostInitialised) {
            return;
        }

        this.isPostInitialised = true;
        Collections.sort(this.packets, new Comparator<Class<? extends BasePacket>>() {

            @Override
            public int compare(Class<? extends BasePacket> clazz1, Class<? extends BasePacket> clazz2) {
                int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName());
                if (com == 0) {
                    com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName());
                }

                return com;
            }
        });
    }

    @SideOnly(Side.CLIENT)
    private EntityPlayer getClientPlayer() {
        return Minecraft.getMinecraft().thePlayer;
    }

    /**
     * Send this message to everyone.
     * <p/>
     * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message The message to send
     */
    public void sendToAll(BasePacket message) {
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
        this.channels.get(Side.SERVER).writeAndFlush(message);
    }

    /**
     * Send this message to the specified player.
     * <p/>
     * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message The message to send
     * @param player  The player to send it to
     */
    public void sendTo(BasePacket message, EntityPlayerMP player) {
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
        this.channels.get(Side.SERVER).writeAndFlush(message);
    }

    /**
     * Send this message to everyone within a certain range of a point.
     * <p/>
     * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message The message to send
     * @param point   The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send
     */
    public void sendToAllAround(BasePacket message, NetworkRegistry.TargetPoint point) {
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT);
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point);
        this.channels.get(Side.SERVER).writeAndFlush(message);
    }

    /**
     * Send this message to everyone within the supplied dimension.
     * <p/>
     * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message     The message to send
     * @param dimensionId The dimension id to target
     */
    public void sendToDimension(BasePacket message, int dimensionId) {
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION);
        this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId);
        this.channels.get(Side.SERVER).writeAndFlush(message);
    }

    /**
     * Send this message to the server.
     * <p/>
     * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper
     *
     * @param message The message to send
     */
    public void sendToServer(BasePacket message) {
        this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER);
        this.channels.get(Side.CLIENT).writeAndFlush(message);
    }
}

 

I took the code of the PacketHandler from some tutorials

 

 

Posted
[08:26:52] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLServerTweaker
[08:26:52] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLServerTweaker
[08:26:52] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLServerTweaker
[08:26:52] [main/INFO] [FML]: Forge Mod Loader version 7.10.18.1180 for Minecraft 1.7.10 loading
[08:26:53] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_10, running on Linux:amd64:3.6.7, installed at /usr/lib/jvm/java-7-oracle/jre
[08:26:53] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[08:26:53] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[08:26:53] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[08:26:53] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[08:26:53] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[08:26:55] [main/INFO] [FML]: Found valid fingerprint for Minecraft Forge. Certificate fingerprint e3c3d50c7c986df74c645c0ac54639741c90a557
[08:26:55] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[08:26:55] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

[08:26:57] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer}
[08:26:59] [server thread/INFO]: Starting minecraft server version 1.7.10
[08:26:59] [server thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
[08:26:59] [server thread/INFO] [FML]: MinecraftForge v10.13.0.1180 Initialized
[08:27:00] [server thread/INFO] [FML]: Replaced 182 ore recipies
[08:27:00] [server thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
[08:27:00] [server thread/INFO] [FML]: Searching /home/kd35523/server/minecraft_2031/mods for mods
[08:27:00] [server thread/INFO] [FML]: Forge Mod Loader has identified 11 mods to load
[08:27:01] [server thread/INFO] [FML]: Processing ObjectHolder annotations
[08:27:01] [server thread/INFO] [FML]: Found 341 ObjectHolder annotations
[08:27:01] [server thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[08:27:02] [server thread/INFO] [FML]: Extending Potions Array for the mod magicum.
[08:27:02] [server thread/INFO] [FML]: Applying holder lookups
[08:27:02] [server thread/INFO] [FML]: Holder lookups applied
[08:27:02] [server thread/INFO]: Loading properties
[08:27:02] [server thread/INFO]: Default game type: SURVIVAL
[08:27:02] [server thread/INFO]: Generating keypair
[08:27:02] [server thread/INFO]: Starting Minecraft server on minehost69.host-unlimited.de:25670
[08:27:03] [server thread/INFO] [ArchimedesShips]: Reading metarotation file: default.mrot
[08:27:03] [server thread/INFO] [FML]: Found not existing Item Name in item_elements.csv! Item: minecraft:slime_block
[08:27:03] [server thread/INFO] [FML]:   Unknown recipe class! com.bedrockminer.signcraft.crafting.UnmirrorRecipe Modder please refer to net.minecraftforge.oredict.RecipeSorter
[08:27:03] [server thread/INFO] [FML]: Forge Mod Loader has successfully loaded 11 mods
[08:27:03] [server thread/INFO]: Preparing level "world"
[08:27:03] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[08:27:03] [server thread/INFO] [FML]: Applying holder lookups
[08:27:04] [server thread/INFO] [FML]: Holder lookups applied
[08:27:04] [server thread/INFO] [FML]: Loading dimension 0 (world) (net.minecraft.server.dedicated.DedicatedServer@786d0dda)
[08:27:04] [server thread/INFO] [FML]: Loading dimension 1 (world) (net.minecraft.server.dedicated.DedicatedServer@786d0dda)
[08:27:04] [server thread/INFO] [FML]: Loading dimension -1 (world) (net.minecraft.server.dedicated.DedicatedServer@786d0dda)
[08:27:04] [server thread/INFO]: Preparing start region for level 0
[08:27:05] [server thread/INFO]: Preparing spawn area: 30%
[08:27:05] [server thread/INFO]: Done (2,312s)! For help, type "help" or "?"
[08:27:05] [server thread/INFO]: Unknown command. Try /help for a list of commands
[08:29:32] [user Authenticator #1/INFO]: UUID of player _Bedrock_Miner_ is 79b0a319-92fd-40ca-ba24-c857866ff166
[08:29:32] [server thread/INFO] [FML]: Called Constructing
[08:29:32] [Netty IO #3/INFO] [FML]: Client protocol version 1
[08:29:32] [Netty IO #3/INFO] [FML]: Client attempting to join with 12 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected] v1.7.0,[email protected],[email protected],[email protected],[email protected]
[08:29:32] [Netty IO #3/INFO] [FML]: Attempting connection with missing mods [] at CLIENT
[08:29:33] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[08:29:33] [server thread/INFO]: _Bedrock_Miner_[/84.154.100.67:55262] logged in with entity id 227 at (-536.1634642766006, 84.0, 348.82530851642457)
[08:29:33] [server thread/INFO]: _Bedrock_Miner_ joined the game
[08:29:33] [server thread/INFO] [FML]: Called Join for _Bedrock_Miner_
[08:29:33] [server thread/ERROR] [FML]: HandshakeCompletionHandler exception
java.lang.NullPointerException
        at java.util.ArrayList.<init>(ArrayList.java:151) ~[?:1.7.0_10]
        at com.bedrockminer.magicum.extendedproperties.PropertiesElements.getActiveElements(PropertiesElements.java:65) ~[PropertiesElements.class:?]
        at com.bedrockminer.magicum.extendedproperties.PropertiesElements.updateElements(PropertiesElements.java:84) ~[PropertiesElements.class:?]
        at com.bedrockminer.magicum.event.handler.EventHandlerExtendedProperties.onEntityJoinWorld(EventHandlerExtendedProperties.java:38) ~[EventHandlerExtendedProperties.class:?]
        at cpw.mods.fml.common.eventhandler.ASMEventHandler_16_EventHandlerExtendedProperties_onEntityJoinWorld_EntityJoinWorldEvent.invoke(.dynamic) ~[?:?]
        at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) ~[ASMEventHandler.class:?]
        at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) ~[EventBus.class:?]
        at net.minecraft.world.World.func_72838_d(World.java:1307) ~[ahb.class:?]
        at net.minecraft.server.management.ServerConfigurationManager.func_72377_c(ServerConfigurationManager.java:288) ~[oi.class:?]
        at net.minecraft.server.management.ServerConfigurationManager.a(ServerConfigurationManager.java:161) ~[oi.class:?]
        at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:173) ~[NetworkDispatcher.class:?]
        at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeHandshake(NetworkDispatcher.java:446) ~[NetworkDispatcher.class:?]
        at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:17) ~[HandshakeCompletionHandler.class:?]
        at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:11) ~[HandshakeCompletionHandler.class:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]
        at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
        at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:?]
        at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:?]
        at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
        at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
        at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?]
        at cpw.mods.fml.common.network.internal.FMLProxyPacket.func_148833_a(FMLProxyPacket.java:77) [FMLProxyPacket.class:?]
        at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) [ej.class:?]
        at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165) [nc.class:?]
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659) [MinecraftServer.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:335) [lt.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [li.class:?]
[08:29:33] [server thread/ERROR] [FML]: There was a critical exception handling a packet on channel FML
java.lang.NullPointerException
        at java.util.ArrayList.<init>(ArrayList.java:151) ~[?:1.7.0_10]
        at com.bedrockminer.magicum.extendedproperties.PropertiesElements.getActiveElements(PropertiesElements.java:65) ~[PropertiesElements.class:?]
        at com.bedrockminer.magicum.extendedproperties.PropertiesElements.updateElements(PropertiesElements.java:84) ~[PropertiesElements.class:?]
        at com.bedrockminer.magicum.event.handler.EventHandlerExtendedProperties.onEntityJoinWorld(EventHandlerExtendedProperties.java:38) ~[EventHandlerExtendedProperties.class:?]
        at cpw.mods.fml.common.eventhandler.ASMEventHandler_16_EventHandlerExtendedProperties_onEntityJoinWorld_EntityJoinWorldEvent.invoke(.dynamic) ~[?:?]
        at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) ~[ASMEventHandler.class:?]
        at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) ~[EventBus.class:?]
        at net.minecraft.world.World.func_72838_d(World.java:1307) ~[ahb.class:?]
        at net.minecraft.server.management.ServerConfigurationManager.func_72377_c(ServerConfigurationManager.java:288) ~[oi.class:?]
        at net.minecraft.server.management.ServerConfigurationManager.a(ServerConfigurationManager.java:161) ~[oi.class:?]
        at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:173) ~[NetworkDispatcher.class:?]
        at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeHandshake(NetworkDispatcher.java:446) ~[NetworkDispatcher.class:?]
        at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:17) ~[HandshakeCompletionHandler.class:?]
        at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:11) ~[HandshakeCompletionHandler.class:?]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]
        at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
        at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?]
        at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
        at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
        at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]
        at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]
        at cpw.mods.fml.common.network.internal.FMLProxyPacket.func_148833_a(FMLProxyPacket.java:77) [FMLProxyPacket.class:?]
        at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) [ej.class:?]
        at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165) [nc.class:?]
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659) [MinecraftServer.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:335) [lt.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [li.class:?]
[08:29:33] [server thread/WARN]: Failed to handle packet for /84.154.100.67:55262
java.lang.NullPointerException
        at cpw.mods.fml.common.network.internal.FMLProxyPacket.func_148833_a(FMLProxyPacket.java:101) ~[FMLProxyPacket.class:?]
        at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) ~[ej.class:?]
        at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165) [nc.class:?]
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659) [MinecraftServer.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:335) [lt.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [li.class:?]
[08:29:33] [server thread/INFO]: _Bedrock_Miner_ lost connection: TextComponent{text='Internal server error', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null}}
[08:29:33] [server thread/INFO]: _Bedrock_Miner_ left the game

Posted

Hi

 

I didn't find anything obvious; I think the most likely explanation is that you've either accidentally provided a second (empty?) constructor that doesn't initialise activeElements properly, another section of code is overwriting it after construction, or your packet handler is stuffing something up.

 

I'd suggest adding a pile more System.out.println() to the constructor, getter/setter, and packet handler, to help track it down.

 

-TGG

 

 

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



×
×
  • Create New...

Important Information

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