Jump to content

1.7.10 SimpleNetworkWrapper, Gui open packet crashing


Recommended Posts

Posted

Hello guys, I am back with more issues! But i wanna keep this brief. I am testing out CoolAlias's https://github.com/coolAlias/Tutorial-1.7.10/blob/master/src/main/java/tutorial/network/PacketDispatcher.java PacketDispatcher.

 

[spoiler=PacketDispatcher]

package coalpower.common.network.packet;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import coalpower.CoalPower;
import coalpower.common.network.packet.handler.CPAbstractClientMessageHandler;
import coalpower.common.network.packet.handler.CPAbstractDualSidedMessageHandler;
import coalpower.common.network.packet.handler.CPAbstractMessageHandler;
import coalpower.common.network.packet.handler.CPAbstractServerMessageHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;

public class CPPacketDispatcher {

private static byte packetId = 0;

private static final SimpleNetworkWrapper dispatcher = NetworkRegistry.INSTANCE.newSimpleChannel(CoalPower.CHANNEL);

public static final void registerPackets() {
	registerMessage(PacketGui.Handler.class, PacketGui.class);
	registerMessage(PacketSound.Handler.class, PacketSound.class);
}

/**
 * Registers a message and message handler on the designated side;
 * used for standard IMessage + IMessageHandler implementations
 */
private static final <REQ extends IMessage, REPLY extends IMessage> void registerMessage(Class<? extends IMessageHandler<REQ, REPLY>> handlerClass, Class<REQ> messageClass, Side side) {
	CPPacketDispatcher.dispatcher.registerMessage(handlerClass, messageClass, packetId++, side);
}

/**
 * Registers a message and message handler on both sides; used mainly
 * for standard IMessage + IMessageHandler implementations and ideal
 * for messages that are handled identically on either side
 */
private static final <REQ extends IMessage, REPLY extends IMessage> void registerBiMessage(Class<? extends IMessageHandler<REQ, REPLY>> handlerClass, Class<REQ> messageClass) {
	CPPacketDispatcher.dispatcher.registerMessage(handlerClass, messageClass, packetId, Side.CLIENT);
	CPPacketDispatcher.dispatcher.registerMessage(handlerClass, messageClass, packetId++, Side.SERVER);
}

/**
 * Registers a message and message handler, automatically determining Side(s) based on the handler class
 * @param handlerClass	Must extend one of {@link AbstractClientMessageHandler}, {@link AbstractServerMessageHandler}, or {@link AbstractBiMessageHandler}
 */
private static final <REQ extends IMessage> void registerMessage(Class<? extends CPAbstractMessageHandler<REQ>> handlerClass, Class<REQ> messageClass) {
	if (CPAbstractClientMessageHandler.class.isAssignableFrom(handlerClass)) {
		registerMessage(handlerClass, messageClass, Side.CLIENT);
	} else if (CPAbstractServerMessageHandler.class.isAssignableFrom(handlerClass)) {
		registerMessage(handlerClass, messageClass, Side.SERVER);
	} else if (CPAbstractDualSidedMessageHandler.class.isAssignableFrom(handlerClass)) {
		registerBiMessage(handlerClass, messageClass);
	} else {
		throw new IllegalArgumentException("Cannot determine on which Side(s) to register " + handlerClass.getName() + " - unrecognized handler class!");
	}
}

/**
 * Send this message to the specified player.
 * See {@link SimpleNetworkWrapper#sendTo(IMessage, EntityPlayerMP)}
 */
public static final void sendTo(IMessage message, EntityPlayerMP player) {
	CPPacketDispatcher.dispatcher.sendTo(message, player);
}

/**
 * Send this message to everyone within a certain range of a point.
 * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, NetworkRegistry.TargetPoint)}
 */
public static final void sendToAllAround(IMessage message, NetworkRegistry.TargetPoint point) {
	CPPacketDispatcher.dispatcher.sendToAllAround(message, point);
}

/**
 * Sends a message to everyone within a certain range of the coordinates in the same dimension.
 */
public static final void sendToAllAround(IMessage message, int dimension, double x, double y, double z, double range) {
	CPPacketDispatcher.sendToAllAround(message, new NetworkRegistry.TargetPoint(dimension, x, y, z, range));
}

/**
 * Sends a message to everyone within a certain range of the player provided.
 */
public static final void sendToAllAround(IMessage message, EntityPlayer player, double range) {
	CPPacketDispatcher.sendToAllAround(message, player.worldObj.provider.dimensionId, player.posX, player.posY, player.posZ, range);
}

/**
 * Send this message to everyone within the supplied dimension.
 * See {@link SimpleNetworkWrapper#sendToDimension(IMessage, int)}
 */
public static final void sendToDimension(IMessage message, int dimensionId) {
	CPPacketDispatcher.dispatcher.sendToDimension(message, dimensionId);
}

/**
 * Send this message to the server.
 * See {@link SimpleNetworkWrapper#sendToServer(IMessage)}
 */
public static final void sendToServer(IMessage message) {
	CPPacketDispatcher.dispatcher.sendToServer(message);
}
}

 

 

[spoiler=Container which is causing the crash]

package coalpower.common.inventory.container;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
import coalpower.common.recipe.manager.RecipeWorkbenchManager;
import coalpower.common.tileentity.CPTileEntityBase;
import coalpower.common.tileentity.TileEntityWorkbench;

public class ContainerWorkbench extends CPContainerBase {

public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3);
    public IInventory craftResult = new InventoryCraftResult();
    
public TileEntityWorkbench tile;

public ContainerWorkbench(EntityPlayer player, CPTileEntityBase tile) {
	super(player, tile);
	this.tile = (TileEntityWorkbench) tile;

	 updateCraftingMatrix();

	//0-8 Crafting
	for (int row = 0; row < 3; row++) {
		for (int col = 0; col < 3; col++) {
			addSlotToContainer(new Slot(this.craftMatrix, col + row * 3, 48 + col * 18, 18 + row * 18));
		}
	}

	//9-35 Inventory
	for (int row = 0; row < 3; row++) {
		for (int col = 0; col < 9; col++) {
			addSlotToContainer(new Slot((TileEntityWorkbench)tile, col + row * 9 + 9, 8 + 18 * col, 90 + row * 18));
		}
	}

	for (int col = 0; col < 9; col++) {
		addSlotToContainer(new Slot(player.inventory, col, 8 + 18 * col, 216));
	}

	for (int row = 0; row < 3; row++) {
		for (int col = 0; col < 9; col++) {
			addSlotToContainer(new Slot(player.inventory, col + row * 9 + 9, 8 + 18 * col, 158 + row * 18));
		}
	}

	this.addSlotToContainer(new SlotCrafting(player, this.craftMatrix, this.craftResult, 99, 143, 36));

	this.onCraftMatrixChanged(this.craftMatrix);
}

    public void onCraftMatrixChanged(IInventory p_75130_1_)
    {
        this.craftResult.setInventorySlotContents(0, RecipeWorkbenchManager.getInstance().findMatchingRecipe(this.craftMatrix, tile.getWorldObj()));
    }

    public void onContainerClosed(EntityPlayer par1EntityPlayer) {
	super.onContainerClosed(par1EntityPlayer);
	saveCraftingMatrix();
}

private void saveCraftingMatrix() {
	for (int i = 0; i < craftMatrix.getSizeInventory(); i++) {
		tile.inventory[i] = craftMatrix.getStackInSlot(i);
	}
}

private void updateCraftingMatrix() {
	for (int i = 0; i < craftMatrix.getSizeInventory(); i++)
		craftMatrix.setInventorySlotContents(i, tile.inventory[i]);
}

public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int numSlot) {
	ItemStack itemstack = null;
	Slot slot = (Slot) this.inventorySlots.get(numSlot);

	if (slot != null && slot.getHasStack()) {
		ItemStack itemstack1 = slot.getStack();
		itemstack = itemstack1.copy();

		if (numSlot == 99) {
			if (!this.mergeItemStack(itemstack1, 10, 72, true)) {
				return null;
			}
			slot.onSlotChange(itemstack1, itemstack);
		} else if(numSlot >= 0 && numSlot <=  {
			if(!this.mergeItemStack(itemstack1, 9, 37, false)){
				if(!this.mergeItemStack(itemstack1, 37, 72, false)){
					return null;
				}
			}		
		} else if (numSlot >= 9 && numSlot <= 35) {
			if (!this.mergeItemStack(itemstack1, 36, 72, false)) {
				return null;
			}
		} else if (numSlot >= 36 && numSlot <= 72) {
			if (!this.mergeItemStack(itemstack1, 9, 36, false)) {
				return null;
			}
		} 

		if (itemstack1.stackSize == 0) {
			slot.putStack((ItemStack) null);
		} else {
			slot.onSlotChanged();
		}

		if (itemstack1.stackSize == itemstack.stackSize) {
			return null;
		}

		slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
	}

	return itemstack;
}

}

 

 

[spoiler=PacketGui]

package coalpower.common.network.packet;

import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import coalpower.CoalPower;
import coalpower.common.network.packet.handler.CPAbstractServerMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;

public class PacketGui implements IMessage {
private int id;

public PacketGui() {}
public PacketGui(int id) {
	this.id = id;
}

@Override
public void fromBytes(ByteBuf buffer) {
	id = buffer.readInt();
}

@Override
public void toBytes(ByteBuf buffer) {
	buffer.writeInt(id);
}

public static class Handler extends CPAbstractServerMessageHandler<PacketGui> {
	@Override
	public IMessage handleServerMessage(EntityPlayer player, PacketGui message, MessageContext ctx) {
		player.openGui(CoalPower.instance, message.id, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
		return null;
	}
}
}

 

 

[spoiler=The block class. (The code i commented out was perfectly working, skip to the bottom of onBlockActivated, when it checks if the player is sneaking, not to waste time)]

package coalpower.common.block;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import coalpower.CoalPower;
import coalpower.common.item.ItemBaseHammer;
import coalpower.common.network.packet.CPPacketDispatcher;
import coalpower.common.network.packet.PacketGui;
import coalpower.common.tileentity.TileEntityWorkbench;
import coalpower.common.util.InventoryUtil;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockWorkbench extends CPTileBlockBase{

private Random rand = new Random();

protected BlockWorkbench() {
	super(Material.wood);
	setBlockBounds(0, 0, 0, pixel * 16, pixel * 14, pixel * 16);
}

@Override
    @SideOnly(Side.CLIENT)
    public IIcon getIcon(int side, int meta) {
        return Blocks.stone_slab.getIcon(0, 0);
    }

@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float fx, float fy, float fz) {
	TileEntityWorkbench tile = (TileEntityWorkbench) world.getTileEntity(x, y, z);

	if (tile != null && tile.canActivate) {		
		if (!player.isSneaking()){
			if(tile.displayedStack != null){					
				if(player.getHeldItem() == null){
					player.setCurrentItemOrArmor(0, tile.displayedStack.copy());
					tile.displayedStack = null;

					world.markBlockForUpdate(x, y, z);
					return true;

				} else if(player.getHeldItem() != null){
					if (tile.displayedStack.isItemEqual(player.getHeldItem()) && (player.getHeldItem().stackSize + 1 <= player.getHeldItem().getItem().getItemStackLimit(player.getHeldItem()))) {
						player.getHeldItem().stackSize++;
						tile.displayedStack = null;

						world.markBlockForUpdate(x, y, z);
						return true;
					} else if(tile.displayedStack != null && player.getHeldItem().getItem() instanceof ItemBaseHammer){
						player.getHeldItem().damageItem(1, player);
						tile.process();
					}
				}			
			} else {
				if(player.getHeldItem() != null && !(player.getHeldItem().getItem() instanceof ItemBaseHammer)) {
					ItemStack stack = player.getHeldItem().copy();
					stack.stackSize = 1;
					tile.displayedStack = stack;			

					player.getHeldItem().stackSize--;
					if (player.getHeldItem().stackSize <= 0) {
						player.setCurrentItemOrArmor(0, null);
					}

					world.markBlockForUpdate(x, y, z);
					return true;
				} 
			}				
		} 
	}

	if(player.isSneaking()){
		//FMLNetworkHandler.openGui(player, CoalPower.instance, 0, world, x, y, z);
		CPPacketDispatcher.sendToServer(new PacketGui(0));
		return true;
	}

	return false;
}

@Override
public void breakBlock(World world, int x, int y, int z, Block block, int par4) {	
	TileEntityWorkbench tile = (TileEntityWorkbench) world.getTileEntity(x, y, z);

	if (tile != null && tile.displayedStack != null && !world.isRemote){
		InventoryUtil.dropItem(world, x, y, z, ForgeDirection.UP, tile.displayedStack.copy());
	} 

	for(int i = 0; i == tile.getSizeInventory(); i++){
		if (tile.inventory[i] != null && !world.isRemote){
			InventoryUtil.dropItem(world, x, y, z, ForgeDirection.UP, tile.getStackInSlot(i).copy());
		}
	}

	super.breakBlock(world, x, y, z, block, par4);
}


@Override
public TileEntity createNewTileEntity(World par1, int par2) {
	return new TileEntityWorkbench();
}

@Override
public boolean hasCustomRenderer() {
	return true;
}

@Override
public void registerBlockIcons(IIconRegister iconRegister) {

}
}

 

 

The rest of the classes is as shown on CoolAlias's github (Yes. I am damn lazy, but I will change it. It was just a test)

So, the game crashes whenever I open my gui.

 

[spoiler=Crash Log]

[18:27:41] [server thread/ERROR] [FML]: SimpleChannelHandlerWrapper exception
java.lang.NullPointerException
at coalpower.common.inventory.container.ContainerWorkbench.updateCraftingMatrix(ContainerWorkbench.java:74) ~[ContainerWorkbench.class:?]
at coalpower.common.inventory.container.ContainerWorkbench.<init>(ContainerWorkbench.java:25) ~[ContainerWorkbench.class:?]
at coalpower.common.core.CPGuiHandler.getServerGuiElement(CPGuiHandler.java:24) ~[CPGuiHandler.class:?]
at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:241) ~[NetworkRegistry.class:?]
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75) ~[FMLNetworkHandler.class:?]
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2500) ~[EntityPlayer.class:?]
at coalpower.common.network.packet.PacketGui$Handler.handleServerMessage(PacketGui.java:31) ~[PacketGui$Handler.class:?]
at coalpower.common.network.packet.PacketGui$Handler.handleServerMessage(PacketGui.java:1) ~[PacketGui$Handler.class:?]
at coalpower.common.network.packet.handler.CPAbstractMessageHandler.onMessage(CPAbstractMessageHandler.java:23) ~[CPAbstractMessageHandler.class:?]
at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:37) ~[simpleChannelHandlerWrapper.class:?]
at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:17) ~[simpleChannelHandlerWrapper.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.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:101) [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.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
[18:27:41] [server thread/ERROR] [FML]: There was a critical exception handling a packet on channel coalpower
java.lang.NullPointerException
at coalpower.common.inventory.container.ContainerWorkbench.updateCraftingMatrix(ContainerWorkbench.java:74) ~[ContainerWorkbench.class:?]
at coalpower.common.inventory.container.ContainerWorkbench.<init>(ContainerWorkbench.java:25) ~[ContainerWorkbench.class:?]
at coalpower.common.core.CPGuiHandler.getServerGuiElement(CPGuiHandler.java:24) ~[CPGuiHandler.class:?]
at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:241) ~[NetworkRegistry.class:?]
at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75) ~[FMLNetworkHandler.class:?]
at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2500) ~[EntityPlayer.class:?]
at coalpower.common.network.packet.PacketGui$Handler.handleServerMessage(PacketGui.java:31) ~[PacketGui$Handler.class:?]
at coalpower.common.network.packet.PacketGui$Handler.handleServerMessage(PacketGui.java:1) ~[PacketGui$Handler.class:?]
at coalpower.common.network.packet.handler.CPAbstractMessageHandler.onMessage(CPAbstractMessageHandler.java:23) ~[CPAbstractMessageHandler.class:?]
at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:37) ~[simpleChannelHandlerWrapper.class:?]
at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:17) ~[simpleChannelHandlerWrapper.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.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:101) ~[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.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]

 

 

Alright so, I am asking help because i've never used this SimpleNetworkWrapper thingy and it seems strange to me, as my code works without sending the packet.. does this have to do with the Side my packet is sent to?

 

Sorry in advance for having bothered you all :)

I will try and solve it by myself too.

 

Oh, and don't look at the rest of my code, I am recoding everything..

I try my best, so apologies if I said something obviously stupid!

Posted

Thanks for clarifying that! I feel so stupid right now, oh god..

Well, thank you coolAlias, I needed to be sure on that because I am trying to use packets as much as it's needed.

Also, sorry for having copied your stuff. I'd say time to make it my own way! Thanks again :)

 

I love seeing such an helpful community here..

 

PS: Have you had any notice from microjunk, or his job took over his time? I think you might remember me now

I try my best, so apologies if I said something obviously stupid!

Posted

Yes, I will absolutely credit you for any source code you provided! Even if it will be changed, you still helped me a lot.

 

Re: Yeah, I head some of the stuff he's been through.. his father died of cancer 8 months ago, and that's the last time i heard from him.. he's the guy that got me into modding..

I try my best, so apologies if I said something obviously stupid!

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.