The error is in the blockPortal code :
first, the variable mc you use is not initialized with the actual minecraft instance, so it is actually empty, so use instead the ModLoader.getMinecraftInstance()
second, you will face a problem : the code will work but the usePortal() teleport you instantly, and when you will arrive in th edimension, you will be teleported back, and so on. To avoid this problem I used this code (this is certainly not the best way to do it but a least it work) :
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
if(entity.ridingEntity == null && entity.riddenByEntity == null && entity instanceof EntityPlayerSP)
{
if(ModLoader.getMinecraftInstance().thePlayer.timeUntilPortal == 0)
{
if(ModLoader.getMinecraftInstance().thePlayer.dimension != 2)
{
ModLoader.getMinecraftInstance().thePlayer.timeUntilPortal = 10;
ModLoader.getMinecraftInstance().usePortal(2, mod_ghostdimension.TeleporterGhost);
}else
{
ModLoader.getMinecraftInstance().thePlayer.timeUntilPortal = 10;
ModLoader.getMinecraftInstance().usePortal(0, mod_ghostdimension.TeleporterGhost);
}
}
else{
ModLoader.getMinecraftInstance().thePlayer.timeUntilPortal = 10;
}
}
}