Jump to content

Recommended Posts

Posted

Hello there,

 

I have implemented a gui to a block that sets it's height for which launches you in the air on contact with the block. When I run the game, I can set different height levels for different blocks, but when I save and quit then reload, they are not saved and are reset to the default value

 

Is there any way for me to save the nbt data when the gui is closed, or when the game is quit? Because I checked, and the tile entities are reading and writing too early.

 

Examples

 

BlockGravityLift.java

package kris91268.lbd.Blocks;

import java.util.Random;
import kris91268.lbd.GuiGravityLift;
import kris91268.lbd.ModLBD;
import kris91268.lbd.Tileentity.TileEntityGravityLift;
import cpw.mods.fml.common.registry.BlockProxy;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.World;

/**
* 
* @author Arbiter
*
*/
public class BlockGravityLift extends BlockContainer implements BlockProxy
{
public Class theTileEntityClass;
public BlockGravityLift(int par1, Class entityClass)
{
	super(par1, Material.iron);
	this.theTileEntityClass = entityClass;
	setHardness(1.5F);
	setResistance(1.0F);
	setStepSound(Block.soundMetalFootstep);
	setUnlocalizedName("lbd:gravityLift");
	func_111022_d("lbd:gravityLift");
	setCreativeTab(CreativeTabs.tabRedstone);
	setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3F, 1.0F);
}
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
	TileEntityGravityLift tileEntity = (TileEntityGravityLift)par1World.getBlockTileEntity(par2, par3, par4);
	if (tileEntity.height <= 0.0D)
	{
		return;
	}
	if (par1World.isRemote)
	{
		if (par5Entity instanceof EntityPlayer)
		{
			par5Entity.setVelocity(0.0D, tileEntity.height / 2, 0.0D);
			par5Entity.moveEntity(0.0D, tileEntity.height, 0.0D);
		}
	}
	else
	{
		if (par5Entity instanceof EntityPlayerMP)
		{
			par5Entity.addVelocity(0.0D, tileEntity.height / 2, 0.0D);
			par5Entity.moveEntity(0.0D, tileEntity.height, 0.0D);
		}
	}
}
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int metadata, float par7, float par8, float par9)
{
    if (!par1World.isRemote)
    {
    	TileEntityGravityLift tileEntity = (TileEntityGravityLift)par1World.getBlockTileEntity(par2, par3, par4);
    	if (tileEntity != null)
    	{
    		player.openGui(ModLBD.instance, 0, par1World, par2, par3, par4);
    	}
    }
    return true;
}
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
	double d0 = (double)((float)par2 + 0.5F);
	double d1 = (double)((float)par3 + 0.3F);
	double d2 = (double)((float)par4 + 0.5F);
	par1World.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
public boolean isOpaqueCube()
{
	return false;
}
public boolean renderAsNormalBlock()
{
	return false;
}
public int getRenderType()
{
	return -1;
}
public TileEntity getBlockEntity()
{
	return new TileEntityGravityLift();
}
public TileEntity createNewTileEntity(World par1World)
{
	try
	{
		return (TileEntity)theTileEntityClass.newInstance();
	}
	catch (Exception e)
	{
		throw new RuntimeException();
	}
}
}

 

TileEntityGravityLift.java

package kris91268.lbd.Tileentity;

import java.awt.List;

import kris91268.lbd.Blocks.BlockGravityLift;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

/**
* 
* @author Arbiter
*
*/
public class TileEntityGravityLift extends TileEntity
{
private String aString;
public Double height = new Double(0.0D);			

public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
	super.readFromNBT(par1NBTTagCompound);
	this.height = par1NBTTagCompound.getDouble("height");
	System.out.println(height);
}
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
	super.writeToNBT(par1NBTTagCompound);
	par1NBTTagCompound.setDouble("height", height);
	System.out.println(height);
}
public boolean isUsableByPlayer(EntityPlayer par1EntityPlayer)
{
	return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : 
		par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
}
public void something(String par1Str)
{
	this.aString = par1Str;
}
}

 

GuiGravityLift.java

package kris91268.lbd;

import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

import kris91268.lbd.Blocks.BlockGravityLift;
import kris91268.lbd.Tileentity.TileEntityGravityLift;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;

/**
* 
* @author Arbiter
*
*/
public class GuiGravityLift extends GuiContainer
{
private static final ResourceLocation texture = new ResourceLocation("lbd:textures/gui/gravlift.png");
private GuiButton dnButton;
private GuiButton decByPointZeroOne;
private GuiButton decByPointOne;
private GuiButton incByPointOne;
private GuiButton incByOnePointZero;
private GuiTextField number;
public static String gravLiftHeight;
private TileEntityGravityLift tileEntity;

public GuiGravityLift(InventoryPlayer par1, TileEntityGravityLift par2)
{
	super(new ContainerGravityLift(par1, par2));
	tileEntity = par2;
	gravLiftHeight = tileEntity.height.toString();
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
	fontRenderer.drawString("Gravity Lift", 8, 6, 4210752);
	fontRenderer.drawString("Inventory", 8, ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
	this.mc.func_110434_K().func_110577_a(texture);
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	int x = (width - xSize) / 2;
	int y = (height - ySize) / 2;
	this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
	this.number.drawTextBox();
}
@Override
public void initGui()
{
	super.initGui();
	this.buttonList.clear();
	Keyboard.enableRepeatEvents(true);
	this.buttonList.add(this.dnButton = new GuiButton(0, this.width / 2 - 25, this.height / 4 + 35, 50, 20, "Done"));
	this.buttonList.add(this.decByPointZeroOne = new GuiButton(1, this.width / 2 - 75, this.height / 4 + 0, 40, 20, "-0.1"));
	this.buttonList.add(this.decByPointOne = new GuiButton(2, this.width / 2 - 75, this.height / 4 + 25, 40, 20, "-1.0"));
	this.buttonList.add(this.incByPointOne = new GuiButton(3, this.width / 2 + 25, this.height / 4 + 0, 40, 20, "+0.1"));
	this.buttonList.add(this.incByOnePointZero = new GuiButton(4, this.width / 2 + 25, this.height / 2 + 25, 40, 20, "+1.0"));
	this.number = new GuiTextField(this.fontRenderer, this.width / 2 - 20, this.height / 4 + 1, 40, 20);
	this.number.setVisible(true);
	this.number.setCanLoseFocus(false);
	this.number.setFocused(true);
	this.number.setText(tileEntity.height.toString());

}
public void onGuiClosed()
{
	Keyboard.enableRepeatEvents(false);
	Double theNumber = Double.parseDouble(gravLiftHeight);
	tileEntity.height = theNumber;
}
public boolean isAboveZero(String par1Str)
{
	Double theDouble = Double.parseDouble(par1Str);
	return theDouble >= 0.00D ? true : false;
}
public boolean isBelowFive(String par1Str)
{
	Double theDouble = Double.parseDouble(par1Str);
	return theDouble <= 5.0D ? true : false;
}
public void updateScreen()
{
	this.number.updateCursorCounter();
}
@Override
protected void actionPerformed(GuiButton guiButton)
{
	switch (guiButton.id)
	{
	case 0:
		this.mc.displayGuiScreen((GuiScreen)null);
		break;
	case 1:
		if (isAboveZero(gravLiftHeight))
		{
			Double heightInDoubles = Double.parseDouble(gravLiftHeight);
			heightInDoubles -= 0.1D;
			gravLiftHeight = heightInDoubles.toString();
			number.setText(gravLiftHeight);
			tileEntity.height = heightInDoubles;
		}
		break;
	case 2:
		if (isAboveZero(gravLiftHeight))
		{
			Double heightInDoubles1 = Double.parseDouble(gravLiftHeight);
			if (heightInDoubles1 < 1.0D)
			{
				heightInDoubles1 = 0.0D;
			}
			else
			{
				heightInDoubles1 -= 1.0D;
			}
			gravLiftHeight = heightInDoubles1.toString();
			number.setText(gravLiftHeight);
			tileEntity.height = heightInDoubles1;
		}
		break;
	case 3:
		if (isBelowFive(gravLiftHeight))
		{
			Double theHeight = Double.parseDouble(gravLiftHeight);
			theHeight += 0.1D;
			gravLiftHeight = theHeight.toString();
			number.setText(gravLiftHeight);
			tileEntity.height = theHeight;
		}
		break;
	case 4:
		if (isBelowFive(gravLiftHeight))
		{
			Double theNumber = Double.parseDouble(gravLiftHeight);
			if (theNumber > 4.0D)
			{
				theNumber = 5.0D;
			}
			else
			{
				theNumber += 1.0D;
			}
			gravLiftHeight = theNumber.toString();
			number.setText(gravLiftHeight);
			tileEntity.height = theNumber;
		}
		default:
			break;
	}
}
}

 

Any help would be much appreciated

Posted

Sorry if I'm no help (I'm still learning), but possible suggestions to try:

 

Perhaps adding @Override just above your initialization of the tile entity within the block class:

@Override
public TileEntity createNewTileEntity(World par1World)

 

Or maybe setting the data to be saved from within the tile entity class:

public void somethingelse(Double newheight)
{
     this.height = newheight;
}

And then calling that method in your GUI class in the onGuiClosed():

public void onGuiClosed()
{
	Keyboard.enableRepeatEvents(false);
	Double theNumber = Double.parseDouble(gravLiftHeight);
	tileEntity.somethingelse(theNumber);
}

 

If I had my dev environment handy, I would test for you before replying to ensure it works, but I'm at work.

All the tutorials on NBT I have read suggest that the Tile Entity itself has to save the data.  Perhaps just passing the data to it does not call the writeToNBT method?

Posted

I believe the problem you are having is that you aren't telling the server what is changing in the nbt data, you're doing everything client side, which, upon log out, is discarded. What you will want to do is send a packet to the server, then have it execute the changes as a result of what packet it receives.

Posted

Read through these two tutorials:

http://www.minecraftforge.net/wiki/Packet_Handling

http://www.minecraftforge.net/wiki/Advanced_Packet_Handling

(I suggest you do not change any part of your code until after you've read through these, and understand packet handling)

 

Once you get a grip on packet handling, it might become clearer. Basically, where ever you want to change a value in the tile entity of a block, you want to send a packet to the server that tells the server to change the value of the block. That way, you make sure the server knows you're making a change, not just the client. After you've read through both tutorials, if you still are unclear on what you should do, I can try to walk you through getting it to change.

Posted

Read through these two tutorials:

http://www.minecraftforge.net/wiki/Packet_Handling

http://www.minecraftforge.net/wiki/Advanced_Packet_Handling

(I suggest you do not change any part of your code until after you've read through these, and understand packet handling)

 

Once you get a grip on packet handling, it might become clearer. Basically, where ever you want to change a value in the tile entity of a block, you want to send a packet to the server that tells the server to change the value of the block. That way, you make sure the server knows you're making a change, not just the client. After you've read through both tutorials, if you still are unclear on what you should do, I can try to walk you through getting it to change.

 

I'm sorry, but I have already looked through those tutorials, and I still don't know what to do, or where I should implement everything. It should be much simpler than this shouldn't it? Thank you already for the help you have given me, it is much appreciated. I will mention you in the mod's credits.

Posted

Read through these two tutorials:

http://www.minecraftforge.net/wiki/Packet_Handling

http://www.minecraftforge.net/wiki/Advanced_Packet_Handling

(I suggest you do not change any part of your code until after you've read through these, and understand packet handling)

 

Once you get a grip on packet handling, it might become clearer. Basically, where ever you want to change a value in the tile entity of a block, you want to send a packet to the server that tells the server to change the value of the block. That way, you make sure the server knows you're making a change, not just the client. After you've read through both tutorials, if you still are unclear on what you should do, I can try to walk you through getting it to change.

 

I'm sorry, but I have already looked through those tutorials, and I still don't know what to do, or where I should implement everything. It should be much simpler than this shouldn't it? Thank you already for the help you have given me, it is much appreciated. I will mention you in the mod's credits.

 

No need to put me in the mod's credits! Packet handling is a bit confusing at first, but once you actually get one working it's simple. I can try to figure out what needs to be done, but it is quite late where I am, so I will take a look at your code tomorrow, sound good?

Posted

Read through these two tutorials:

http://www.minecraftforge.net/wiki/Packet_Handling

http://www.minecraftforge.net/wiki/Advanced_Packet_Handling

(I suggest you do not change any part of your code until after you've read through these, and understand packet handling)

 

Once you get a grip on packet handling, it might become clearer. Basically, where ever you want to change a value in the tile entity of a block, you want to send a packet to the server that tells the server to change the value of the block. That way, you make sure the server knows you're making a change, not just the client. After you've read through both tutorials, if you still are unclear on what you should do, I can try to walk you through getting it to change.

 

I'm sorry, but I have already looked through those tutorials, and I still don't know what to do, or where I should implement everything. It should be much simpler than this shouldn't it? Thank you already for the help you have given me, it is much appreciated. I will mention you in the mod's credits.

 

No need to put me in the mod's credits! Packet handling is a bit confusing at first, but once you actually get one working it's simple. I can try to figure out what needs to be done, but it is quite late where I am, so I will take a look at your code tomorrow, sound good?

 

OK, thank you so much

 

Just a heads up with my code, some of it might be pointless or unccessesary, just ignore them, unless they are of utmost importance

Posted

Okay, so first thing you want to do is get the packet framework in place before you change any of your existing code. Create a new class, this will be our base for any packets we send, call it something like PacketBase. In this class you will want to follow the Making the Base for our Packet classes part in the Advanced Packet Handling tutorial I linked to earlier.

 

This class basically implements all the basic stuff needed to create a packet, and it will be the parent class to any custom packets we send. This is also where we will register any custom packets we made. Do this, and post a reply when you are done with this step. If you run into any problem, post here and I will help you figure them out.

Posted

OK, the PacketBase class is all figured out, what next?

 

Here is the code for the PacketBase

 

PacketBase.java

package kris91268.lbd;

import net.minecraft.entity.player.EntityPlayer;

import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;

import cpw.mods.fml.relauncher.Side;

/**
* 
* @author Arbiter
*
*/
public abstract class PacketBase
{
public static final String CHANNEL = "lbd";
private static final BiMap<Integer, Class<? extends PacketBase>> idMap;

static
{
	ImmutableBiMap.Builder<Integer, Class<? extends PacketBase>> builder = ImmutableBiMap.builder();
	idMap = builder.build();
}	
public static PacketBase constructPacket(int packetId) throws ProtocolException, ReflectiveOperationException
{
	Class<? extends PacketBase> theClass = idMap.get(Integer.valueOf(packetId));
	if (theClass == null)
	{
		throw new ProtocolException("Unknown packet id");
	}
	else
	{
		return theClass.newInstance();
	}
}	
public static class ProtocolException extends Exception
{
	public ProtocolException()
	{

	}
	public ProtocolException(String message, Throwable cause)
	{
		super(message, cause);
	}
	public ProtocolException(String message)
	{
		super(message);
	}
	public ProtocolException(Throwable cause)
	{
		super(cause);
	}
}
public abstract void write(ByteArrayDataOutput out);

public abstract void read(ByteArrayDataInput in);

public abstract void execute(EntityPlayer par1EntityPlayer, Side par2Side);
}

Posted

Okay, next we need a way to receive packets, this is our packet handler, create a new class call CustomPacketHandler and follow the receiving packets section of the tutorial. You will need to change some class names in the code (namely from DemoPacket to PacketBase).

 

This class basically determines when a packet is sent, and determines what it should do with it.

Posted

Here is the PacketHandler class, what is next?

 

PacketHandler.java

package kris91268.lbd;

import java.util.logging.Logger;

import kris91268.lbd.PacketBase.ProtocolException;

import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.relauncher.Side;

/**
* 
* @author Arbiter
*
*/
public class PacketHandler implements IPacketHandler
{
@Override
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
{
	try
	{
		EntityPlayer entityPlayer = (EntityPlayer)player;
		ByteArrayDataInput in = ByteStreams.newDataInput(packet.data);
		int packetId = in.readUnsignedByte();
		PacketBase packetBase = PacketBase.constructPacket(packetId);
		packetBase.read(in);
		packetBase.execute(entityPlayer, entityPlayer.worldObj.isRemote ? Side.CLIENT : Side.SERVER);
	}
	catch (ProtocolException e)
	{
		if (player instanceof EntityPlayerMP)
		{
			((EntityPlayerMP)player).playerNetServerHandler.kickPlayerFromServer("Protocol Exception!");
			Logger.getLogger("lbd").warning("Player " + ((EntityPlayer)player).username + " caused a Protocol Exception");
		}
	}
	catch (ReflectiveOperationException e)
	{
		throw new RuntimeException("Unexpected Reflection exception during Packet construction");
	}
}
}

Posted

Next is the method that actually sends our packet.  Add the following to your BasePacket class:

        public final int getPacketId() {
                if (idMap.inverse().containsKey(getClass())) {
                        return idMap.inverse().get(getClass()).intValue();
                } else {
                        throw new RuntimeException("Packet " + getClass().getSimpleName() + " is missing a mapping!");
                }
        }
       
        public final Packet makePacket() {
                ByteArrayDataOutput out = ByteStreams.newDataOutput();
                out.writeByte(getPacketId());
                write(out);
                return PacketDispatcher.getPacket(CHANNEL, out.toByteArray());
        }

 

These methods make it so that you can actually send a packet to the server.

Posted

Okay, now it is time to make your custom packet. Make a new class named something like, BlockChangePacket, so you know what the packet is doing later without having to look at the actual class. Follow the making our first class part of the tutorial. Under the execute method is where you will want to tell it to change the block. My suggestion is after you finish that part, create a constructor for that class that takes in an integer array, which you would use to send the x, y, and z coordinates of the specific block you want to change the values of, and set three variables (name them what you would like, but x, y and z would be the least confusing) to the values accordingly.

 

Under execute if where will out your code for changing the block's variables. This is where it gets a little involved, so do what you can, and then post here if you get stuck.

Posted

Hmm, well I tried to look through your code but I was a bit confused, in your current code where do you change the height of how high the block lifts you?

 

The way I would do it is have an NBT tag called height, which stored and integer. Then for the packet I'd send an integer array that help 4 numbers, the X, Y, and Z coordinates of the block, and the height I want it to change to. Under the execute I would retrieve the tile entity at the X, Y, and Z coordinates, and then set the NBT tag height to the fourth number I sent. Then I would have the block read the NBT tag to get what height it should be lifting to.

Posted

Interesting, I have not thought about making a NBT tag variable.

 

The height variable is changed in the GuiGravityLift.java file under the actionPerformed method when the buttons are clicked, and when the Done button is clicked.

 

Posted

Well, either way would work I believe, but basically take your actionPerformed method, and replicate it under the execute command in you custom packet. You will need to first retrieve the tile entity from the correct block, since it's not passed in the packet. After you've done that, post your custom packet code.

Posted

I have made all of the files, and tested it out. When I try it out, the game crashes with a null pointer exception. I know it is doing this because there is no tile entity defined, but can't figure out where it is being initialized to null. Here are all of the files that have been updated, focus on the part in the gui where it creates a new packet, and the packet files

 

PacketHandler.java

package kris91268.lbd.Packet;

import java.util.logging.Logger;

import kris91268.lbd.Packet.PacketBase.ProtocolException;

import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.relauncher.Side;

/**
* 
* @author Arbiter
*
*/
public class PacketHandler implements IPacketHandler
{
@Override
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
{
	try
	{
		EntityPlayer entityPlayer = (EntityPlayer)player;
		ByteArrayDataInput in = ByteStreams.newDataInput(packet.data);
		int packetId = in.readUnsignedByte();
		PacketBase packetBase = PacketBase.constructPacket(packetId);
		packetBase.read(in);
		packetBase.execute(entityPlayer, entityPlayer.worldObj.isRemote ? Side.CLIENT : Side.SERVER);
	}
	catch (ProtocolException e)
	{
		if (player instanceof EntityPlayerMP)
		{
			((EntityPlayerMP)player).playerNetServerHandler.kickPlayerFromServer("Protocol Exception!");
			e.printStackTrace();
			Logger.getLogger("lbd").warning("Player " + ((EntityPlayer)player).username + " caused a Protocol Exception");
		}
	}
	catch (ReflectiveOperationException e)
	{
		throw new RuntimeException("Unexpected Reflection exception during Packet construction");
	}
}
}

 

PacketBase.java

package kris91268.lbd.Packet;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.packet.Packet;

import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;

import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.relauncher.Side;

/**
* 
* @author Arbiter
*
*/
public abstract class PacketBase
{
public static final String CHANNEL = "lbd";
private static final BiMap<Integer, Class<? extends PacketBase>> idMap;

static
{
	ImmutableBiMap.Builder<Integer, Class<? extends PacketBase>> builder = ImmutableBiMap.builder();
	builder.put(Integer.valueOf(0), PacketBlockChange.class);
	idMap = builder.build();
}	
public static PacketBase constructPacket(int packetId) throws ProtocolException, ReflectiveOperationException
{
	Class<? extends PacketBase> theClass = idMap.get(Integer.valueOf(packetId));
	if (theClass == null)
	{
		throw new ProtocolException("Unknown packet id");
	}
	else
	{
		return theClass.newInstance();
	}
}	
public static class ProtocolException extends Exception
{
	public ProtocolException()
	{

	}
	public ProtocolException(String message, Throwable cause)
	{
		super(message, cause);
	}
	public ProtocolException(String message)
	{
		super(message);
	}
	public ProtocolException(Throwable cause)
	{
		super(cause);
	}
}
public final int getPacketId()
{
	if (idMap.inverse().containsKey(getClass()))
	{
		return idMap.inverse().get(getClass()).intValue();
	}
	else
	{
		throw new RuntimeException("Packet " + getClass().getSimpleName() + " is missing a mapping");
	}
}
public final Packet makePacket()
{
	ByteArrayDataOutput out = ByteStreams.newDataOutput();
	out.writeByte(getPacketId());
	write(out);
	return PacketDispatcher.getPacket(CHANNEL, out.toByteArray());
}
public abstract void write(ByteArrayDataOutput out);

public abstract void read(ByteArrayDataInput in) throws ProtocolException;

public abstract void execute(EntityPlayer par1EntityPlayer, Side par2Side) throws ProtocolException;
}

 

PacketBlockChange.java

package kris91268.lbd.Packet;

import kris91268.lbd.Tileentity.TileEntityGravityLift;
import net.minecraft.entity.player.EntityPlayer;

import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;

import cpw.mods.fml.relauncher.Side;

/**
* 
* @author Arbiter
*
*/
public class PacketBlockChange extends PacketBase
{
private double height;
private TileEntityGravityLift tileEntity;

public PacketBlockChange(double height, TileEntityGravityLift par2, int x, int y, int z)
{
	this.height = height;
	tileEntity = (TileEntityGravityLift)par2.worldObj.getBlockTileEntity(x, y, z);
}
public PacketBlockChange()
{

}
@Override
public void write(ByteArrayDataOutput out)
{
	out.writeDouble(height);
}
@Override
public void read(ByteArrayDataInput in) throws ProtocolException
{
	height = in.readDouble();
}
@Override
public void execute(EntityPlayer player, Side side) throws ProtocolException
{
	if (side.isClient())
	{
		System.out.println(tileEntity.height);
		System.out.println(this.height);
		tileEntity.height = this.height;
	}
	else
	{
		throw new ProtocolException("Cannot send packet to server");
	}
}
}

 

GuiGravityLift.java

package kris91268.lbd;

import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

import cpw.mods.fml.common.network.PacketDispatcher;

import kris91268.lbd.Blocks.BlockGravityLift;
import kris91268.lbd.Packet.PacketBlockChange;
import kris91268.lbd.Tileentity.TileEntityGravityLift;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;

/**
* 
* @author Arbiter
*
*/
public class GuiGravityLift extends GuiContainer
{
private static final ResourceLocation texture = new ResourceLocation("lbd:textures/gui/gravlift.png");
private GuiButton dnButton;
private GuiButton decByPointZeroOne;
private GuiButton decByPointOne;
private GuiButton incByPointOne;
private GuiButton incByOnePointZero;
private GuiTextField number;
public static String gravLiftHeight;
private TileEntityGravityLift tileEntity;

public GuiGravityLift(InventoryPlayer par1, TileEntityGravityLift par2)
{
	super(new ContainerGravityLift(par1, par2));
	tileEntity = par2;
	gravLiftHeight = par2.height.toString();
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
	fontRenderer.drawString("Gravity Lift", 8, 6, 4210752);
	fontRenderer.drawString("Inventory", 8, ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
	this.mc.func_110434_K().func_110577_a(texture);
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	int x = (width - xSize) / 2;
	int y = (height - ySize) / 2;
	this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
	this.number.drawTextBox();
}
@Override
public void initGui()
{
	super.initGui();
	this.buttonList.clear();
	Keyboard.enableRepeatEvents(true);
	this.buttonList.add(this.dnButton = new GuiButton(0, this.width / 2 - 25, this.height / 4 + 35, 50, 20, "Done"));
	this.buttonList.add(this.decByPointZeroOne = new GuiButton(1, this.width / 2 - 75, this.height / 4 + 0, 40, 20, "-0.1"));
	this.buttonList.add(this.decByPointOne = new GuiButton(2, this.width / 2 - 75, this.height / 4 + 25, 40, 20, "-1.0"));
	this.buttonList.add(this.incByPointOne = new GuiButton(3, this.width / 2 + 25, this.height / 4 + 0, 40, 20, "+0.1"));
	this.buttonList.add(this.incByOnePointZero = new GuiButton(4, this.width / 2 + 25, this.height / 4 + 25, 40, 20, "+1.0"));
	this.number = new GuiTextField(this.fontRenderer, this.width / 2 - 20, this.height / 4 + 1, 40, 20);
	this.number.setVisible(true);
	this.number.setCanLoseFocus(false);
	this.number.setFocused(true);
	this.number.setText(tileEntity.height.toString());

}
public void onGuiClosed()
{
	Keyboard.enableRepeatEvents(false);
	Double theNumber = Double.parseDouble(gravLiftHeight);
	tileEntity.height = theNumber;
	tileEntity.bindHeightToTileEntity(theNumber);
}
public boolean isAboveZero(String par1Str)
{
	Double theDouble = Double.parseDouble(par1Str);
	return theDouble >= 0.00 ? true : false;
}
public boolean isBelowFive(String par1Str)
{
	Double theDouble = Double.parseDouble(par1Str);
	return theDouble <= 5.00 ? true : false;
}
public void updateScreen()
{
	this.number.updateCursorCounter();
}
/**
public void mouseClicked(int par1, int par2, int par3)
{
	super.mouseClicked(par1, par2, par3);
	this.number.mouseClicked(par1, par2, par3);
}
public void keyTyped(char par1, int par2)
{
	this.number.textboxKeyTyped(par1, par2);
	((GuiButton)this.buttonList.get(0)).enabled = this.number.getText().trim().length() > 0;
	if (par2 == 28 || par2 == 156)
	{
		this.actionPerformed((GuiButton)this.buttonList.get(0));
	}
}**/
@Override
protected void actionPerformed(GuiButton guiButton)
{
	switch (guiButton.id)
	{
	case 0:
		this.mc.displayGuiScreen((GuiScreen)null);
		break;
	case 1:
		Double heightInDoubles = Double.parseDouble(gravLiftHeight);
		if (heightInDoubles != 0.0)
		{
			heightInDoubles -= 0.1;
		}
		gravLiftHeight = heightInDoubles.toString();
		number.setText(gravLiftHeight);
		break;
	case 2:
		Double heightInDoubles1 = Double.parseDouble(gravLiftHeight);
		if (heightInDoubles1 < 1.0)
		{
			heightInDoubles1 = 0.0;
		}
		else
		{
			heightInDoubles1 -= 1.0;
		}
		gravLiftHeight = heightInDoubles1.toString();
		number.setText(gravLiftHeight);
		break;
	case 3:
		Double theHeight = Double.parseDouble(gravLiftHeight);
		if (theHeight != 5.0)
		{
			theHeight += 0.1;
		}
		gravLiftHeight = theHeight.toString();
		number.setText(gravLiftHeight);
		break;
	case 4:
		Double theNumber = Double.parseDouble(gravLiftHeight);
		if (theNumber > 4.0)
		{
			theNumber = 5.0;
		}
		else
		{
			theNumber += 1.0;
		}
		gravLiftHeight = theNumber.toString();
		number.setText(gravLiftHeight);
		System.out.println(tileEntity.height);
		int x = tileEntity.xCoord;
		int y = tileEntity.yCoord;
		int z = tileEntity.zCoord;
		PacketDispatcher.sendPacketToAllPlayers(new PacketBlockChange(theNumber, tileEntity, x, y, z).makePacket());
		default:
			break;
	}
}
}

 

TileEntityGravityLift.java

package kris91268.lbd.Tileentity;

import java.awt.List;

import kris91268.lbd.Blocks.BlockGravityLift;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagDouble;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

/**
* 
* @author Arbiter
*
*/
public class TileEntityGravityLift extends TileEntity
{
private String aString;
public Double height = new Double(0.0D);			

public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
	super.readFromNBT(par1NBTTagCompound);
	height = par1NBTTagCompound.getDouble("height");
}
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
	super.writeToNBT(par1NBTTagCompound);
	par1NBTTagCompound.setDouble("height", height);
}
public boolean isUsableByPlayer(EntityPlayer par1EntityPlayer)
{
	return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : 
		par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
}
public void something(String par1Str)
{
	this.aString = par1Str;
}
public void bindHeightToTileEntity(double theHeight)
{
	this.height = theHeight;
}
}

 

Tell me if you need any other files

 

And again, thanks for the help you have given me so far.

Posted

Well, I don't think this will solve the nullpointer (could you post the stacktrace?), but here are two things that definately are needed:

 

1. In the GUI class where you send the packet, you're using "PacketDispatcher.sendPacketToAllPlayers()". However, this method is used to send data from the server to all the clients (players). You obviously need the opposite. Use "PacketDispatcher.sendPacketToServer()" instead.

2. Do you have your PacketHandler registered? Make sure you have the @NetworkMod annotation on top of your main mod class (under or above the @Mod annotation). This should work:

 

@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {PacketBase.CHANNEL}, packetHandler = PacketHandler.class)

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

Posted

Well, I don't think this will solve the nullpointer (could you post the stacktrace?), but here are two things that definately are needed:

 

1. In the GUI class where you send the packet, you're using "PacketDispatcher.sendPacketToAllPlayers()". However, this method is used to send data from the server to all the clients (players). You obviously need the opposite. Use "PacketDispatcher.sendPacketToServer()" instead.

2. Do you have your PacketHandler registered? Make sure you have the @NetworkMod annotation on top of your main mod class (under or above the @Mod annotation). This should work:

 

@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {PacketBase.CHANNEL}, packetHandler = PacketHandler.class)

 

I have all of the required fields under NetworkMod, and if I try using the sendPacketToServer() method, the game just crashes and says that a packet cannot be sent to a server.

 

Here is the stacktrace for using the sendPacketToAllPlayers() method

Jul 30, 2013 4:03:58 PM net.minecraft.launchwrapper.LogWrapper log
INFO: Using tweak class name cpw.mods.fml.common.launcher.FMLTweaker
2013-07-30 16:03:58 [iNFO] [ForgeModLoader] Forge Mod Loader version 6.2.7.779 for Minecraft 1.6.2 loading
2013-07-30 16:03:58 [iNFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_21, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
2013-07-30 16:03:59 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2013-07-30 16:03:59 [iNFO] [sTDOUT] Loaded 39 rules from AccessTransformer config file fml_at.cfg
2013-07-30 16:03:59 [iNFO] [sTDOUT] Loaded 107 rules from AccessTransformer config file forge_at.cfg
2013-07-30 16:03:59 [sEVERE] [ForgeModLoader] The binary patch set is missing. Things are probably about to go very wrong.
2013-07-30 16:03:59 [iNFO] [ForgeModLoader] Launching wrapped minecraft
2013-07-30 16:04:00 [iNFO] [Minecraft-Client] Setting user: Player170
2013-07-30 16:04:00 [iNFO] [Minecraft-Client] (Session ID is null)
2013-07-30 16:04:02 [iNFO] [Minecraft-Client] LWJGL Version: 2.9.0
2013-07-30 16:04:03 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default
2013-07-30 16:04:03 [iNFO] [sTDOUT] 
2013-07-30 16:04:03 [iNFO] [sTDOUT] Starting up SoundSystem...
2013-07-30 16:04:03 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization
2013-07-30 16:04:03 [iNFO] [sTDOUT] MinecraftForge v9.10.0.779 Initialized
2013-07-30 16:04:03 [iNFO] [ForgeModLoader] MinecraftForge v9.10.0.779 Initialized
2013-07-30 16:04:03 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2013-07-30 16:04:03 [iNFO] [sTDOUT]     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
2013-07-30 16:04:03 [iNFO] [sTDOUT] Replaced 101 ore recipies
2013-07-30 16:04:03 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization
2013-07-30 16:04:03 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Arbiter\Documents\Minecraft\Minecraft Modding\mcp 1.6.2\mcp\jars\config\logging.properties
2013-07-30 16:04:03 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2013-07-30 16:04:03 [iNFO] [sTDOUT] OpenAL initialized.
2013-07-30 16:04:04 [iNFO] [ForgeModLoader] Searching C:\Users\Arbiter\Documents\Minecraft\Minecraft Modding\mcp 1.6.2\mcp\jars\mods for mods
2013-07-30 16:04:04 [iNFO] [sTDOUT] 
2013-07-30 16:04:11 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 5 mods to load
2013-07-30 16:04:11 [iNFO] [mcp] Activating mod mcp
2013-07-30 16:04:11 [iNFO] [FML] Activating mod FML
2013-07-30 16:04:11 [iNFO] [Forge] Activating mod Forge
2013-07-30 16:04:11 [iNFO] [fireworks] Activating mod fireworks
2013-07-30 16:04:11 [iNFO] [LightBridgesAndDoors] Activating mod LightBridgesAndDoors
2013-07-30 16:04:11 [iNFO] [ForgeModLoader] Registering Forge Packet Handler
2013-07-30 16:04:11 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler
2013-07-30 16:04:11 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2013-07-30 16:04:12 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightRailSource.png
2013-07-30 16:04:12 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightSection.png
2013-07-30 16:04:12 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightRailSourceActive.png
2013-07-30 16:04:12 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightDoorSource.png
2013-07-30 16:04:12 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/gravityLift.png
2013-07-30 16:04:12 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightRailSection.png
2013-07-30 16:04:12 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightBridgeSource.png
2013-07-30 16:04:13 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: missing_icon_item_5316_fireworks:textures/items/cardboard.png
2013-07-30 16:04:13 [WARNING] [ForgeModLoader] Mod LightBridgesAndDoors attempted to register a gui network handler during a construction phase
2013-07-30 16:04:13 [iNFO] [sTDERR] java.net.UnknownHostException: www.light-bridges-and-doors-mod.webnode.com
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.net.PlainSocketImpl.connect(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.net.SocksSocketImpl.connect(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.net.Socket.connect(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.net.Socket.connect(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.NetworkClient.doConnect(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.openServer(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.openServer(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.<init>(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.New(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.New(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at kris91268.lbd.UpdateChecker.checkForUpdate(UpdateChecker.java:39)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at kris91268.lbd.ModLBD.init(ModLBD.java:178)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:222)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.startGame(Minecraft.java:506)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.client.main.Main.main(Main.java:93)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
2013-07-30 16:04:13 [iNFO] [sTDOUT] [LightBridgesAndDoors] Failed to find http://www.light-bridges-and-doors-mod.webnode.com/changelog/, prehaps you are not connected to the internet
2013-07-30 16:04:13 [iNFO] [sTDOUT] www.light-bridges-and-doors-mod.webnode.com
2013-07-30 16:04:13 [iNFO] [sTDOUT] Failed to load from the website
2013-07-30 16:04:13 [iNFO] [sTDERR] java.lang.NullPointerException
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at kris91268.lbd.UpdateChecker.isThereANewUpdate(UpdateChecker.java:66)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at kris91268.lbd.ModLBD.init(ModLBD.java:180)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:222)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.startGame(Minecraft.java:506)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.client.main.Main.main(Main.java:93)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
2013-07-30 16:04:13 [iNFO] [sTDERR] 	at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
2013-07-30 16:04:13 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 5 mods
2013-07-30 16:04:13 [WARNING] [Fireworks+] Mod Fireworks+ is missing a pack.mcmeta file, things may not work well
2013-07-30 16:04:13 [WARNING] [kris91268's Light Bridges and Doors] Mod kris91268's Light Bridges and Doors is missing a pack.mcmeta file, things may not work well
2013-07-30 16:04:13 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Fireworks+, FMLFileResourcePack:kris91268's Light Bridges and Doors
2013-07-30 16:04:13 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: missing_icon_item_5316_fireworks:textures/items/cardboard.png
2013-07-30 16:04:13 [iNFO] [sTDOUT] 
2013-07-30 16:04:13 [iNFO] [sTDOUT] SoundSystem shutting down...
2013-07-30 16:04:13 [iNFO] [sTDOUT]     Author: Paul Lamb, www.paulscode.com
2013-07-30 16:04:13 [iNFO] [sTDOUT] 
2013-07-30 16:04:13 [iNFO] [sTDOUT] 
2013-07-30 16:04:13 [iNFO] [sTDOUT] Starting up SoundSystem...
2013-07-30 16:04:13 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2013-07-30 16:04:13 [iNFO] [sTDOUT]     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
2013-07-30 16:04:14 [iNFO] [sTDOUT] OpenAL initialized.
2013-07-30 16:04:14 [sEVERE] [Minecraft-Client] Realms: Server not available!
2013-07-30 16:04:14 [iNFO] [sTDOUT] 
2013-07-30 16:04:19 [iNFO] [Minecraft-Server] Starting integrated minecraft server version 1.6.2
2013-07-30 16:04:19 [iNFO] [Minecraft-Server] Generating keypair
2013-07-30 16:04:20 [iNFO] [ForgeModLoader] Loading dimension 0 (aghsdf) (net.minecraft.server.integrated.IntegratedServer@6cf81618)
2013-07-30 16:04:20 [iNFO] [ForgeModLoader] Loading dimension 1 (aghsdf) (net.minecraft.server.integrated.IntegratedServer@6cf81618)
2013-07-30 16:04:20 [iNFO] [ForgeModLoader] Loading dimension -1 (aghsdf) (net.minecraft.server.integrated.IntegratedServer@6cf81618)
2013-07-30 16:04:20 [iNFO] [Minecraft-Server] Preparing start region for level 0
2013-07-30 16:04:21 [iNFO] [sTDOUT] loading single player
2013-07-30 16:04:21 [iNFO] [Minecraft-Server] Player170[/127.0.0.1:0] logged in with entity id 113 at (196.1191858953188, 67.0, -39.81733750857464)
2013-07-30 16:04:21 [iNFO] [Minecraft-Server] Player170 joined the game
2013-07-30 16:04:22 [iNFO] [sTDOUT] Setting up custom skins
2013-07-30 16:04:22 [iNFO] [sTDERR] java.net.UnknownHostException: skins.minecraft.net
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.PlainSocketImpl.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.SocksSocketImpl.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.Socket.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.Socket.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.NetworkClient.doConnect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.openServer(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.openServer(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.<init>(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.New(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.New(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at net.minecraft.client.renderer.ThreadDownloadImageDataINNER1.run(ThreadDownloadImageDataINNER1.java:30)
2013-07-30 16:04:22 [iNFO] [sTDERR] java.net.UnknownHostException: skins.minecraft.net
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.PlainSocketImpl.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.SocksSocketImpl.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.Socket.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at java.net.Socket.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.NetworkClient.doConnect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.openServer(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.openServer(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.<init>(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.New(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.http.HttpClient.New(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
2013-07-30 16:04:22 [iNFO] [sTDERR] 	at net.minecraft.client.renderer.ThreadDownloadImageDataINNER1.run(ThreadDownloadImageDataINNER1.java:30)
2013-07-30 16:04:24 [iNFO] [sTDOUT] 1.0
2013-07-30 16:04:24 [iNFO] [Minecraft-Server] Stopping server
2013-07-30 16:04:24 [iNFO] [Minecraft-Server] Saving players
2013-07-30 16:04:24 [iNFO] [Minecraft-Server] Player170 left the game
2013-07-30 16:04:24 [iNFO] [Minecraft-Server] Saving worlds
2013-07-30 16:04:24 [iNFO] [Minecraft-Server] Saving chunks for level 'aghsdf'/Overworld
2013-07-30 16:04:25 [iNFO] [Minecraft-Server] Saving chunks for level 'aghsdf'/Nether
2013-07-30 16:04:25 [iNFO] [Minecraft-Server] Saving chunks for level 'aghsdf'/The End
2013-07-30 16:04:25 [iNFO] [ForgeModLoader] Unloading dimension 0
2013-07-30 16:04:25 [iNFO] [ForgeModLoader] Unloading dimension -1
2013-07-30 16:04:25 [iNFO] [ForgeModLoader] Unloading dimension 1
2013-07-30 16:04:25 [iNFO] [sTDERR] net.minecraft.util.ReportedException: Exception in world tick
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1932)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:898)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.client.main.Main.main(Main.java:93)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
2013-07-30 16:04:25 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at kris91268.lbd.Packet.PacketBlockChange.execute(PacketBlockChange.java:45)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at kris91268.lbd.Packet.PacketHandler.onPacketData(PacketHandler.java:35)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.NetworkRegistry.handlePacket(NetworkRegistry.java:255)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.NetworkRegistry.handleCustomPacket(NetworkRegistry.java:245)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:84)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.client.multiplayer.NetClientHandler.handleCustomPayload(NetClientHandler.java:1647)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.network.packet.Packet250CustomPayload.processPacket(Packet250CustomPayload.java:70)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:281)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:99)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1916)
2013-07-30 16:04:25 [iNFO] [sTDERR] 	... 9 more
2013-07-30 16:04:25 [iNFO] [sTDOUT] ---- Minecraft Crash Report ----
2013-07-30 16:04:25 [iNFO] [sTDOUT] // Shall we play a game?
2013-07-30 16:04:25 [iNFO] [sTDOUT] 
2013-07-30 16:04:25 [iNFO] [sTDOUT] Time: 30/07/13 4:04 PM
2013-07-30 16:04:25 [iNFO] [sTDOUT] Description: Exception in world tick
2013-07-30 16:04:25 [iNFO] [sTDOUT] 
2013-07-30 16:04:25 [iNFO] [sTDOUT] java.lang.NullPointerException
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at kris91268.lbd.Packet.PacketBlockChange.execute(PacketBlockChange.java:45)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at kris91268.lbd.Packet.PacketHandler.onPacketData(PacketHandler.java:35)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at cpw.mods.fml.common.network.NetworkRegistry.handlePacket(NetworkRegistry.java:255)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at cpw.mods.fml.common.network.NetworkRegistry.handleCustomPacket(NetworkRegistry.java:245)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:84)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.multiplayer.NetClientHandler.handleCustomPayload(NetClientHandler.java:1647)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.network.packet.Packet250CustomPayload.processPacket(Packet250CustomPayload.java:70)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:281)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.multiplayer.WorldClient.tick(WorldClient.java:99)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1916)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:898)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.main.Main.main(Main.java:93)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 
2013-07-30 16:04:25 [iNFO] [sTDOUT] 
2013-07-30 16:04:25 [iNFO] [sTDOUT] A detailed walkthrough of the error, its code path and all known details is as follows:
2013-07-30 16:04:25 [iNFO] [sTDOUT] ---------------------------------------------------------------------------------------
2013-07-30 16:04:25 [iNFO] [sTDOUT] 
2013-07-30 16:04:25 [iNFO] [sTDOUT] -- Head --
2013-07-30 16:04:25 [iNFO] [sTDOUT] Stacktrace:
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at kris91268.lbd.Packet.PacketBlockChange.execute(PacketBlockChange.java:45)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at kris91268.lbd.Packet.PacketHandler.onPacketData(PacketHandler.java:35)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at cpw.mods.fml.common.network.NetworkRegistry.handlePacket(NetworkRegistry.java:255)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at cpw.mods.fml.common.network.NetworkRegistry.handleCustomPacket(NetworkRegistry.java:245)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:84)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.multiplayer.NetClientHandler.handleCustomPayload(NetClientHandler.java:1647)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.network.packet.Packet250CustomPayload.processPacket(Packet250CustomPayload.java:70)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.multiplayer.NetClientHandler.processReadPackets(NetClientHandler.java:281)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 
2013-07-30 16:04:25 [iNFO] [sTDOUT] -- Affected level --
2013-07-30 16:04:25 [iNFO] [sTDOUT] Details:
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level name: MpServer
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	All players: 1 total; [EntityClientPlayerMP['Player170'/113, l='MpServer', x=196.12, y=68.62, z=-39.82]]
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Chunk stats: MultiplayerChunkCache: 310
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level seed: 0
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level generator: ID 00 - default, ver 1. Features enabled: false
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level generator options: 
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level spawn location: World: (192,64,-44), Chunk: (at 0,4,4 in 12,-3; contains blocks 192,0,-48 to 207,255,-33), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level time: 14484 game time, 887 day time
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level dimension: 0
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level storage version: 0x00000 - Unknown?
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Forced entities: 31 total; [EntityBat['Bat'/64, l='MpServer', x=160.45, y=36.01, z=-37.44], EntityBat['Bat'/77, l='MpServer', x=198.75, y=47.10, z=-53.47], EntityBat['Bat'/78, l='MpServer', x=201.45, y=47.06, z=-48.90], EntityBat['Bat'/79, l='MpServer', x=197.34, y=47.81, z=-47.51], EntityBat['Bat'/72, l='MpServer', x=185.63, y=24.10, z=-23.25], EntityBat['Bat'/87, l='MpServer', x=221.62, y=44.39, z=-61.07], EntityBat['Bat'/86, l='MpServer', x=210.25, y=34.10, z=-75.06], EntityItem['item.tile.grass'/81, l='MpServer', x=200.72, y=67.13, z=-38.91], EntityItem['item.tile.lbd:gravityLift'/80, l='MpServer', x=197.19, y=67.13, z=-41.53], EntityBat['Bat'/82, l='MpServer', x=199.69, y=21.10, z=-17.09], EntityBat['Bat'/93, l='MpServer', x=237.75, y=32.10, z=-45.25], EntityBat['Bat'/92, l='MpServer', x=238.43, y=41.84, z=-51.22], EntityBat['Bat'/95, l='MpServer', x=237.19, y=31.60, z=-50.48], EntityBat['Bat'/94, l='MpServer', x=231.14, y=36.84, z=-48.66], EntityPig['Pig'/89, l='MpServer', x=230.69, y=69.00, z=-107.09], EntityBat['Bat'/88, l='MpServer', x=215.25, y=52.10, z=-55.50], EntityBat['Bat'/91, l='MpServer', x=225.56, y=44.10, z=-67.69], EntityPig['Pig'/90, l='MpServer', x=230.25, y=69.00, z=-104.94], EntityPig['Pig'/103, l='MpServer', x=260.53, y=66.00, z=-107.56], EntityPig['Pig'/100, l='MpServer', x=254.22, y=64.00, z=-96.03], EntityBat['Bat'/101, l='MpServer', x=242.63, y=35.10, z=-48.25], EntityBat['Bat'/98, l='MpServer', x=254.75, y=53.10, z=-94.31], EntityPig['Pig'/99, l='MpServer', x=252.44, y=64.00, z=-95.53], EntityPig['Pig'/96, l='MpServer', x=249.47, y=65.00, z=-98.53], EntityPig['Pig'/97, l='MpServer', x=252.91, y=67.00, z=-107.53], EntityPig['Pig'/106, l='MpServer', x=270.81, y=64.00, z=-40.34], EntityPig['Pig'/107, l='MpServer', x=275.28, y=64.00, z=-57.78], EntityPig['Pig'/104, l='MpServer', x=260.03, y=63.00, z=-59.91], EntityPig['Pig'/105, l='MpServer', x=262.14, y=63.00, z=-48.97], EntityClientPlayerMP['Player170'/113, l='MpServer', x=196.12, y=68.62, z=-39.82], EntityBat['Bat'/63, l='MpServer', x=170.75, y=48.10, z=-108.69]]
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Retry entities: 0 total; []
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Server brand: fml,forge
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Server type: Integrated singleplayer server
2013-07-30 16:04:25 [iNFO] [sTDOUT] Stacktrace:
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:440)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1929)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:898)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.client.main.Main.main(Main.java:93)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at java.lang.reflect.Method.invoke(Unknown Source)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 
2013-07-30 16:04:25 [iNFO] [sTDOUT] -- Affected level --
2013-07-30 16:04:25 [iNFO] [sTDOUT] Details:
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level name: MpServer
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	All players: 1 total; [EntityClientPlayerMP['Player170'/113, l='MpServer', x=196.12, y=68.62, z=-39.82]]
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Chunk stats: MultiplayerChunkCache: 310
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level seed: 0
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level generator: ID 00 - default, ver 1. Features enabled: false
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level generator options: 
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level spawn location: World: (192,64,-44), Chunk: (at 0,4,4 in 12,-3; contains blocks 192,0,-48 to 207,255,-33), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level time: 14484 game time, 887 day time
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level dimension: 0
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level storage version: 0x00000 - Unknown?
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Forced entities: 31 total; [EntityBat['Bat'/64, l='MpServer', x=160.45, y=36.01, z=-37.44], EntityBat['Bat'/77, l='MpServer', x=198.75, y=47.10, z=-53.47], EntityBat['Bat'/78, l='MpServer', x=201.45, y=47.06, z=-48.90], EntityBat['Bat'/79, l='MpServer', x=197.34, y=47.81, z=-47.51], EntityBat['Bat'/72, l='MpServer', x=185.63, y=24.10, z=-23.25], EntityBat['Bat'/87, l='MpServer', x=221.62, y=44.39, z=-61.07], EntityBat['Bat'/86, l='MpServer', x=210.25, y=34.10, z=-75.06], EntityItem['item.tile.grass'/81, l='MpServer', x=200.72, y=67.13, z=-38.91], EntityItem['item.tile.lbd:gravityLift'/80, l='MpServer', x=197.19, y=67.13, z=-41.53], EntityBat['Bat'/82, l='MpServer', x=199.69, y=21.10, z=-17.09], EntityBat['Bat'/93, l='MpServer', x=237.75, y=32.10, z=-45.25], EntityBat['Bat'/92, l='MpServer', x=238.43, y=41.84, z=-51.22], EntityBat['Bat'/95, l='MpServer', x=237.19, y=31.60, z=-50.48], EntityBat['Bat'/94, l='MpServer', x=231.14, y=36.84, z=-48.66], EntityPig['Pig'/89, l='MpServer', x=230.69, y=69.00, z=-107.09], EntityBat['Bat'/88, l='MpServer', x=215.25, y=52.10, z=-55.50], EntityBat['Bat'/91, l='MpServer', x=225.56, y=44.10, z=-67.69], EntityPig['Pig'/90, l='MpServer', x=230.25, y=69.00, z=-104.94], EntityPig['Pig'/103, l='MpServer', x=260.53, y=66.00, z=-107.56], EntityPig['Pig'/100, l='MpServer', x=254.22, y=64.00, z=-96.03], EntityBat['Bat'/101, l='MpServer', x=242.63, y=35.10, z=-48.25], EntityBat['Bat'/98, l='MpServer', x=254.75, y=53.10, z=-94.31], EntityPig['Pig'/99, l='MpServer', x=252.44, y=64.00, z=-95.53], EntityPig['Pig'/96, l='MpServer', x=249.47, y=65.00, z=-98.53], EntityPig['Pig'/97, l='MpServer', x=252.91, y=67.00, z=-107.53], EntityPig['Pig'/106, l='MpServer', x=270.81, y=64.00, z=-40.34], EntityPig['Pig'/107, l='MpServer', x=275.28, y=64.00, z=-57.78], EntityPig['Pig'/104, l='MpServer', x=260.03, y=63.00, z=-59.91], EntityPig['Pig'/105, l='MpServer', x=262.14, y=63.00, z=-48.97], EntityClientPlayerMP['Player170'/113, l='MpServer', x=196.12, y=68.62, z=-39.82], EntityBat['Bat'/63, l='MpServer', x=170.75, y=48.10, z=-108.69]]
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Retry entities: 0 total; []
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Server brand: fml,forge
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Server type: Integrated singleplayer server
2013-07-30 16:04:25 [iNFO] [sTDOUT] 
2013-07-30 16:04:25 [iNFO] [sTDOUT] -- System Details --
2013-07-30 16:04:25 [iNFO] [sTDOUT] Details:
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Minecraft Version: 1.6.2
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Operating System: Windows 7 (amd64) version 6.1
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Java Version: 1.7.0_21, Oracle Corporation
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Memory: 802305360 bytes (765 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	AABB Pool Size: 3251 (182056 bytes; 0 MB) allocated, 373 (20888 bytes; 0 MB) used
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Suspicious classes: FML and Forge are installed
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	IntCache: cache: 0, tcache: 0, allocated: 1, tallocated: 63
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	FML: MCP v8.04 FML v6.2.7.779 Minecraft Forge 9.10.0.779 5 mods loaded, 5 mods active
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	FML{6.2.7.779} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Forge{9.10.0.779} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	fireworks{0.1.0} [Fireworks+] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	LightBridgesAndDoors{0.1.5} [kris91268's Light Bridges and Doors] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Launched Version: 1.6
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	LWJGL: 2.9.0
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	OpenGL: Intel(R) HD Graphics 4000 GL version 3.3.0 - Build 8.15.10.2653, Intel
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Is Modded: Definitely; Client brand changed to 'fml,forge'
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Type: Client (map_client.txt)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Resource Pack: Default
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Current Language: English (US)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Profiler Position: N/A (disabled)
2013-07-30 16:04:25 [iNFO] [sTDOUT] 	Vec3 Pool Size: 571 (31976 bytes; 0 MB) allocated, 62 (3472 bytes; 0 MB) used
2013-07-30 16:04:25 [iNFO] [sTDOUT] #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Arbiter\Documents\Minecraft\Minecraft Modding\mcp 1.6.2\mcp\jars\.\crash-reports\crash-2013-07-30_16.04.25-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed

 

And here is the stacktrace when using the sendPacketToServer() method

Jul 30, 2013 7:53:20 PM net.minecraft.launchwrapper.LogWrapper log
INFO: Using tweak class name cpw.mods.fml.common.launcher.FMLTweaker
2013-07-30 19:53:20 [iNFO] [ForgeModLoader] Forge Mod Loader version 6.2.7.779 for Minecraft 1.6.2 loading
2013-07-30 19:53:20 [iNFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_21, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
2013-07-30 19:53:20 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2013-07-30 19:53:20 [iNFO] [sTDOUT] Loaded 39 rules from AccessTransformer config file fml_at.cfg
2013-07-30 19:53:20 [iNFO] [sTDOUT] Loaded 107 rules from AccessTransformer config file forge_at.cfg
2013-07-30 19:53:21 [sEVERE] [ForgeModLoader] The binary patch set is missing. Things are probably about to go very wrong.
2013-07-30 19:53:21 [iNFO] [ForgeModLoader] Launching wrapped minecraft
2013-07-30 19:53:22 [iNFO] [Minecraft-Client] Setting user: Player30
2013-07-30 19:53:22 [iNFO] [Minecraft-Client] (Session ID is null)
2013-07-30 19:53:24 [iNFO] [Minecraft-Client] LWJGL Version: 2.9.0
2013-07-30 19:53:25 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default
2013-07-30 19:53:25 [iNFO] [sTDOUT] 
2013-07-30 19:53:25 [iNFO] [sTDOUT] Starting up SoundSystem...
2013-07-30 19:53:25 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization
2013-07-30 19:53:25 [iNFO] [sTDOUT] MinecraftForge v9.10.0.779 Initialized
2013-07-30 19:53:25 [iNFO] [ForgeModLoader] MinecraftForge v9.10.0.779 Initialized
2013-07-30 19:53:25 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2013-07-30 19:53:25 [iNFO] [sTDOUT]     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
2013-07-30 19:53:26 [iNFO] [sTDOUT] OpenAL initialized.
2013-07-30 19:53:26 [iNFO] [sTDOUT] Replaced 101 ore recipies
2013-07-30 19:53:26 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization
2013-07-30 19:53:26 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Arbiter\Documents\Minecraft\Minecraft Modding\mcp 1.6.2\mcp\jars\config\logging.properties
2013-07-30 19:53:26 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2013-07-30 19:53:26 [iNFO] [sTDOUT] 
2013-07-30 19:53:26 [iNFO] [ForgeModLoader] Searching C:\Users\Arbiter\Documents\Minecraft\Minecraft Modding\mcp 1.6.2\mcp\jars\mods for mods
2013-07-30 19:53:34 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 5 mods to load
2013-07-30 19:53:34 [iNFO] [mcp] Activating mod mcp
2013-07-30 19:53:34 [iNFO] [FML] Activating mod FML
2013-07-30 19:53:34 [iNFO] [Forge] Activating mod Forge
2013-07-30 19:53:34 [iNFO] [fireworks] Activating mod fireworks
2013-07-30 19:53:34 [iNFO] [LightBridgesAndDoors] Activating mod LightBridgesAndDoors
2013-07-30 19:53:34 [iNFO] [ForgeModLoader] Registering Forge Packet Handler
2013-07-30 19:53:34 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler
2013-07-30 19:53:34 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2013-07-30 19:53:35 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightRailSource.png
2013-07-30 19:53:35 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightSection.png
2013-07-30 19:53:35 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightRailSourceActive.png
2013-07-30 19:53:35 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightDoorSource.png
2013-07-30 19:53:35 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/gravityLift.png
2013-07-30 19:53:35 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightRailSection.png
2013-07-30 19:53:35 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: lbd:textures/blocks/lightBridgeSource.png
2013-07-30 19:53:36 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: missing_icon_item_5316_fireworks:textures/items/cardboard.png
2013-07-30 19:53:36 [WARNING] [ForgeModLoader] Mod LightBridgesAndDoors attempted to register a gui network handler during a construction phase
2013-07-30 19:53:37 [iNFO] [sTDOUT] [LightBridgesAndDoors] Successfully loaded info from http://www.light-bridges-and-doors-mod.webnode.com/changelog/
2013-07-30 19:53:37 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 5 mods
2013-07-30 19:53:37 [WARNING] [Fireworks+] Mod Fireworks+ is missing a pack.mcmeta file, things may not work well
2013-07-30 19:53:37 [WARNING] [kris91268's Light Bridges and Doors] Mod kris91268's Light Bridges and Doors is missing a pack.mcmeta file, things may not work well
2013-07-30 19:53:37 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Fireworks+, FMLFileResourcePack:kris91268's Light Bridges and Doors
2013-07-30 19:53:38 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: missing_icon_item_5316_fireworks:textures/items/cardboard.png
2013-07-30 19:53:38 [iNFO] [sTDOUT] 
2013-07-30 19:53:38 [iNFO] [sTDOUT] SoundSystem shutting down...
2013-07-30 19:53:38 [iNFO] [sTDOUT]     Author: Paul Lamb, www.paulscode.com
2013-07-30 19:53:38 [iNFO] [sTDOUT] 
2013-07-30 19:53:38 [iNFO] [sTDOUT] 
2013-07-30 19:53:38 [iNFO] [sTDOUT] Starting up SoundSystem...
2013-07-30 19:53:38 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2013-07-30 19:53:38 [iNFO] [sTDOUT]     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
2013-07-30 19:53:38 [iNFO] [sTDOUT] OpenAL initialized.
2013-07-30 19:53:39 [iNFO] [sTDOUT] 
2013-07-30 19:53:39 [sEVERE] [Minecraft-Client] Realms: Invalid session id
2013-07-30 19:53:44 [iNFO] [Minecraft-Server] Starting integrated minecraft server version 1.6.2
2013-07-30 19:53:44 [iNFO] [Minecraft-Server] Generating keypair
2013-07-30 19:53:45 [iNFO] [ForgeModLoader] Loading dimension 0 (aghsdf) (net.minecraft.server.integrated.IntegratedServer@2c27973)
2013-07-30 19:53:45 [iNFO] [ForgeModLoader] Loading dimension 1 (aghsdf) (net.minecraft.server.integrated.IntegratedServer@2c27973)
2013-07-30 19:53:45 [iNFO] [ForgeModLoader] Loading dimension -1 (aghsdf) (net.minecraft.server.integrated.IntegratedServer@2c27973)
2013-07-30 19:53:45 [iNFO] [Minecraft-Server] Preparing start region for level 0
2013-07-30 19:53:47 [iNFO] [sTDOUT] loading single player
2013-07-30 19:53:47 [iNFO] [Minecraft-Server] Player30[/127.0.0.1:0] logged in with entity id 113 at (196.1191858953188, 67.0, -39.81733750857464)
2013-07-30 19:53:47 [iNFO] [Minecraft-Server] Player30 joined the game
2013-07-30 19:53:47 [iNFO] [sTDOUT] Setting up custom skins
2013-07-30 19:53:49 [iNFO] [sTDOUT] 0.0
2013-07-30 19:53:49 [iNFO] [Minecraft-Server] Player30 left the game
2013-07-30 19:53:49 [iNFO] [sTDERR] kris91268.lbd.Packet.PacketBase$ProtocolException: Cannot send packet to server
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at kris91268.lbd.Packet.PacketBlockChange.execute(PacketBlockChange.java:51)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at kris91268.lbd.Packet.PacketHandler.onPacketData(PacketHandler.java:35)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.NetworkRegistry.handlePacket(NetworkRegistry.java:255)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.NetworkRegistry.handleCustomPacket(NetworkRegistry.java:245)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:84)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.network.NetServerHandler.handleCustomPayload(NetServerHandler.java:1111)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.network.packet.Packet250CustomPayload.processPacket(Packet250CustomPayload.java:70)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:689)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
2013-07-30 19:53:49 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-07-30 19:53:49 [iNFO] [Minecraft-Server] Player30 lost connection: 
2013-07-30 19:53:49 [iNFO] [Minecraft-Server] Player30 left the game
2013-07-30 19:53:49 [iNFO] [Minecraft-Server] Stopping singleplayer server as player logged out
2013-07-30 19:53:49 [iNFO] [Minecraft-Server] Stopping server
2013-07-30 19:53:49 [iNFO] [Minecraft-Server] Saving players
2013-07-30 19:53:49 [iNFO] [Minecraft-Server] Saving worlds
2013-07-30 19:53:49 [iNFO] [Minecraft-Server] Saving chunks for level 'aghsdf'/Overworld
2013-07-30 19:53:50 [iNFO] [Minecraft-Server] Saving chunks for level 'aghsdf'/Nether
2013-07-30 19:53:50 [iNFO] [Minecraft-Server] Saving chunks for level 'aghsdf'/The End
2013-07-30 19:53:50 [iNFO] [ForgeModLoader] Unloading dimension 0
2013-07-30 19:53:50 [iNFO] [ForgeModLoader] Unloading dimension -1
2013-07-30 19:53:50 [iNFO] [ForgeModLoader] Unloading dimension 1

 

I know it is coded to throw an exception if the world type is server, but I was taught that that was the best way.

Posted

At first my tile entities were not being added so i did this:

public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
par1World.setBlockTileEntity(par2, par3, par4, new TileEntityMageticSmelter());
}

Posted

your tile entity is not being created because your block class is not Overring the method hasTileEntity

 

@Override
public boolean hasTileEntity(int meta) {
return true;
}

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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.