Jump to content

Recommended Posts

Posted

I think the title says everything...(No, im not asking for updates just want to know which versions are stable)

Right now im using version 10.12.0.1024 (recommended) but now i need to add a new dimension, a feature that isn't implemented in that version(if im wrong please correct me aannnddd link me how i can do it)

 

And if a mod is reading this, could he please mark the stable versions on the files page?

Here could be your advertisement!

Posted

Tried to use a modified version of the mojang end/nether code and, after that failed, i tried to follow (and update) wuppy29s 1.6 dimension tutorial.

I will post my code as soon as possible.

 

Here could be your advertisement!

Posted

So, here is my code:

my main class:

 

 


public class DimensionShift{
public static int dimensionid=9;

        ...
	@EventHandler
    	public void preInit(FMLPreInitializationEvent event) {


    		...
    		DimensionManager.registerProviderType(DimensionShift.dimensionId, net.dimensionshift.mod.dimension.WorldProviderDS.class, false);
    		DimensionManager.registerDimension(DimensionShift.dimensionId, DimensionShift.dimensionId);
                ...
    		
    	
}
}
[/Code]

 
 
 
Chunk Provider:
 
 
[Code]
package net.dimensionshift.mod.dimension;

import java.util.List;

import net.minecraft.entity.EnumCreatureType;
import net.minecraft.util.IProgressUpdate;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;

public class ChunkProviderDimenisonShift implements IChunkProvider {

public ChunkProviderDimenisonShift(World worldObj, long seed, boolean b) {
	// TODO Auto-generated constructor stub
}

@Override
public boolean chunkExists(int var1, int var2) {
	// TODO Auto-generated method stub
	return false;
}

@Override
public Chunk provideChunk(int var1, int var2) {
	// TODO Auto-generated method stub
	return null;
}

@Override
public Chunk loadChunk(int var1, int var2) {
	// TODO Auto-generated method stub
	return null;
}

@Override
public void populate(IChunkProvider var1, int var2, int var3) {
	// TODO Auto-generated method stub

}

@Override
public boolean saveChunks(boolean var1, IProgressUpdate var2) {
	// TODO Auto-generated method stub
	return false;
}

@Override
public boolean unloadQueuedChunks() {
	// TODO Auto-generated method stub
	return false;
}

@Override
public boolean canSave() {
	// TODO Auto-generated method stub
	return false;
}

@Override
public String makeString() {
	// TODO Auto-generated method stub
	return null;
}

@Override
public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3,
		int var4) {
	// TODO Auto-generated method stub
	return null;
}

@Override
public ChunkPosition func_147416_a(World var1, String var2, int var3,
		int var4, int var5) {
	// TODO Auto-generated method stub
	return null;
}

@Override
public int getLoadedChunkCount() {
	// TODO Auto-generated method stub
	return 0;
}

@Override
public void recreateStructures(int var1, int var2) {
	// TODO Auto-generated method stub

}

@Override
public void saveExtraData() {
	// TODO Auto-generated method stub

}

}

 

 

 

World Provider:

 

 

package net.dimensionshift.mod.dimension;

import net.dimensionshift.mod.DimensionShift;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.IChunkProvider;

public class WorldProviderDS extends WorldProvider{

@Override
public String getDimensionName() {
	// TODO Auto-generated method stub
	return("DimenisonShiftBasicDimenison");
}

public void registerWorldChunkManager()
{
       this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.desertHills, 0.8F);
       this.dimensionId = DimensionShift.dimensionId;
       
}

public IChunkProvider createChunkGenerator()
{
       return new net.dimensionshift.mod.dimension.ChunkProviderDimenisonShift(worldObj, worldObj.getSeed(), true);
}


}

 

 

 

 

 

And teleporter:

 

 

package net.dimensionshift.mod.dimension;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Direction;
import net.minecraft.util.LongHashMap;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.Teleporter;
import net.minecraft.world.WorldServer;

public class TeleporterDimensionShift extends Teleporter {
    
private final WorldServer worldServerInstance;
    /**
     * A private Random() function in Teleporter
     */
    private final Random random;
    /**
     * Stores successful portal placement locations for rapid lookup.
     */
    private final LongHashMap destinationCoordinateCache = new LongHashMap();
    /**
     * A list of valid keys for the destinationCoordainteCache. These are based on the X & Z of the players initial
     * location.
     */
    private final List destinationCoordinateKeys = new ArrayList();
    private static final String __OBFID = "CL_00000153";

    public TeleporterDimensionShift(WorldServer par1WorldServer){
        this.worldServerInstance = par1WorldServer;
        this.random = new Random(par1WorldServer.getSeed());
    }

    /**
     * Place an entity in a nearby portal, creating one if necessary.
     */
    public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
    {
        if (this.worldServerInstance.provider.dimensionId != 1)
        {
            if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8))
            {
                this.makePortal(par1Entity);
                this.placeInExistingPortal(par1Entity, par2, par4, par6, par8);
            }
        }
        else
        {
            int i = MathHelper.floor_double(par1Entity.posX);
            int j = MathHelper.floor_double(par1Entity.posY) - 1;
            int k = MathHelper.floor_double(par1Entity.posZ);
            byte b0 = 1;
            byte b1 = 0;

            for (int l = -2; l <= 2; ++l)
            {
                for (int i1 = -2; i1 <= 2; ++i1)
                {
                    for (int j1 = -1; j1 < 3; ++j1)
                    {
                        int k1 = i + i1 * b0 + l * b1;
                        int l1 = j + j1;
                        int i2 = k + i1 * b1 - l * b0;
                        boolean flag = j1 < 0;
                        this.worldServerInstance.setBlock(k1, l1, i2, flag ? Blocks.obsidian : Blocks.air);
                    }
                }
            }

            par1Entity.setLocationAndAngles((double)i, (double)j, (double)k, par1Entity.rotationYaw, 0.0F);
            par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
        }
    }

    /**
     * Place an entity in a nearby portal which already exists.
     */
    public boolean placeInExistingPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
    {
        short short1 = 128;
        double d3 = -1.0D;
        int i = 0;
        int j = 0;
        int k = 0;
        int l = MathHelper.floor_double(par1Entity.posX);
        int i1 = MathHelper.floor_double(par1Entity.posZ);
        long j1 = ChunkCoordIntPair.chunkXZ2Int(l, i1);
        boolean flag = true;
        double d7;
        int l3;

        if (this.destinationCoordinateCache.containsItem(j1))
        {
            Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(j1);
            d3 = 0.0D;
            i = portalposition.posX;
            j = portalposition.posY;
            k = portalposition.posZ;
            portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
            flag = false;
        }
        else
        {
            for (l3 = l - short1; l3 <= l + short1; ++l3)
            {
                double d4 = (double)l3 + 0.5D - par1Entity.posX;

                for (int l1 = i1 - short1; l1 <= i1 + short1; ++l1)
                {
                    double d5 = (double)l1 + 0.5D - par1Entity.posZ;

                    for (int i2 = this.worldServerInstance.getActualHeight() - 1; i2 >= 0; --i2)
                    {
                        if (this.worldServerInstance.getBlock(l3, i2, l1) == Blocks.portal)
                        {
                            while (this.worldServerInstance.getBlock(l3, i2 - 1, l1) == Blocks.portal)
                            {
                                --i2;
                            }

                            d7 = (double)i2 + 0.5D - par1Entity.posY;
                            double d8 = d4 * d4 + d7 * d7 + d5 * d5;

                            if (d3 < 0.0D || d8 < d3)
                            {
                                d3 = d8;
                                i = l3;
                                j = i2;
                                k = l1;
                            }
                        }
                    }
                }
            }
        }

        if (d3 >= 0.0D)
        {
            if (flag)
            {
                this.destinationCoordinateCache.add(j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime()));
                this.destinationCoordinateKeys.add(Long.valueOf(j1));
            }

            double d11 = (double)i + 0.5D;
            double d6 = (double)j + 0.5D;
            d7 = (double)k + 0.5D;
            int i4 = -1;

            if (this.worldServerInstance.getBlock(i - 1, j, k) == Blocks.portal)
            {
                i4 = 2;
            }

            if (this.worldServerInstance.getBlock(i + 1, j, k) == Blocks.portal)
            {
                i4 = 0;
            }

            if (this.worldServerInstance.getBlock(i, j, k - 1) == Blocks.portal)
            {
                i4 = 3;
            }

            if (this.worldServerInstance.getBlock(i, j, k + 1) == Blocks.portal)
            {
                i4 = 1;
            }

            int j2 = par1Entity.getTeleportDirection();

            if (i4 > -1)
            {
                int k2 = Direction.rotateLeft[i4];
                int l2 = Direction.offsetX[i4];
                int i3 = Direction.offsetZ[i4];
                int j3 = Direction.offsetX[k2];
                int k3 = Direction.offsetZ[k2];
                boolean flag1 = !this.worldServerInstance.isAirBlock(i + l2 + j3, j, k + i3 + k3) || !this.worldServerInstance.isAirBlock(i + l2 + j3, j + 1, k + i3 + k3);
                boolean flag2 = !this.worldServerInstance.isAirBlock(i + l2, j, k + i3) || !this.worldServerInstance.isAirBlock(i + l2, j + 1, k + i3);

                if (flag1 && flag2)
                {
                    i4 = Direction.rotateOpposite[i4];
                    k2 = Direction.rotateOpposite[k2];
                    l2 = Direction.offsetX[i4];
                    i3 = Direction.offsetZ[i4];
                    j3 = Direction.offsetX[k2];
                    k3 = Direction.offsetZ[k2];
                    l3 = i - j3;
                    d11 -= (double)j3;
                    int k1 = k - k3;
                    d7 -= (double)k3;
                    flag1 = !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j, k1 + i3 + k3) || !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j + 1, k1 + i3 + k3);
                    flag2 = !this.worldServerInstance.isAirBlock(l3 + l2, j, k1 + i3) || !this.worldServerInstance.isAirBlock(l3 + l2, j + 1, k1 + i3);
                }

                float f1 = 0.5F;
                float f2 = 0.5F;

                if (!flag1 && flag2)
                {
                    f1 = 1.0F;
                }
                else if (flag1 && !flag2)
                {
                    f1 = 0.0F;
                }
                else if (flag1 && flag2)
                {
                    f2 = 0.0F;
                }

                d11 += (double)((float)j3 * f1 + f2 * (float)l2);
                d7 += (double)((float)k3 * f1 + f2 * (float)i3);
                float f3 = 0.0F;
                float f4 = 0.0F;
                float f5 = 0.0F;
                float f6 = 0.0F;

                if (i4 == j2)
                {
                    f3 = 1.0F;
                    f4 = 1.0F;
                }
                else if (i4 == Direction.rotateOpposite[j2])
                {
                    f3 = -1.0F;
                    f4 = -1.0F;
                }
                else if (i4 == Direction.rotateRight[j2])
                {
                    f5 = 1.0F;
                    f6 = -1.0F;
                }
                else
                {
                    f5 = -1.0F;
                    f6 = 1.0F;
                }

                double d9 = par1Entity.motionX;
                double d10 = par1Entity.motionZ;
                par1Entity.motionX = d9 * (double)f3 + d10 * (double)f6;
                par1Entity.motionZ = d9 * (double)f5 + d10 * (double)f4;
                par1Entity.rotationYaw = par8 - (float)(j2 * 90) + (float)(i4 * 90);
            }
            else
            {
                par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
            }

            par1Entity.setLocationAndAngles(d11, d6, d7, par1Entity.rotationYaw, par1Entity.rotationPitch);
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean makePortal(Entity par1Entity)
    {
        byte b0 = 16;
        double d0 = -1.0D;
        int i = MathHelper.floor_double(par1Entity.posX);
        int j = MathHelper.floor_double(par1Entity.posY);
        int k = MathHelper.floor_double(par1Entity.posZ);
        int l = i;
        int i1 = j;
        int j1 = k;
        int k1 = 0;
        int l1 = this.random.nextInt(4);
        int i2;
        double d1;
        double d2;
        int k2;
        int i3;
        int k3;
        int j3;
        int i4;
        int l3;
        int k4;
        int j4;
        int i5;
        int l4;
        double d3;
        double d4;

        for (i2 = i - b0; i2 <= i + b0; ++i2)
        {
            d1 = (double)i2 + 0.5D - par1Entity.posX;

            for (k2 = k - b0; k2 <= k + b0; ++k2)
            {
                d2 = (double)k2 + 0.5D - par1Entity.posZ;
                label274:

                for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3)
                {
                    if (this.worldServerInstance.isAirBlock(i2, i3, k2))
                    {
                        while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2))
                        {
                            --i3;
                        }

                        for (j3 = l1; j3 < l1 + 4; ++j3)
                        {
                            k3 = j3 % 2;
                            l3 = 1 - k3;

                            if (j3 % 4 >= 2)
                            {
                                k3 = -k3;
                                l3 = -l3;
                            }

                            for (i4 = 0; i4 < 3; ++i4)
                            {
                                for (j4 = 0; j4 < 4; ++j4)
                                {
                                    for (k4 = -1; k4 < 4; ++k4)
                                    {
                                        l4 = i2 + (j4 - 1) * k3 + i4 * l3;
                                        i5 = i3 + k4;
                                        int j5 = k2 + (j4 - 1) * l3 - i4 * k3;

                                        if (k4 < 0 && !this.worldServerInstance.getBlock(l4, i5, j5).getMaterial().isSolid() || k4 >= 0 && !this.worldServerInstance.isAirBlock(l4, i5, j5))
                                        {
                                            continue label274;
                                        }
                                    }
                                }
                            }

                            d4 = (double)i3 + 0.5D - par1Entity.posY;
                            d3 = d1 * d1 + d4 * d4 + d2 * d2;

                            if (d0 < 0.0D || d3 < d0)
                            {
                                d0 = d3;
                                l = i2;
                                i1 = i3;
                                j1 = k2;
                                k1 = j3 % 4;
                            }
                        }
                    }
                }
            }
        }

        if (d0 < 0.0D)
        {
            for (i2 = i - b0; i2 <= i + b0; ++i2)
            {
                d1 = (double)i2 + 0.5D - par1Entity.posX;

                for (k2 = k - b0; k2 <= k + b0; ++k2)
                {
                    d2 = (double)k2 + 0.5D - par1Entity.posZ;
                    label222:

                    for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3)
                    {
                        if (this.worldServerInstance.isAirBlock(i2, i3, k2))
                        {
                            while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2))
                            {
                                --i3;
                            }

                            for (j3 = l1; j3 < l1 + 2; ++j3)
                            {
                                k3 = j3 % 2;
                                l3 = 1 - k3;

                                for (i4 = 0; i4 < 4; ++i4)
                                {
                                    for (j4 = -1; j4 < 4; ++j4)
                                    {
                                        k4 = i2 + (i4 - 1) * k3;
                                        l4 = i3 + j4;
                                        i5 = k2 + (i4 - 1) * l3;

                                        if (j4 < 0 && !this.worldServerInstance.getBlock(k4, l4, i5).getMaterial().isSolid() || j4 >= 0 && !this.worldServerInstance.isAirBlock(k4, l4, i5))
                                        {
                                            continue label222;
                                        }
                                    }
                                }

                                d4 = (double)i3 + 0.5D - par1Entity.posY;
                                d3 = d1 * d1 + d4 * d4 + d2 * d2;

                                if (d0 < 0.0D || d3 < d0)
                                {
                                    d0 = d3;
                                    l = i2;
                                    i1 = i3;
                                    j1 = k2;
                                    k1 = j3 % 2;
                                }
                            }
                        }
                    }
                }
            }
        }

        int k5 = l;
        int j2 = i1;
        k2 = j1;
        int l5 = k1 % 2;
        int l2 = 1 - l5;

        if (k1 % 4 >= 2)
        {
            l5 = -l5;
            l2 = -l2;
        }

        boolean flag;

        if (d0 < 0.0D)
        {
            if (i1 < 70)
            {
                i1 = 70;
            }

            if (i1 > this.worldServerInstance.getActualHeight() - 10)
            {
                i1 = this.worldServerInstance.getActualHeight() - 10;
            }

            j2 = i1;

            for (i3 = -1; i3 <= 1; ++i3)
            {
                for (j3 = 1; j3 < 3; ++j3)
                {
                    for (k3 = -1; k3 < 3; ++k3)
                    {
                        l3 = k5 + (j3 - 1) * l5 + i3 * l2;
                        i4 = j2 + k3;
                        j4 = k2 + (j3 - 1) * l2 - i3 * l5;
                        flag = k3 < 0;
                        this.worldServerInstance.setBlock(l3, i4, j4, flag ? Blocks.obsidian : Blocks.air);
                    }
                }
            }
        }

        for (i3 = 0; i3 < 4; ++i3)
        {
            for (j3 = 0; j3 < 4; ++j3)
            {
                for (k3 = -1; k3 < 4; ++k3)
                {
                    l3 = k5 + (j3 - 1) * l5;
                    i4 = j2 + k3;
                    j4 = k2 + (j3 - 1) * l2;
                    flag = j3 == 0 || j3 == 3 || k3 == -1 || k3 == 3;
                    this.worldServerInstance.setBlock(l3, i4, j4, (Block)(flag ? Blocks.obsidian : Blocks.portal), 0, 2);
                }
            }

            for (j3 = 0; j3 < 4; ++j3)
            {
                for (k3 = -1; k3 < 4; ++k3)
                {
                    l3 = k5 + (j3 - 1) * l5;
                    i4 = j2 + k3;
                    j4 = k2 + (j3 - 1) * l2;
                    this.worldServerInstance.notifyBlocksOfNeighborChange(l3, i4, j4, this.worldServerInstance.getBlock(l3, i4, j4));
                }
            }
        }

        return true;
    }

    /**
     * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a
     * WorldServer.getTotalWorldTime() value.
     */
    public void removeStalePortalLocations(long par1)
    {
        if (par1 % 100L == 0L)
        {
            Iterator iterator = this.destinationCoordinateKeys.iterator();
            long j = par1 - 600L;

            while (iterator.hasNext())
            {
                Long olong = (Long)iterator.next();
                Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(olong.longValue());

                if (portalposition == null || portalposition.lastUpdateTime < j)
                {
                    iterator.remove();
                    this.destinationCoordinateCache.remove(olong.longValue());
                }
            }
        }
    }

    public class PortalPosition extends ChunkCoordinates
    {
        /**
         * The worldtime at which this PortalPosition was last verified
         */
        public long lastUpdateTime;
        private static final String __OBFID = "CL_00000154";

        public PortalPosition(int par2, int par3, int par4, long par5)
        {
            super(par2, par3, par4);
            this.lastUpdateTime = par5;
        }
    }
}

 

 

 

 

And then i have this in my main Block...:

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitx, float hity, float hitz) {
	if(!world.isRemote) {

		System.out.println("after thread");
		Side sidex = FMLCommonHandler.instance().getEffectiveSide();
		if (sidex == Side.SERVER){
		System.out.println("after sidex");
		if (player instanceof EntityPlayerMP){
		System.out.println("after instace of PlayerMP");	
		WorldServer worldserver = (WorldServer)world;
		EntityPlayerMP playerMP = (EntityPlayerMP)player;
		if (player.ridingEntity == null && player.riddenByEntity == null && player instanceof EntityPlayer){
			System.out.println("after last if");
			playerMP.mcServer.getConfigurationManager().transferPlayerToDimension(playerMP, 9, new net.dimensionshift.mod.dimension.TeleporterDimensionShift(worldserver));
		}
		}
		}



	}
	return true;
}

 

 

Eclipse says that something with:

 


    public TeleporterDimensionShift(WorldServer par1WorldServer){
        this.worldServerInstance = par1WorldServer;
        this.random = new Random(par1WorldServer.getSeed());
    }
[/Code]

is wrong.

But i can't find any mistake in it.

Here could be your advertisement!

Posted

Your teleporter extend Teleporter (which is good), but you copied all its code (which is not good).

 

if(!world.isRemote) {

 

System.out.println("after thread");

Side sidex = FMLCommonHandler.instance().getEffectiveSide();

if (sidex == Side.SERVER){

System.out.println("after sidex");

if (player instanceof EntityPlayerMP){

System.out.println("after instace of PlayerMP");

WorldServer worldserver = (WorldServer)world;

EntityPlayerMP playerMP = (EntityPlayerMP)player;

if (player.ridingEntity == null && player.riddenByEntity == null && player instanceof EntityPlayer){

Please, remove the useless checks. The last one ! *facepalm*

Posted

yeah, i have a super in public TeleportXY()...

 

EDIT: Something went wrong copying the code(i posted an old version....), thats what it actually looks like:

 

On block Update thing:

 

 

		Side sidex = FMLCommonHandler.instance().getEffectiveSide();
		if (sidex == Side.SERVER){
		if (player instanceof EntityPlayerMP){
		System.out.println("after instace of PlayerMP");	
		WorldServer worldserver = (WorldServer)world;
		EntityPlayerMP playerMP = (EntityPlayerMP)player;
		if (player.ridingEntity == null && player.riddenByEntity == null && player instanceof EntityPlayer){
			FMLCommonHandler.instance().getMinecraftServerInstance();
			MinecraftServer mServer = MinecraftServer.getServer();
			playerMP.mcServer.getConfigurationManager().transferPlayerToDimension(playerMP, 9, new net.dimensionshift.mod.dimension.TeleporterDimensionShift(mServer.worldServerForDimension(DimensionShift.dimensionId)));
		}
		}
		}

 

 

 

 

 

Teleporter class

 

 

package net.dimensionshift.mod.dimension;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Direction;
import net.minecraft.util.LongHashMap;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.Teleporter;
import net.minecraft.world.WorldServer;

public class TeleporterDimensionShift extends Teleporter {
    
private final WorldServer worldServerInstance;
    /**
     * A private Random() function in Teleporter
     */
    private final Random random;
    /**
     * Stores successful portal placement locations for rapid lookup.
     */
    private final LongHashMap destinationCoordinateCache = new LongHashMap();
    /**
     * A list of valid keys for the destinationCoordainteCache. These are based on the X & Z of the players initial
     * location.
     */
    private final List destinationCoordinateKeys = new ArrayList();
    private static final String __OBFID = "CL_00000153";



    
    public TeleporterDimensionShift(WorldServer par1WorldServer){
        super(par1WorldServer);
        this.worldServerInstance = par1WorldServer;
        this.random = new Random(par1WorldServer.getSeed());
    }

    /**
     * Place an entity in a nearby portal, creating one if necessary.
     */
    public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
    {
        if (this.worldServerInstance.provider.dimensionId != 1)
        {
            if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8))
            {
                this.makePortal(par1Entity);
                this.placeInExistingPortal(par1Entity, par2, par4, par6, par8);
            }
        }
        else
        {
            int i = MathHelper.floor_double(par1Entity.posX);
            int j = MathHelper.floor_double(par1Entity.posY) - 1;
            int k = MathHelper.floor_double(par1Entity.posZ);
            byte b0 = 1;
            byte b1 = 0;

            for (int l = -2; l <= 2; ++l)
            {
                for (int i1 = -2; i1 <= 2; ++i1)
                {
                    for (int j1 = -1; j1 < 3; ++j1)
                    {
                        int k1 = i + i1 * b0 + l * b1;
                        int l1 = j + j1;
                        int i2 = k + i1 * b1 - l * b0;
                        boolean flag = j1 < 0;
                        this.worldServerInstance.setBlock(k1, l1, i2, flag ? Blocks.obsidian : Blocks.air);
                    }
                }
            }

            par1Entity.setLocationAndAngles((double)i, (double)j, (double)k, par1Entity.rotationYaw, 0.0F);
            par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
        }
    }

    /**
     * Place an entity in a nearby portal which already exists.
     */
    public boolean placeInExistingPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
    {
        short short1 = 128;
        double d3 = -1.0D;
        int i = 0;
        int j = 0;
        int k = 0;
        int l = MathHelper.floor_double(par1Entity.posX);
        int i1 = MathHelper.floor_double(par1Entity.posZ);
        long j1 = ChunkCoordIntPair.chunkXZ2Int(l, i1);
        boolean flag = true;
        double d7;
        int l3;

        if (this.destinationCoordinateCache.containsItem(j1))
        {
            Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(j1);
            d3 = 0.0D;
            i = portalposition.posX;
            j = portalposition.posY;
            k = portalposition.posZ;
            portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
            flag = false;
        }
        else
        {
            for (l3 = l - short1; l3 <= l + short1; ++l3)
            {
                double d4 = (double)l3 + 0.5D - par1Entity.posX;

                for (int l1 = i1 - short1; l1 <= i1 + short1; ++l1)
                {
                    double d5 = (double)l1 + 0.5D - par1Entity.posZ;

                    for (int i2 = this.worldServerInstance.getActualHeight() - 1; i2 >= 0; --i2)
                    {
                        if (this.worldServerInstance.getBlock(l3, i2, l1) == Blocks.portal)
                        {
                            while (this.worldServerInstance.getBlock(l3, i2 - 1, l1) == Blocks.portal)
                            {
                                --i2;
                            }

                            d7 = (double)i2 + 0.5D - par1Entity.posY;
                            double d8 = d4 * d4 + d7 * d7 + d5 * d5;

                            if (d3 < 0.0D || d8 < d3)
                            {
                                d3 = d8;
                                i = l3;
                                j = i2;
                                k = l1;
                            }
                        }
                    }
                }
            }
        }

        if (d3 >= 0.0D)
        {
            if (flag)
            {
                this.destinationCoordinateCache.add(j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime()));
                this.destinationCoordinateKeys.add(Long.valueOf(j1));
            }

            double d11 = (double)i + 0.5D;
            double d6 = (double)j + 0.5D;
            d7 = (double)k + 0.5D;
            int i4 = -1;

            if (this.worldServerInstance.getBlock(i - 1, j, k) == Blocks.portal)
            {
                i4 = 2;
            }

            if (this.worldServerInstance.getBlock(i + 1, j, k) == Blocks.portal)
            {
                i4 = 0;
            }

            if (this.worldServerInstance.getBlock(i, j, k - 1) == Blocks.portal)
            {
                i4 = 3;
            }

            if (this.worldServerInstance.getBlock(i, j, k + 1) == Blocks.portal)
            {
                i4 = 1;
            }

            int j2 = par1Entity.getTeleportDirection();

            if (i4 > -1)
            {
                int k2 = Direction.rotateLeft[i4];
                int l2 = Direction.offsetX[i4];
                int i3 = Direction.offsetZ[i4];
                int j3 = Direction.offsetX[k2];
                int k3 = Direction.offsetZ[k2];
                boolean flag1 = !this.worldServerInstance.isAirBlock(i + l2 + j3, j, k + i3 + k3) || !this.worldServerInstance.isAirBlock(i + l2 + j3, j + 1, k + i3 + k3);
                boolean flag2 = !this.worldServerInstance.isAirBlock(i + l2, j, k + i3) || !this.worldServerInstance.isAirBlock(i + l2, j + 1, k + i3);

                if (flag1 && flag2)
                {
                    i4 = Direction.rotateOpposite[i4];
                    k2 = Direction.rotateOpposite[k2];
                    l2 = Direction.offsetX[i4];
                    i3 = Direction.offsetZ[i4];
                    j3 = Direction.offsetX[k2];
                    k3 = Direction.offsetZ[k2];
                    l3 = i - j3;
                    d11 -= (double)j3;
                    int k1 = k - k3;
                    d7 -= (double)k3;
                    flag1 = !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j, k1 + i3 + k3) || !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j + 1, k1 + i3 + k3);
                    flag2 = !this.worldServerInstance.isAirBlock(l3 + l2, j, k1 + i3) || !this.worldServerInstance.isAirBlock(l3 + l2, j + 1, k1 + i3);
                }

                float f1 = 0.5F;
                float f2 = 0.5F;

                if (!flag1 && flag2)
                {
                    f1 = 1.0F;
                }
                else if (flag1 && !flag2)
                {
                    f1 = 0.0F;
                }
                else if (flag1 && flag2)
                {
                    f2 = 0.0F;
                }

                d11 += (double)((float)j3 * f1 + f2 * (float)l2);
                d7 += (double)((float)k3 * f1 + f2 * (float)i3);
                float f3 = 0.0F;
                float f4 = 0.0F;
                float f5 = 0.0F;
                float f6 = 0.0F;

                if (i4 == j2)
                {
                    f3 = 1.0F;
                    f4 = 1.0F;
                }
                else if (i4 == Direction.rotateOpposite[j2])
                {
                    f3 = -1.0F;
                    f4 = -1.0F;
                }
                else if (i4 == Direction.rotateRight[j2])
                {
                    f5 = 1.0F;
                    f6 = -1.0F;
                }
                else
                {
                    f5 = -1.0F;
                    f6 = 1.0F;
                }

                double d9 = par1Entity.motionX;
                double d10 = par1Entity.motionZ;
                par1Entity.motionX = d9 * (double)f3 + d10 * (double)f6;
                par1Entity.motionZ = d9 * (double)f5 + d10 * (double)f4;
                par1Entity.rotationYaw = par8 - (float)(j2 * 90) + (float)(i4 * 90);
            }
            else
            {
                par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D;
            }

            par1Entity.setLocationAndAngles(d11, d6, d7, par1Entity.rotationYaw, par1Entity.rotationPitch);
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean makePortal(Entity par1Entity)
    {
        byte b0 = 16;
        double d0 = -1.0D;
        int i = MathHelper.floor_double(par1Entity.posX);
        int j = MathHelper.floor_double(par1Entity.posY);
        int k = MathHelper.floor_double(par1Entity.posZ);
        int l = i;
        int i1 = j;
        int j1 = k;
        int k1 = 0;
        int l1 = this.random.nextInt(4);
        int i2;
        double d1;
        double d2;
        int k2;
        int i3;
        int k3;
        int j3;
        int i4;
        int l3;
        int k4;
        int j4;
        int i5;
        int l4;
        double d3;
        double d4;

        for (i2 = i - b0; i2 <= i + b0; ++i2)
        {
            d1 = (double)i2 + 0.5D - par1Entity.posX;

            for (k2 = k - b0; k2 <= k + b0; ++k2)
            {
                d2 = (double)k2 + 0.5D - par1Entity.posZ;
                label274:

                for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3)
                {
                    if (this.worldServerInstance.isAirBlock(i2, i3, k2))
                    {
                        while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2))
                        {
                            --i3;
                        }

                        for (j3 = l1; j3 < l1 + 4; ++j3)
                        {
                            k3 = j3 % 2;
                            l3 = 1 - k3;

                            if (j3 % 4 >= 2)
                            {
                                k3 = -k3;
                                l3 = -l3;
                            }

                            for (i4 = 0; i4 < 3; ++i4)
                            {
                                for (j4 = 0; j4 < 4; ++j4)
                                {
                                    for (k4 = -1; k4 < 4; ++k4)
                                    {
                                        l4 = i2 + (j4 - 1) * k3 + i4 * l3;
                                        i5 = i3 + k4;
                                        int j5 = k2 + (j4 - 1) * l3 - i4 * k3;

                                        if (k4 < 0 && !this.worldServerInstance.getBlock(l4, i5, j5).getMaterial().isSolid() || k4 >= 0 && !this.worldServerInstance.isAirBlock(l4, i5, j5))
                                        {
                                            continue label274;
                                        }
                                    }
                                }
                            }

                            d4 = (double)i3 + 0.5D - par1Entity.posY;
                            d3 = d1 * d1 + d4 * d4 + d2 * d2;

                            if (d0 < 0.0D || d3 < d0)
                            {
                                d0 = d3;
                                l = i2;
                                i1 = i3;
                                j1 = k2;
                                k1 = j3 % 4;
                            }
                        }
                    }
                }
            }
        }

        if (d0 < 0.0D)
        {
            for (i2 = i - b0; i2 <= i + b0; ++i2)
            {
                d1 = (double)i2 + 0.5D - par1Entity.posX;

                for (k2 = k - b0; k2 <= k + b0; ++k2)
                {
                    d2 = (double)k2 + 0.5D - par1Entity.posZ;
                    label222:

                    for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3)
                    {
                        if (this.worldServerInstance.isAirBlock(i2, i3, k2))
                        {
                            while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2))
                            {
                                --i3;
                            }

                            for (j3 = l1; j3 < l1 + 2; ++j3)
                            {
                                k3 = j3 % 2;
                                l3 = 1 - k3;

                                for (i4 = 0; i4 < 4; ++i4)
                                {
                                    for (j4 = -1; j4 < 4; ++j4)
                                    {
                                        k4 = i2 + (i4 - 1) * k3;
                                        l4 = i3 + j4;
                                        i5 = k2 + (i4 - 1) * l3;

                                        if (j4 < 0 && !this.worldServerInstance.getBlock(k4, l4, i5).getMaterial().isSolid() || j4 >= 0 && !this.worldServerInstance.isAirBlock(k4, l4, i5))
                                        {
                                            continue label222;
                                        }
                                    }
                                }

                                d4 = (double)i3 + 0.5D - par1Entity.posY;
                                d3 = d1 * d1 + d4 * d4 + d2 * d2;

                                if (d0 < 0.0D || d3 < d0)
                                {
                                    d0 = d3;
                                    l = i2;
                                    i1 = i3;
                                    j1 = k2;
                                    k1 = j3 % 2;
                                }
                            }
                        }
                    }
                }
            }
        }

        int k5 = l;
        int j2 = i1;
        k2 = j1;
        int l5 = k1 % 2;
        int l2 = 1 - l5;

        if (k1 % 4 >= 2)
        {
            l5 = -l5;
            l2 = -l2;
        }

        boolean flag;

        if (d0 < 0.0D)
        {
            if (i1 < 70)
            {
                i1 = 70;
            }

            if (i1 > this.worldServerInstance.getActualHeight() - 10)
            {
                i1 = this.worldServerInstance.getActualHeight() - 10;
            }

            j2 = i1;

            for (i3 = -1; i3 <= 1; ++i3)
            {
                for (j3 = 1; j3 < 3; ++j3)
                {
                    for (k3 = -1; k3 < 3; ++k3)
                    {
                        l3 = k5 + (j3 - 1) * l5 + i3 * l2;
                        i4 = j2 + k3;
                        j4 = k2 + (j3 - 1) * l2 - i3 * l5;
                        flag = k3 < 0;
                        this.worldServerInstance.setBlock(l3, i4, j4, flag ? Blocks.obsidian : Blocks.air);
                    }
                }
            }
        }

        for (i3 = 0; i3 < 4; ++i3)
        {
            for (j3 = 0; j3 < 4; ++j3)
            {
                for (k3 = -1; k3 < 4; ++k3)
                {
                    l3 = k5 + (j3 - 1) * l5;
                    i4 = j2 + k3;
                    j4 = k2 + (j3 - 1) * l2;
                    flag = j3 == 0 || j3 == 3 || k3 == -1 || k3 == 3;
                    this.worldServerInstance.setBlock(l3, i4, j4, (Block)(flag ? Blocks.obsidian : Blocks.portal), 0, 2);
                }
            }

            for (j3 = 0; j3 < 4; ++j3)
            {
                for (k3 = -1; k3 < 4; ++k3)
                {
                    l3 = k5 + (j3 - 1) * l5;
                    i4 = j2 + k3;
                    j4 = k2 + (j3 - 1) * l2;
                    this.worldServerInstance.notifyBlocksOfNeighborChange(l3, i4, j4, this.worldServerInstance.getBlock(l3, i4, j4));
                }
            }
        }

        return true;
    }

    /**
     * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a
     * WorldServer.getTotalWorldTime() value.
     */
    public void removeStalePortalLocations(long par1)
    {
        if (par1 % 100L == 0L)
        {
            Iterator iterator = this.destinationCoordinateKeys.iterator();
            long j = par1 - 600L;

            while (iterator.hasNext())
            {
                Long olong = (Long)iterator.next();
                Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(olong.longValue());

                if (portalposition == null || portalposition.lastUpdateTime < j)
                {
                    iterator.remove();
                    this.destinationCoordinateCache.remove(olong.longValue());
                }
            }
        }
    }

    public class PortalPosition extends ChunkCoordinates
    {
        /**
         * The worldtime at which this PortalPosition was last verified
         */
        public long lastUpdateTime;
        private static final String __OBFID = "CL_00000154";

        public PortalPosition(int par2, int par3, int par4, long par5)
        {
            super(par2, par3, par4);
            this.lastUpdateTime = par5;
        }
    }
}

 

 

 

 

 

and my error:

 

 

[16:53:15] [server thread/ERROR] [FML]: HandshakeCompletionHandler exception

java.lang.NullPointerException

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:149) ~[ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:163) ~[ChunkProviderServer.class:?]

at net.minecraft.world.World.getChunkFromChunkCoords(World.java:519) ~[World.class:?]

at net.minecraft.world.World.spawnEntityInWorld(World.java:1518) ~[World.class:?]

at net.minecraft.server.management.ServerConfigurationManager.playerLoggedIn(ServerConfigurationManager.java:286) ~[serverConfigurationManager.class:?]

at net.minecraft.server.management.ServerConfigurationManager.initializeConnectionToPlayer(ServerConfigurationManager.java:151) ~[serverConfigurationManager.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:172) ~[NetworkDispatcher.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeHandshake(NetworkDispatcher.java:428) ~[NetworkDispatcher.class:?]

at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:17) ~[HandshakeCompletionHandler.class:?]

at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:11) ~[HandshakeCompletionHandler.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:?]

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]

at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?]

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) [NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) [NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) [integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]

[16:53:15] [server thread/ERROR] [FML]: There was a critical exception handling a packet on channel FML

java.lang.NullPointerException

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:149) ~[ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:163) ~[ChunkProviderServer.class:?]

at net.minecraft.world.World.getChunkFromChunkCoords(World.java:519) ~[World.class:?]

at net.minecraft.world.World.spawnEntityInWorld(World.java:1518) ~[World.class:?]

at net.minecraft.server.management.ServerConfigurationManager.playerLoggedIn(ServerConfigurationManager.java:286) ~[serverConfigurationManager.class:?]

at net.minecraft.server.management.ServerConfigurationManager.initializeConnectionToPlayer(ServerConfigurationManager.java:151) ~[serverConfigurationManager.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:172) ~[NetworkDispatcher.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeHandshake(NetworkDispatcher.java:428) ~[NetworkDispatcher.class:?]

at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:17) ~[HandshakeCompletionHandler.class:?]

at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:11) ~[HandshakeCompletionHandler.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?]

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]

at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) [NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) [NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) [integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]

[16:53:15] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Ticking memory connection

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:206) ~[NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]

Caused by: java.lang.NullPointerException

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90) ~[FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) ~[NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) ~[NetworkSystem.class:?]

... 5 more

[16:53:15] [server thread/ERROR]: This crash report has been saved to: /Users/User/Desktop/modding/1.7.2 gradle/forge/eclipse/./crash-reports/crash-2014-03-29_16.53.15-server.txt

[16:53:15] [server thread/INFO]: Stopping server

[16:53:15] [server thread/INFO]: Saving players

[16:53:15] [server thread/INFO]: Saving worlds

[16:53:15] [server thread/INFO]: Saving chunks for level 'New World'/Overworld

[16:53:15] [server thread/INFO]: Saving chunks for level 'New World'/Nether

[16:53:15] [server thread/INFO]: Saving chunks for level 'New World'/The End

[16:53:15] [server thread/INFO]: Saving chunks for level 'New World'/DimenisonShiftBasicDimenison

[16:53:15] [server thread/ERROR]: Exception stopping the server

java.lang.NullPointerException

at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:279) ~[ChunkProviderServer.class:?]

at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:883) ~[WorldServer.class:?]

at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:416) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:449) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:257) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:577) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]

[16:53:15] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.

---- Minecraft Crash Report ----

// Why is it breaking :(

 

Time: 29.03.14 16:53

Description: Ticking memory connection

 

java.lang.NullPointerException: Ticking memory connection

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242)

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242)

 

-- Ticking connection --

Details:

Connection: net.minecraft.network.NetworkManager@42a85af8

Stacktrace:

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Mac OS X (x86_64) version 10.9.2

Java Version: 1.6.0_65, Apple Inc.

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Apple Inc.

Memory: 986180392 bytes (940 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 2 (112 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 mods active

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

dimensionshift{Beta v0.015} [DimensionShift] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Profiler Position: N/A (disabled)

Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Player Count: 1 / 8; [EntityPlayerMP['Jacky2611'/0, l='New World', x=1238,00, y=4,00, z=805,00]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

#@!@# Game crashed! Crash report saved to: #@!@# ./crash-reports/crash-2014-03-29_16.53.15-server.txt

[16:53:15] [Client Shutdown Thread/INFO]: Stopping server

[16:53:15] [Client Shutdown Thread/INFO]: Saving players

Exception in thread "Client Shutdown Thread" java.lang.NullPointerException

at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:279)

at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:883)

at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:416)

at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:449)

at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:257)

at net.minecraft.client.Minecraft.stopIntegratedServer(Minecraft.java:2705)

at net.minecraft.client.main.Main$2.run(Main.java:102)

AL lib: (EE) alc_cleanup: 1 device not closed

 

 

Here could be your advertisement!

Posted

Sorry I can't pinpoint your problem here; it's over my head. I'm still trying to learn the netty and dimension stuff myself. I hope some other learned soul will help you out with it.

Good luck.

Posted

Uh oh.

@Override
public Chunk provideChunk(int var1, int var2) {
	// TODO Auto-generated method stub
	return null;
}

 

That looks a little bit...empty

 

Where is the face-again-wall Smiley?

 

 

 

EDIT:

So i modified my code :/ ....

 

Now I am teleported to the nether... am teleported to my dimension,but it is empty(void)...

 

 

My new ChunkProvider:

 

 

 

package net.dimensionshift.mod.dimension;

 

import java.util.List;

import java.util.Random;

 

import net.minecraft.entity.EnumCreatureType;

import net.minecraft.util.IProgressUpdate;

import net.minecraft.world.ChunkPosition;

import net.minecraft.world.World;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraft.world.chunk.Chunk;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.MapGenBase;

import net.minecraft.world.gen.MapGenCaves;

import net.minecraft.world.gen.MapGenRavine;

import net.minecraft.world.gen.NoiseGeneratorOctaves;

import net.minecraft.world.gen.structure.MapGenMineshaft;

import net.minecraft.world.gen.structure.MapGenScatteredFeature;

import net.minecraft.world.gen.structure.MapGenStronghold;

import net.minecraft.world.gen.structure.MapGenVillage;

import net.minecraftforge.event.terraingen.TerrainGen;

 

public class ChunkProviderDimenisonShift implements IChunkProvider {

 

public World worldObj;

private Random rand;

private NoiseGeneratorOctaves noiseGen1;

private NoiseGeneratorOctaves noiseGen2;

private NoiseGeneratorOctaves noiseGen3;

private NoiseGeneratorOctaves noiseGen4;

public NoiseGeneratorOctaves noiseGen5;

public NoiseGeneratorOctaves noiseGen6;

public NoiseGeneratorOctaves mobSpawnerNoise;

private final boolean mapFeaturesEnabled;

 

/** Holds Cave Generator */

private MapGenBase caveGenerator = new MapGenCaves();

 

/** Holds Stronghold Generator */

private MapGenStronghold strongholdGenerator = new MapGenStronghold();

 

/** Holds Village Generator */

private MapGenVillage villageGenerator = new MapGenVillage();

 

/** Holds Mineshaft Generator */

private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();

private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();

 

/** Holds ravine generator */

private MapGenBase ravineGenerator = new MapGenRavine();

 

/** The biomes that are used to generate the chunk */

private BiomeGenBase[] biomesForGeneration;

 

 

/*

{

caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE);

strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, STRONGHOLD);

villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(villageGenerator, VILLAGE);

mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, MINESHAFT);

scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE);

ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE);

}

*/

 

 

public ChunkProviderDimenisonShift(World worldObj, long seed, boolean mapFeatures) {

this.worldObj = worldObj;

this.mapFeaturesEnabled = mapFeatures;

this.rand = new Random(seed);

this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);

this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);

this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);

this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);

this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);

this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);

this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);

 

 

}

 

@Override

public boolean chunkExists(int var1, int var2) {

// TODO Auto-generated method stub

return false;

}

 

@Override

public Chunk provideChunk(int var1, int var2) {

this.rand.setSeed((long) var1 * 341873128712L + (long) var2 * 132897987541L);

byte[] abyte = new byte[32768];

//this.generateTerrain(var1, var2, abyte);

this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, var1 * 16, var2 * 16, 16, 16);

//this.caveGenerator.generate(this, this.worldObj, var1, var2, abyte);

//this.ravineGenerator.generate(this, this.worldObj, var1, var2, abyte);

 

if (this.mapFeaturesEnabled) {

//this.scatteredFeatureGenerator.generate(this, this.worldObj, var1, var2, abyte);

}

 

Chunk chunk = new Chunk(this.worldObj, var1, var2);

byte[] abyte1 = chunk.getBiomeArray();

 

for (int k = 0; k < abyte1.length; ++k) {

abyte1[k] = (byte) this.biomesForGeneration[k].biomeID;

}

 

chunk.generateSkylightMap();

return chunk;

}

 

@Override

public Chunk loadChunk(int var1, int var2) {

// TODO Auto-generated method stub

return this.provideChunk(var1, var2);

}

 

@Override

public void populate(IChunkProvider var1, int var2, int var3) {

// TODO Auto-generated method stub

 

}

 

@Override

public boolean saveChunks(boolean var1, IProgressUpdate var2) {

// TODO Auto-generated method stub

return false;

}

 

@Override

public boolean unloadQueuedChunks() {

// TODO Auto-generated method stub

return false;

}

 

@Override

public boolean canSave() {

// TODO Auto-generated method stub

return false;

}

 

@Override

public String makeString() {

// TODO Auto-generated method stub

return "random text";

}

 

@Override

public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3,

int var4) {

// TODO Auto-generated method stub

return null;

}

 

@Override

public ChunkPosition func_147416_a(World var1, String var2, int var3,

int var4, int var5) {

// TODO Auto-generated method stub

return null;

}

 

@Override

public int getLoadedChunkCount() {

// TODO Auto-generated method stub

return 0;

}

 

@Override

public void recreateStructures(int par1, int par2) {

/*

if (this.mapFeaturesEnabled) {

this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, (byte[]) null);

this.villageGenerator.generate(this, this.worldObj, par1, par2, (byte[]) null);

this.strongholdGenerator.generate(this, this.worldObj, par1, par2, (byte[]) null);

this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, (byte[]) null);

}

*/

}

 

 

 

@Override

public void saveExtraData() {

// TODO Auto-generated method stub

 

}

 

}

 

 

 

Interesting is that it wont let me add structures, the types(CAVE, STRONGHOLD,...) aren't accepted and marked as wrong...

 

 

 

Here could be your advertisement!

Posted

   @Override
   public boolean chunkExists(int var1, int var2) {
      // TODO Auto-generated method stub
      return false;
   }

   @Override
   public boolean saveChunks(boolean var1, IProgressUpdate var2) {
      // TODO Auto-generated method stub
      return false;
   }

   @Override
   public boolean unloadQueuedChunks() {
      // TODO Auto-generated method stub
      return false;
   }

   @Override
   public boolean canSave() {
      // TODO Auto-generated method stub
      return false;
   }

   @Override
   public ChunkPosition func_147416_a(World var1, String var2, int var3,
         int var4, int var5) {
      // TODO Auto-generated method stub
      return null;
   }

   @Override
   public int getLoadedChunkCount() {
      // TODO Auto-generated method stub
      return 0;
   }

 

According to those codes, your world doesn't exist, cannot be unloaded, cannot be saved, and is not loaded.

 

So basically it is a void.

 

I would suggest that you extend the overworld provider instead of making your own.

Posted

extending was a good idea.....

 

...i really want my i-am-an-idiot-smiley...

 

...but i still have some problems with structures. My Chunk Provider now extends the standart chunk provider(works greate...bash-head.gif) but i don't want to have strongholds and villages generated in my dimension.

How do i get rid of them? (i think that i have to override" createStructure()" but that doesn't work...)

 

I will post what i have already tried as soon as i get to my pc.

Here could be your advertisement!

Posted

A really quick fix if you didn't want to generate any structures would be adding this:

    public ChunkProviderDimenisonShift(World par1World, long par2, boolean par4)
    {
super(par1World, par2, false);
    }

If you want the other structure to generate, then you will have to override:

    public Chunk provideChunk(int par1, int par2);

    public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)

    public void recreateStructures(int par1, int par2)

I suggest copying the code from the overworld provider but removing the

this.strongholdGenerator.(Insert Function Here)(this.worldObj, this.rand, par2, par3);

   

 

 

Posted

A really quick fix if you didn't want to generate any structures would be adding this:

    public ChunkProviderDimenisonShift(World par1World, long par2, boolean par4)
    {
super(par1World, par2, false);
    }

If you want the other structure to generate, then you will have to override:

    public Chunk provideChunk(int par1, int par2);

    public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)

    public void recreateStructures(int par1, int par2)

I suggest copying the code from the overworld provider but removing the

this.strongholdGenerator.(Insert Function Here)(this.worldObj, this.rand, par2, par3);

 

 

Thats exactly what i tried...

But forge won't accept the structure types and mc crashes...

Will post my code as soon as possible(idea:forge for Smartphones? :D)

Here could be your advertisement!

Posted

So, thats what i tried:

 

 

package net.dimensionshift.mod.world.dimensions;

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA;

import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.util.IProgressUpdate;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.SpawnerAnimals;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkProviderGenerate;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.MapGenCaves;
import net.minecraft.world.gen.NoiseGeneratorOctaves;
import net.minecraft.world.gen.feature.WorldGenDungeons;
import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.structure.MapGenMineshaft;
import net.minecraft.world.gen.structure.MapGenScatteredFeature;
import net.minecraft.world.gen.structure.MapGenStronghold;
import net.minecraft.world.gen.structure.MapGenVillage;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen;

public class ChunkProviderDimenisonShift extends ChunkProviderGenerate{

public World worldObj;
private Random rand;
private NoiseGeneratorOctaves noiseGen1;
private NoiseGeneratorOctaves noiseGen2;
private NoiseGeneratorOctaves noiseGen3;
private NoiseGeneratorOctaves noiseGen4;
public NoiseGeneratorOctaves noiseGen5;
public NoiseGeneratorOctaves noiseGen6;
public NoiseGeneratorOctaves mobSpawnerNoise;
private final boolean mapFeaturesEnabled;

/** Holds Cave Generator */
private MapGenBase caveGenerator = new MapGenCaves();

/** Holds Stronghold Generator */
private MapGenStronghold strongholdGenerator = new MapGenStronghold();

/** Holds Village Generator */
private MapGenVillage villageGenerator = new MapGenVillage();

/** Holds Mineshaft Generator */
private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();



/** The biomes that are used to generate the chunk */
private BiomeGenBase[] biomesForGeneration;



public ChunkProviderDimenisonShift(World worldObj, long seed, boolean mapFeatures) {
	super(worldObj, seed, mapFeatures);
	this.worldObj = worldObj;
	this.mapFeaturesEnabled = mapFeatures;


}


    public Chunk provideChunk(int par1, int par2){
        this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
        Block[] ablock = new Block[65536];
        byte[] abyte = new byte[65536];
        this.func_147424_a(par1, par2, ablock);
        this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);
        this.replaceBlocksForBiome(par1, par2, ablock, abyte, this.biomesForGeneration);
        this.caveGenerator.func_151539_a(this, this.worldObj, par1, par2, ablock);

        Chunk chunk = new Chunk(this.worldObj, ablock, abyte, par1, par2);
        byte[] abyte1 = chunk.getBiomeArray();

        for (int k = 0; k < abyte1.length; ++k)
        {
            abyte1[k] = (byte)this.biomesForGeneration[k].biomeID;
        }

        chunk.generateSkylightMap();
        return chunk;
    }    
    
    
    
    
    public void populate(IChunkProvider par1IChunkProvider, int par2, int par3){
        BlockFalling.fallInstantly = true;
        int k = par2 * 16;
        int l = par3 * 16;
        BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
        this.rand.setSeed(this.worldObj.getSeed());
        long i1 = this.rand.nextLong() / 2L * 2L + 1L;
        long j1 = this.rand.nextLong() / 2L * 2L + 1L;
        this.rand.setSeed((long)par2 * i1 + (long)par3 * j1 ^ this.worldObj.getSeed());
        boolean flag = false;

        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));


        int k1;
        int l1;
        int i2;
        
        
        /*water in oasen/maybe used in later versions
         * 
        if (biomegenbase != BiomeGenBase.desert =BIOMEDSWOODS && !flag && this.rand.nextInt(4) == 0
            && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))
        {
            k1 = k + this.rand.nextInt(16) + 8;
            l1 = this.rand.nextInt(256);
            i2 = l + this.rand.nextInt(16) + 8;
            (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2);
        }
        */


        boolean doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, DUNGEON);
        for (k1 = 0; doGen && k1 < 8; ++k1)
        {
            l1 = k + this.rand.nextInt(16) + 8;
            i2 = this.rand.nextInt(256);
            int j2 = l + this.rand.nextInt(16) + 8;
            (new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2);
        }

        biomegenbase.decorate(this.worldObj, this.rand, k, l);

        k += 8;
        l += 8;

        
        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

        BlockFalling.fallInstantly = false;
    }
    
    public void recreateStructures(int par1, int par2){

    }
}

 

 

and my error

 

 

 

[23:46:34] [sound Library Loader/INFO]: Sound engine started

[23:46:34] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas

[23:46:34] [Client thread/INFO]: Created: 256x256 textures/items-atlas

[23:46:34] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[23:46:36] [MCO Availability Checker #1/ERROR]: Couldn't connect to Realms

[23:46:38] [server thread/INFO]: Starting integrated minecraft server version 1.7.2

[23:46:38] [server thread/INFO]: Generating keypair

[23:46:38] [server thread/INFO] [FML]: Injecting new block and item data into this server instance

[23:46:38] [server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@4f2320ff)

[23:46:38] [server thread/INFO] [FML]: Loading dimension 9 (New World) (net.minecraft.server.integrated.IntegratedServer@4f2320ff)

[23:46:38] [server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@4f2320ff)

[23:46:38] [server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@4f2320ff)

[23:46:38] [server thread/INFO]: Preparing start region for level 0

[23:46:39] [Netty Client IO #0/INFO] [FML]: Server protocol version 1

[23:46:39] [Netty IO #1/INFO] [FML]: Client protocol version 1

[23:46:39] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],[email protected],dimensionshift@Beta v0.015,[email protected]

[23:46:39] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT

[23:46:39] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER

[23:46:39] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[23:46:39] [server thread/INFO]: Jacky2611[local:E:7aa6fb00] logged in with entity id 346 at (140.0, 78.0, 248.0)

[23:46:39] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established

[23:46:39] [server thread/INFO]: Jacky2611 joined the game

[23:46:39] [server thread/ERROR] [FML]: HandshakeCompletionHandler exception

net.minecraft.util.ReportedException: Exception generating new chunk

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:142) ~[ChunkProviderServer.class:?]

at net.minecraft.server.management.PlayerManager$PlayerInstance.<init>(PlayerManager.java:345) ~[PlayerManager$PlayerInstance.class:?]

at net.minecraft.server.management.PlayerManager.getOrCreateChunkWatcher(PlayerManager.java:126) ~[PlayerManager.class:?]

at net.minecraft.server.management.PlayerManager.addPlayer(PlayerManager.java:160) ~[PlayerManager.class:?]

at net.minecraft.server.management.ServerConfigurationManager.func_72375_a(ServerConfigurationManager.java:233) ~[serverConfigurationManager.class:?]

at net.minecraft.server.management.ServerConfigurationManager.playerLoggedIn(ServerConfigurationManager.java:287) ~[serverConfigurationManager.class:?]

at net.minecraft.server.management.ServerConfigurationManager.initializeConnectionToPlayer(ServerConfigurationManager.java:151) ~[serverConfigurationManager.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:172) ~[NetworkDispatcher.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeHandshake(NetworkDispatcher.java:428) ~[NetworkDispatcher.class:?]

at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:17) ~[HandshakeCompletionHandler.class:?]

at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:11) ~[HandshakeCompletionHandler.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:?]

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]

at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?]

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) [NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) [NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) [integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]

Caused by: java.lang.NullPointerException

at net.dimensionshift.mod.world.dimensions.ChunkProviderDimenisonShift.provideChunk(ChunkProviderDimenisonShift.java:79) ~[ChunkProviderDimenisonShift.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:133) ~[ChunkProviderServer.class:?]

... 27 more

[23:46:39] [server thread/ERROR] [FML]: There was a critical exception handling a packet on channel FML

net.minecraft.util.ReportedException: Exception generating new chunk

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:142) ~[ChunkProviderServer.class:?]

at net.minecraft.server.management.PlayerManager$PlayerInstance.<init>(PlayerManager.java:345) ~[PlayerManager$PlayerInstance.class:?]

at net.minecraft.server.management.PlayerManager.getOrCreateChunkWatcher(PlayerManager.java:126) ~[PlayerManager.class:?]

at net.minecraft.server.management.PlayerManager.addPlayer(PlayerManager.java:160) ~[PlayerManager.class:?]

at net.minecraft.server.management.ServerConfigurationManager.func_72375_a(ServerConfigurationManager.java:233) ~[serverConfigurationManager.class:?]

at net.minecraft.server.management.ServerConfigurationManager.playerLoggedIn(ServerConfigurationManager.java:287) ~[serverConfigurationManager.class:?]

at net.minecraft.server.management.ServerConfigurationManager.initializeConnectionToPlayer(ServerConfigurationManager.java:151) ~[serverConfigurationManager.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:172) ~[NetworkDispatcher.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.completeHandshake(NetworkDispatcher.java:428) ~[NetworkDispatcher.class:?]

at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:17) ~[HandshakeCompletionHandler.class:?]

at cpw.mods.fml.common.network.internal.HandshakeCompletionHandler.channelRead0(HandshakeCompletionHandler.java:11) ~[HandshakeCompletionHandler.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?]

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]

at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) [NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) [NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) [integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]

Caused by: java.lang.NullPointerException

at net.dimensionshift.mod.world.dimensions.ChunkProviderDimenisonShift.provideChunk(ChunkProviderDimenisonShift.java:79) ~[ChunkProviderDimenisonShift.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:133) ~[ChunkProviderServer.class:?]

... 27 more

[23:46:39] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Ticking memory connection

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:206) ~[NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]

Caused by: java.lang.NullPointerException

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90) ~[FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242) ~[NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190) ~[NetworkSystem.class:?]

... 5 more

[23:46:39] [server thread/ERROR]: This crash report has been saved to: /Users/User/Desktop/modding/1.7.2 gradle/forge/eclipse/./crash-reports/crash-2014-04-02_23.46.39-server.txt

[23:46:39] [server thread/INFO]: Stopping server

[23:46:39] [server thread/INFO]: Saving players

[23:46:39] [server thread/INFO]: Saving worlds

[23:46:39] [server thread/INFO]: Saving chunks for level 'New World'/Overworld

[23:46:39] [server thread/INFO]: Saving chunks for level 'New World'/Nether

[23:46:39] [server thread/INFO]: Saving chunks for level 'New World'/The End

[23:46:39] [server thread/INFO]: Saving chunks for level 'New World'/DimenisonShiftBasicDimenison

---- Minecraft Crash Report ----

// I blame Dinnerbone.

 

Time: 02.04.14 23:46

Description: Ticking memory connection

 

java.lang.NullPointerException: Ticking memory connection

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242)

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:242)

 

-- Ticking connection --

Details:

Connection: net.minecraft.network.NetworkManager@537da7f4

Stacktrace:

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:190)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:762)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Mac OS X (x86_64) version 10.9.2

Java Version: 1.6.0_65, Apple Inc.

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Apple Inc.

Memory: 941061600 bytes (897 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 3663 (205128 bytes; 0 MB) allocated, 3448 (193088 bytes; 0 MB) used

IntCache: cache: 15, tcache: 0, allocated: 13, tallocated: 95

FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 mods active

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

dimensionshift{Beta v0.015} [DimensionShift] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Profiler Position: N/A (disabled)

Vec3 Pool Size: 963 (53928 bytes; 0 MB) allocated, 961 (53816 bytes; 0 MB) used

Player Count: 1 / 8; [EntityPlayerMP['Jacky2611'/346, l='New World', x=140,00, y=78,00, z=248,00]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

#@!@# Game crashed! Crash report saved to: #@!@# ./crash-reports/crash-2014-04-02_23.46.39-server.txt

[23:46:40] [Client Shutdown Thread/INFO]: Stopping server

[23:46:40] [Client Shutdown Thread/INFO]: Saving players

AL lib: (EE) alc_cleanup: 1 device not closed

 

 

 

Im sure that (again) i made an extremely stupid mistake and accidentally removed some really important line of code, but i can't find it...

Just added a smash-face-smiley shortcut to my keyboard....

Here could be your advertisement!

Posted

Error is at:

Caused by: java.lang.NullPointerException
   at net.dimensionshift.mod.world.dimensions.ChunkProviderDimenisonShift.provideChunk(ChunkProviderDimenisonShift.java:79) ~[ChunkProviderDimenisonShift.class:?]
   at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:133) ~[ChunkProviderServer.class:?]

 

It's still null. Not sure.

Have you tried @Override -ing it?

Posted

Man, it is completely pointless to copy a private field if you are not using it yourself.

In other words, your private fields is your stuff, not something Forge/Minecraft can touch.

All in all, don't copy/paste like a printer, use some brain.

Posted

Man, it is completely pointless to copy a private field if you are not using it yourself.

In other words, your private fields is your stuff, not something Forge/Minecraft can touch.

All in all, don't copy/paste like a printer, use some brain.

 

 

Yeah, it was 2 am when i stopped trying around with my chunkprovider...

(removed them now... ;))

 

Tried around a little bit and now i think that the problem is the Random rand.

 

 

EDIT:

banghead.gifbanghead.gifbanghead.gif

 

No idea why, but in the Mojang code there is

private Random rand;

. Changing this to

private Random rand = new Random();

solved it...Maybe i should sleep more...

Here could be your advertisement!

Posted

Well, i still have some problems with the world generation.

Nearly everywhere i find these huge chunk cliffs:

ueQW8ae.jpg

(Overworld and custom dimension.)

 

Here is my new Chunk Provider:

 

 

 

package net.dimensionshift.mod.world.dimensions;

 

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON;

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE;

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE;

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA;

 

import java.util.List;

import java.util.Random;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockFalling;

import net.minecraft.entity.EnumCreatureType;

import net.minecraft.init.Blocks;

import net.minecraft.util.IProgressUpdate;

import net.minecraft.world.ChunkPosition;

import net.minecraft.world.SpawnerAnimals;

import net.minecraft.world.World;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraft.world.chunk.Chunk;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.ChunkProviderGenerate;

import net.minecraft.world.gen.MapGenBase;

import net.minecraft.world.gen.MapGenCaves;

import net.minecraft.world.gen.NoiseGeneratorOctaves;

import net.minecraft.world.gen.feature.WorldGenDungeons;

import net.minecraft.world.gen.feature.WorldGenLakes;

import net.minecraft.world.gen.structure.MapGenMineshaft;

import net.minecraft.world.gen.structure.MapGenScatteredFeature;

import net.minecraft.world.gen.structure.MapGenStronghold;

import net.minecraft.world.gen.structure.MapGenVillage;

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.event.terraingen.PopulateChunkEvent;

import net.minecraftforge.event.terraingen.TerrainGen;

 

public class ChunkProviderDimenisonShift extends ChunkProviderGenerate{

 

public World worldObj;

private Random rand=new Random();

private NoiseGeneratorOctaves noiseGen1;

private NoiseGeneratorOctaves noiseGen2;

private NoiseGeneratorOctaves noiseGen3;

private NoiseGeneratorOctaves noiseGen4;

public NoiseGeneratorOctaves noiseGen5;

public NoiseGeneratorOctaves noiseGen6;

public NoiseGeneratorOctaves mobSpawnerNoise;

private final boolean mapFeaturesEnabled;

 

/** Holds Cave Generator */

private MapGenBase caveGenerator = new MapGenCaves();

 

 

 

 

/** The biomes that are used to generate the chunk */

private BiomeGenBase[] biomesForGeneration;

 

 

 

public ChunkProviderDimenisonShift(World worldObj, long seed, boolean mapFeatures) {

super(worldObj, seed, mapFeatures);

this.worldObj = worldObj;

this.mapFeaturesEnabled = mapFeatures;

 

 

}

 

@Override

    public Chunk provideChunk(int par1, int par2)

    {

        this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);

        Block[] ablock = new Block[65536];

        byte[] abyte = new byte[65536];

        this.func_147424_a(par1, par2, ablock);

        this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);

        this.replaceBlocksForBiome(par1, par2, ablock, abyte, this.biomesForGeneration);

        this.caveGenerator.func_151539_a(this, this.worldObj, par1, par2, ablock);

 

 

        Chunk chunk = new Chunk(this.worldObj, ablock, abyte, par1, par2);

        byte[] abyte1 = chunk.getBiomeArray();

 

        for (int k = 0; k < abyte1.length; ++k)

        {

            abyte1[k] = (byte)this.biomesForGeneration[k].biomeID;

        }

 

        chunk.generateSkylightMap();

        return chunk;

    } 

   

   

   

    @Override

    public void populate(IChunkProvider par1IChunkProvider, int par2, int par3){

        BlockFalling.fallInstantly = true;

        int k = par2 * 16;

        int l = par3 * 16;

        BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);

        this.rand.setSeed(this.worldObj.getSeed());

        long i1 = this.rand.nextLong() / 2L * 2L + 1L;

        long j1 = this.rand.nextLong() / 2L * 2L + 1L;

        this.rand.setSeed((long)par2 * i1 + (long)par3 * j1 ^ this.worldObj.getSeed());

        boolean flag = false;

 

        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

 

 

        int k1;

        int l1;

        int i2;

       

       

        /*water in oasen/maybe used in later versions

        *

        if (biomegenbase != BiomeGenBase.desert =BIOMEDSWOODS && !flag && this.rand.nextInt(4) == 0

            && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))

        {

            k1 = k + this.rand.nextInt(16) + 8;

            l1 = this.rand.nextInt(256);

            i2 = l + this.rand.nextInt(16) + 8;

            (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2);

        }

        */

 

 

        boolean doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, DUNGEON);

        for (k1 = 0; doGen && k1 < 8; ++k1)

        {

            l1 = k + this.rand.nextInt(16) + 8;

            i2 = this.rand.nextInt(256);

            int j2 = l + this.rand.nextInt(16) + 8;

            (new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2);

        }

 

        //biomegenbase.decorate(this.worldObj, this.rand, k, l);

 

        k += 8;

        l += 8;

 

       

        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

 

        BlockFalling.fallInstantly = false;

    }

   

    @Override

    public void recreateStructures(int par1, int par2){

 

    }

}

 

 

 

Here could be your advertisement!

Posted

Ok, my earlier idea of extending the overworld generator is causing some problems, so could you try copying the entire overworld chunk provider over and then doing your gen from there? I forgot how many private fields there are in it.

Posted

Yeah, Now everything looks better(but still very "cubic")

 

EDIT:

 

Ahh, think i found the problem...

most likely i was tped before my prepare dimension thread could finish checking the underground and placing blocks...

Now i just have to figure out how i can start the p function from another thread and everything should be fine.

Here could be your advertisement!

Posted

Looks like i can't figure out what im doing wrong on my own.

 

In my onBlockActivated i start a new thread

Thread copy = new Thread(new TeleportSimpleController(world, dWorld, x, y, z, player)); and copy.start();

that places some blocks before you are teleported. In the thread i then (after it placed the blocks) use this:

 

	System.out.println("DONE");




	int dim=0;

	if(world.provider.dimensionId==0) {
	dim=9;
	}


	TeleporterDimensionShift.teleport(player, world, dim);

 

to start:

 

 

 

package net.dimensionshift.mod.world.dimensions;

import ibxm.Player;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.MathHelper;
import net.minecraft.world.Teleporter;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;

public class TeleporterDimensionShift extends Teleporter{
                
private final WorldServer worldServerInstance;

   public TeleporterDimensionShift(WorldServer par1WorldServer) {
          super(par1WorldServer);
          this.worldServerInstance = par1WorldServer;
   }

   @Override
   public void placeInPortal(Entity pEntity, double p2, double p3, double p4, float p5) {
          int i = MathHelper.floor_double(pEntity.posX);
          int j = MathHelper.floor_double(pEntity.posY);
          int k = MathHelper.floor_double(pEntity.posZ);
          this.worldServerInstance.getBlock(i, j, k);   //dummy load to maybe gen chunk
          int height = this.worldServerInstance.getHeightValue(i, k);

          pEntity.setPosition( i, height, k );

          return;
   }

   

   public static void teleport(EntityPlayer player, World world, int dim) {

   	MinecraftServer mServer = MinecraftServer.getServer();
   	Side sidex = FMLCommonHandler.instance().getEffectiveSide();
   	if (sidex == Side.SERVER){
		if (player instanceof EntityPlayerMP){	
			WorldServer worldserver = (WorldServer)world;
			EntityPlayerMP playerMP = (EntityPlayerMP)player;
			if (player.ridingEntity == null && player.riddenByEntity == null && player instanceof EntityPlayer){
				FMLCommonHandler.instance().getMinecraftServerInstance();
				playerMP.mcServer.getConfigurationManager().transferPlayerToDimension(playerMP, dim, new net.dimensionshift.mod.world.dimensions.TeleporterDimensionShift(mServer.worldServerForDimension(dim)));

			}

		}
	}
   }	   
   
   
   
}

 

 

 

Now my problem is that either nothing happen or that the game crashes.

If i get an error, this is what my log usually looks like:

 

 

 

[22:04:51] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Exception ticking world

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:734) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]

Caused by: java.lang.IllegalStateException: TickNextTick list out of synch

at net.minecraft.world.WorldServer.tickUpdates(WorldServer.java:556) ~[WorldServer.class:?]

at net.minecraft.world.WorldServer.tick(WorldServer.java:198) ~[WorldServer.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:728) ~[MinecraftServer.class:?]

... 4 more

[22:04:51] [server thread/ERROR]: This crash report has been saved to: /Users/USER/Desktop/modding/1.7.2 gradle/forge/eclipse/./crash-reports/crash-2014-04-04_22.04.51-server.txt

[22:04:51] [server thread/INFO]: Stopping server

[22:04:51] [server thread/INFO]: Saving players

[22:04:51] [server thread/INFO]: Saving worlds

[22:04:51] [server thread/INFO]: Saving chunks for level 'New World'/Overworld

---- Minecraft Crash Report ----

// Oops.

 

Time: 04.04.14 22:04

Description: Exception ticking world

 

java.lang.IllegalStateException: TickNextTick list out of synch

at net.minecraft.world.WorldServer.tickUpdates(WorldServer.java:556)

at net.minecraft.world.WorldServer.tick(WorldServer.java:198)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:728)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.world.WorldServer.tickUpdates(WorldServer.java:556)

at net.minecraft.world.WorldServer.tick(WorldServer.java:198)

 

-- Affected level --

Details:

Level name: New World

All players: 0 total; []

Chunk stats: ServerChunkCache: 95 Drop: 0

Level seed: -617353511193192754

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 0 game time, 0 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: ~~ERROR~~ NullPointerException: null

Stacktrace:

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:728)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Mac OS X (x86_64) version 10.9.2

Java Version: 1.6.0_65, Apple Inc.

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Apple Inc.

Memory: 774418536 bytes (738 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 3674 (205744 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 mods active

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

dimensionshift{Beta v0.015} [DimensionShift] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Profiler Position: N/A (disabled)

Vec3 Pool Size: 3142 (175952 bytes; 0 MB) allocated, 1273 (71288 bytes; 0 MB) used

Player Count: 1 / 8; [EntityPlayerMP['Jacky2611'/252, l='New World', x=-356,70, y=150,00, z=16,28]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

#@!@# Game crashed! Crash report saved to: #@!@# ./crash-reports/crash-2014-04-04_22.04.51-server.txt

[22:04:51] [Client Shutdown Thread/INFO]: Stopping server

[22:04:51] [Client Shutdown Thread/INFO]: Saving players

DONE

2014-04-04 22:04:52,361 WARN Unable to register shutdown hook due to JVM state

AL lib: (EE) alc_cleanup: 1 device not closed

 

 

Here could be your advertisement!

Posted

Instead of placing those blocks with a new thread, could you try placing them with the teleporter?

 

You are going to need somthing like this code:

 

onBlockActivated:

YourClass.StaticTeleportationMethod(9, par3EntityPlayer, new NewTeleporterClass(MinecraftServer.getServer().worldServerForDimension(9)));

 

YourClass:

    	   public static void MPhelperMethod(int par1, EntityPlayerMP player, Teleporter t)
   		    {
    		   player.mcServer.getConfigurationManager().transferPlayerToDimension(player, par1,t);
   		    }
    	   /**
    	    * Teleports the entity to another dimension. Params: Dimension number to teleport to
    	    */
    	   public static void StaticTeleportationMethod(int par1, Entity player, Teleporter t)
    	   {
    		   if (player instanceof EntityPlayerMP)
    		   {
    			   MPhelperMethod(par1, (EntityPlayerMP)player,t);
    			   return;
    		   }
    		   if (!player.worldObj.isRemote && !player.isDead)
    		   {
    			   player.worldObj.theProfiler.startSection("changeDimension");
    			   MinecraftServer minecraftserver = MinecraftServer.getServer();
    			   int j = player.dimension;
    			   WorldServer worldserver = minecraftserver.worldServerForDimension(j);
    			   WorldServer worldserver1 = minecraftserver.worldServerForDimension(par1);
    			   player.dimension = par1;
    			   player.worldObj.removeEntity(player);
    			   player.isDead = false;
    			   player.worldObj.theProfiler.startSection("reposition");
    			   minecraftserver.getConfigurationManager().transferEntityToWorld(player, j, worldserver, worldserver1,t);
    			   player.worldObj.theProfiler.endStartSection("reloading");
    			   Entity entity = EntityList.createEntityByName(EntityList.getEntityString(player), worldserver1);
    			   
    			   if (entity != null)
    			   {
    				   entity.copyDataFrom(player, true);
    				   
    				   if (j == 1 && par1 == 1)
    				   {
    					   ChunkCoordinates chunkcoordinates = worldserver1.getSpawnPoint();
    					   chunkcoordinates.posY = player.worldObj.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ);
    					   entity.setLocationAndAngles((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ, entity.rotationYaw, entity.rotationPitch);
    				   }	
    				   
    				   worldserver1.spawnEntityInWorld(entity);
    			   }

    			   player.isDead = true;
    			   player.worldObj.theProfiler.endSection();
    			   worldserver.resetUpdateEntityTick();
    			   worldserver1.resetUpdateEntityTick();
    			   player.worldObj.theProfiler.endSection();
    		   }	
    	   }

And then you will need to make a new teleporter class that actually behaves like a teleporter and makes a portal (the blocks you need to place).

Posted

If i place the blocks without the thread i can call the teleporter after it and everything works fine.

But now my game sometimes crashes while

 

Fixed it. thx.

Here could be your advertisement!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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