I have a FakePlayer class that extends EntityPlayer (so by definition, FakePlayer is also an EntityPlayer).
For packet handling I am trying to cast FakePlayer as a EntityClientPlayerMP as such:
Side side = FMLCommonHandler.instance().getEffectiveSide();
if(side == Side.SERVER)
{
//We are on the server side
EntityPlayerMP player = (EntityPlayerMP)thePlayer;
}
else if(side == Side.CLIENT)
{
EntityClientPlayerMP player = (EntityClientPlayerMP) thePlayer;
player.sendQueue.addToSendQueue(packet);
}
else{
//Error!
}
where thePlayer is the FakePlayer object. This throws the following error:
onicraft.FakePlayer cannot be cast to net.minecraft.client.entity.EntityClientPlayerMP
Any ideas?
I have looked at buildcraft and he too uses setBlockwithNotify to replace blocks with air blocks once they are mined. My issue is that when I do the same thing the blocks do get replaced but I cant walk into the new 'air' blocks without being pushed back away from them as if they are still solid blocks.
I am currently working on a block that will act as a quarry. However, I am currently stuck on how to actually target a specific block in the world for destruction. I have tried world.setBlockWithNotify(x,y,z,0) but after the blocks were destroyed I could not run into the area as I kept hitting an invisible wall of blocks (the new 'air' blocks i guess?).
Any ideas?