Jump to content

Recommended Posts

Posted

Hey guys,

As the title says I am making a Dimension for the first time

 

I have an issue with teleporting

 

I have an error on this piece of code in my TeleporterParallelWorlds clas

new PortalPosition(this, i, j, k, this.worldServerInstance.getTotalWorldTime()));

 

This is my main:

package assassinhero.parallelworlds;

import assassinhero.parallelworlds.client.ParallelWorldsClientPacketHandler;
import assassinhero.parallelworlds.common.ParallelWorldsCommonProxy;
import assassinhero.parallelworlds.common.ParallelWorldsServerPacketHandler;
import assassinhero.parallelworlds.common.WorldGenerator;
import assassinhero.parallelworlds.common.blocks.BlockArcticiteBlock;
import assassinhero.parallelworlds.common.blocks.BlockAscariteBlock;
import assassinhero.parallelworlds.common.blocks.BlockHeavenlyOre;
import assassinhero.parallelworlds.common.blocks.BlockHellOre;
import assassinhero.parallelworlds.common.blocks.BlockHelliteBlock;
import assassinhero.parallelworlds.common.blocks.BlockNightOre;
import assassinhero.parallelworlds.common.blocks.BlockNightStoneBlock;
import assassinhero.parallelworlds.common.blocks.BlockPortalArcitcite;
import assassinhero.parallelworlds.common.blocks.BlockTimeOre;
import assassinhero.parallelworlds.common.blocks.BlockTimeStoneBlock;
import assassinhero.parallelworlds.common.items.ItemCookedLambChopFood;
import assassinhero.parallelworlds.common.items.ItemDemonicBoots;
import assassinhero.parallelworlds.common.items.ItemDemonicChestplate;
import assassinhero.parallelworlds.common.items.ItemDemonicHelmet;
import assassinhero.parallelworlds.common.items.ItemDemonicLeggings;
import assassinhero.parallelworlds.common.items.ItemDemonicPickaxe;
import assassinhero.parallelworlds.common.items.ItemDemonicShovel;
import assassinhero.parallelworlds.common.items.ItemDemonicSword;
import assassinhero.parallelworlds.common.items.ItemDevilStoneItem;
import assassinhero.parallelworlds.common.items.ItemEnderIngotItem;
import assassinhero.parallelworlds.common.items.ItemEnderShardItem;
import assassinhero.parallelworlds.common.items.ItemHeavenlyIngotItem;
import assassinhero.parallelworlds.common.items.ItemHeavenlyPickaxe;
import assassinhero.parallelworlds.common.items.ItemHellShardItem;
import assassinhero.parallelworlds.common.items.ItemIceShardItem;
import assassinhero.parallelworlds.common.items.ItemIceStoneItem;
import assassinhero.parallelworlds.common.items.ItemMutatedAppleFood;
import assassinhero.parallelworlds.common.items.ItemNightGemItem;
import assassinhero.parallelworlds.common.items.ItemRawLambChopFood;
import assassinhero.parallelworlds.common.items.ItemSapphireAxe;
import assassinhero.parallelworlds.common.items.ItemSapphireItem;
import assassinhero.parallelworlds.common.items.ItemSapphirePickaxe;
import assassinhero.parallelworlds.common.items.ItemSapphireSword;
import assassinhero.parallelworlds.common.items.ItemTimeAxe;
import assassinhero.parallelworlds.common.items.ItemTimeGemItem;
import assassinhero.parallelworlds.common.items.ItemTimePickaxe;
import assassinhero.parallelworlds.common.items.ItemTimeShovel;
import assassinhero.parallelworlds.common.items.ItemTimeSword;
import net.minecraft.block.Block;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;

@NetworkMod(clientSideRequired=true, serverSideRequired= true,
clientPacketHandlerSpec = @cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler(channels = {"ParallelWorlds"} , packetHandler = ParallelWorldsClientPacketHandler.class),
serverPacketHandlerSpec = @cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler(channels = {"ParallelWorlds"} , packetHandler = ParallelWorldsServerPacketHandler.class))

@Mod(modid="Parallel Worlds", name = "ParallelWorlds",version = "1.0.0")


public class ParallelWorlds {

@cpw.mods.fml.common.Mod.Instance("ParallelWorlds")
public static ParallelWorlds Instance = new ParallelWorlds();

@SidedProxy(clientSide = "assassinhero.parallelworlds.client.ParallelWorldsClientProxy", serverSide = "assassinhero.parallelworlds.common.ParallelWorldsCommonProxy")
public static ParallelWorldsCommonProxy proxy;


public static Block Portal;
public static Item EnderIngot;
public static Item DemonicHelmet;
public static Item DemonicChestplate;
public static Item DemonicLeggings;
public static Item DemonicBoots;
public static Item MutatedApple;
public static Item CookedLambChop;
public static Item RawLambChop;
public static Item DemonicShovel;
public static Item DemonicPickaxe;
public static Item DevilStone;
public static Item DemonicSword;
public static Block HellOre;
public static Item HellShard;
public static Item EnderShard;
public static Item SapphireAxe;
public static Item SapphireSword;
public static Item IceStone;
public static Item IceShard;
public static Item HeavenlyPickaxe;
public static Item SapphirePickaxe;
public static Item Sapphire;
public static Item TimePickaxe;
public static Item TimeShovel;
public static Item TimeAxe;
public static Item TimeSword;
public static Block TimeOre;
public static Item AscariteHelmet;
public static Item AscariteChestplate;
public static Item AscariteLeggings;
public static Item AscariteBoots;
public static Block HeavenlyOre;
public static Item HeavenlyIngot;
public static Block Ascarite;
public static Block Hellite;
public static Block Arcticite;
public static Block NightOre;
public static Item TimeGem;
public static Block TimeStone;
public static Block NightStone;
public static Item NightGem;
@cpw.mods.fml.common.Mod.PreInit
public void PreInit(FMLPreInitializationEvent event){
	NightOre = new BlockNightOre(3657).setUnlocalizedName("Night Ore");
	NightStone = new BlockNightStoneBlock(3658).setUnlocalizedName("Night Stone");
	TimeStone = new BlockTimeStoneBlock(3659).setUnlocalizedName("Time Stone");
	Arcticite = new BlockArcticiteBlock(3660).setUnlocalizedName("Arcticite");
	Hellite = new BlockHelliteBlock(3661).setUnlocalizedName("Hellite");
	Ascarite = new BlockAscariteBlock(3662).setUnlocalizedName("Ascarite");
	HeavenlyOre = new BlockHeavenlyOre(3663).setUnlocalizedName("Heavenly Ore");
	TimeOre = new BlockTimeOre(3664).setUnlocalizedName("Time Ore");
	HellOre = new BlockHellOre(3665).setUnlocalizedName("Hell Ore");
	TimeSword = new ItemTimeSword(8000, EnumToolMaterial.TIME).setUnlocalizedName("Time Sword");
	TimePickaxe = new ItemTimePickaxe(8001, EnumToolMaterial.TIME).setUnlocalizedName("Time Pickaxe");
	TimeAxe = new ItemTimeAxe(8002, EnumToolMaterial.TIME).setUnlocalizedName("Time Axe");
	TimeShovel = new ItemTimeShovel(8003, EnumToolMaterial.TIME).setUnlocalizedName("Time Shovel");
	SapphirePickaxe = new ItemSapphirePickaxe(8004, EnumToolMaterial.SAPPHIRE).setUnlocalizedName("Sapphire Pickaxe");
	SapphireSword = new ItemSapphireSword(8005, EnumToolMaterial.SAPPHIRE).setUnlocalizedName("Sapphire Sword");
	SapphireAxe = new ItemSapphireAxe(8006, EnumToolMaterial.SAPPHIRE).setUnlocalizedName("Sapphire Axe");
	HeavenlyPickaxe = new ItemHeavenlyPickaxe(8009, EnumToolMaterial.HEAVENLY).setUnlocalizedName("Heavenly Pickaxe");
	DemonicSword = new ItemDemonicSword(8012, EnumToolMaterial.DEMONIC).setUnlocalizedName("Demonic Sword");
	DemonicPickaxe = new ItemDemonicPickaxe(8013, EnumToolMaterial.DEMONIC).setUnlocalizedName("Demonic Pickaxe");
	DemonicShovel = new ItemDemonicShovel(8014, EnumToolMaterial.DEMONIC).setUnlocalizedName("Demonic Shovel");
	NightGem = new ItemNightGemItem(5000).setUnlocalizedName("Night Gem");
	TimeGem = new ItemTimeGemItem(5001).setUnlocalizedName("Time Gem");
	HeavenlyIngot = new ItemHeavenlyIngotItem(5002).setUnlocalizedName("Heavenly Ingot");
	Sapphire = new ItemSapphireItem(5003).setUnlocalizedName("Sapphire");
	IceShard = new ItemIceShardItem(5004).setUnlocalizedName("Ice Shard");
	IceStone = new ItemIceStoneItem(5005).setUnlocalizedName("Ice Stone");
	EnderShard = new ItemEnderShardItem(5006).setUnlocalizedName("Ender Shard");
	HellShard = new ItemHellShardItem(5007).setUnlocalizedName("Hell Shard");
	DevilStone = new ItemDevilStoneItem(5008).setUnlocalizedName("Devil Stone");
	RawLambChop = new ItemRawLambChopFood(5009, 4, 4.0F, true).setUnlocalizedName("Raw Lamb Chop");
	CookedLambChop = new ItemCookedLambChopFood(5010, 8, 4.0F, true).setUnlocalizedName("Cooked Lamb Chop");
	MutatedApple = new ItemMutatedAppleFood(5011, 5, 2.0F, false).setUnlocalizedName("Mutated Apple");
	EnderIngot = new ItemEnderIngotItem(5012).setUnlocalizedName("Ender Ingot");
	DemonicHelmet = new ItemDemonicHelmet(20000, EnumArmorMaterial.DEMONIC, 8, 0).setUnlocalizedName("Demonic Helmet");
	DemonicChestplate = new ItemDemonicChestplate(20001, EnumArmorMaterial.DEMONIC, 8, 1).setUnlocalizedName("Demonic Chestplate");
	DemonicLeggings = new ItemDemonicLeggings(20002, EnumArmorMaterial.DEMONIC, 7, 2).setUnlocalizedName("Demonic Leggings");
	DemonicBoots = new ItemDemonicBoots(20003, EnumArmorMaterial.DEMONIC, 7, 3).setUnlocalizedName("Demonic Boots");
	Portal = new BlockPortalArcitcite(1000).setUnlocalizedName("Portal");




}

@Init
public void InitParallelWorlds(FMLInitializationEvent event){
	NetworkRegistry.instance().registerGuiHandler(this, proxy);
	proxy.registerBlocks();
	proxy.registerItems();
	craftingRecipes();
	EnumToolMaterial();
	EnumArmorMaterial();
	GameRegistry.registerWorldGenerator(new WorldGenerator());
	smeltingRecipes();
	MinecraftForge.EVENT_BUS.register(new ParallelWorldsSheepDropsEvent());
	DimensionManager();

}

public void craftingRecipes(){
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.NightStone, 1), "XX", "XX", Character.valueOf('X'), ParallelWorlds.NightGem);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimeStone, 1 ), "XX", "XX", Character.valueOf('X'), ParallelWorlds.TimeGem); 
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.Arcticite, 1), "XX", "XX", Character.valueOf('X'), Block.blockSnow);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.Ascarite, 1), "XX", "XX", Character.valueOf('X'), ParallelWorlds.HeavenlyIngot);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimePickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorlds.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimeSword, 1), " X ", " X ", " A ", Character.valueOf('X'), ParallelWorlds.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.SapphirePickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorlds.Sapphire, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimeAxe, 1), "XX ", "XA ", " A ", Character.valueOf('X'), ParallelWorlds.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.HeavenlyPickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorlds.HeavenlyIngot, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.IceStone, 1), "XXX", "XXX", "XXX", Character.valueOf('X'), ParallelWorlds.IceShard);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimeShovel, 1), " X ", " A ", " A ", Character.valueOf('X'), ParallelWorlds.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.SapphireSword, 1), " X ", " X ", " A ", Character.valueOf('X'), ParallelWorlds.Sapphire, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.SapphireAxe, 1), "XX ", "XA ", " A ", Character.valueOf('X'), ParallelWorlds.Sapphire, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicSword,1), " X ", " X ", " A ", Character.valueOf('X'), ParallelWorlds.DevilStone, Character.valueOf('A'), Item.blazeRod);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.Hellite,1), "XXX", "XXX", "XXX", Character.valueOf('X'), ParallelWorlds.HellShard);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicPickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorlds.DevilStone, Character.valueOf('A'), Item.blazeRod);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicHelmet, 1), "   ", "XXX", "X X", Character.valueOf('X'), ParallelWorlds.DevilStone);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicChestplate, 1), "X X", "XXX", "XXX", Character.valueOf('X'), ParallelWorlds.DevilStone);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicLeggings, 1), "XXX", "X X", "X X", Character.valueOf('X'), ParallelWorlds.DevilStone);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicBoots, 1), "   ", "X X", "X X", Character.valueOf('X'), ParallelWorlds.DevilStone);

}


public static void EnumToolMaterial(){
	EnumToolMaterial toolTime = EnumHelper.addToolMaterial("Time", 3, 2000, 10.F, 5, 20);
	EnumToolMaterial toolSapphire = EnumHelper.addToolMaterial("Sapphire", 3, 1500, 9.0F, 10, 10);
	EnumToolMaterial toolHeavenly = EnumHelper.addToolMaterial("Heavenly", 2, 300, 5.0F, 15, 5);
	EnumToolMaterial toolDemonic = EnumHelper.addToolMaterial("Demonic", 3, 0, 15.0F, 20, 30);
	EnumToolMaterial toolEnder = EnumHelper.addToolMaterial("ENDER", 3, 0, 15.0F, 15, 25);


}

public static void EnumArmorMaterial(){
	EnumArmorMaterial armorDemonic = EnumHelper.addArmorMaterial("DEMONIC", 0, new int[]{3, 8, 6, 3}, 20);
}

public void smeltingRecipes(){
	GameRegistry.addSmelting(HeavenlyOre.blockID, new ItemStack(HeavenlyIngot, 1), 0.7F);
	GameRegistry.addSmelting(RawLambChop.itemID, new ItemStack(CookedLambChop, 1), 0.3F);
}




public static int dimension;

public void DimensionManager(){
	DimensionManager.registerProviderType(dimension, WorldProviderArcticite.class, false);
	DimensionManager.registerDimension(dimension, dimension);
}


}








 

This is my portal block class and I have an error under transferPlayerToDimension here:

package assassinhero.parallelworlds.common.blocks;

import java.util.Random;

import assassinhero.parallelworlds.ParallelWorlds;

import net.minecraft.block.Block;
import net.minecraft.block.BlockPortal;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World;

public class BlockPortalArcitcite extends BlockPortal{

public BlockPortalArcitcite(int par1) {
	super(par1);
	setCreativeTab(CreativeTabs.tabBlock);


}

public void registerIcons(IconRegister par1iconregister){
	this.blockIcon = par1iconregister.registerIcon("Portal");
}


 public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
        super.updateTick(par1World, par2, par3, par4, par5Random);



}

 public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
    {
        byte b0 = 0;
        byte b1 = 0;

        if (par1World.getBlockId(par2 - 1, par3, par4) == ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 + 1, par3, par4) == ParallelWorlds.Arcticite.blockID)
        {
            b0 = 1;
        }

        if (par1World.getBlockId(par2, par3, par4 - 1) == ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2, par3, par4 + 1) == ParallelWorlds.Arcticite.blockID)
        {
            b1 = 1;
        }

        if (b0 == b1)
        {
            return false;
        }
        else
        {
            if (par1World.getBlockId(par2 - b0, par3, par4 - b1) == 0)
            {
                par2 -= b0;
                par4 -= b1;
            }

            int l;
            int i1;

            for (l = -1; l <= 2; ++l)
            {
                for (i1 = -1; i1 <= 3; ++i1)
                {
                    boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;

                    if (l != -1 && l != 2 || i1 != -1 && i1 != 3)
                    {
                        int j1 = par1World.getBlockId(par2 + b0 * l, par3 + i1, par4 + b1 * l);

                        if (flag)
                        {
                            if (j1 != ParallelWorlds.Arcticite.blockID)
                            {
                                return false;
                            }
                        }
                        else if (j1 != 0 && j1 != Block.fire.blockID)
                        {
                            return false;
                        }
                    }
                }
            }

            for (l = 0; l < 2; ++l)
            {
                for (i1 = 0; i1 < 3; ++i1)
                {
                    par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, ParallelWorlds.Portal.blockID, 0, 2);
                }
            }

            return true;
        }
        
        
     
    }

 public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity){
    
        if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null){
        	if(par5Entity instanceof EntityPlayerMP){
        		EntityPlayerMP EntityPlayer = (EntityPlayerMP) par5Entity;
        		if(par5Entity.dimension != ParallelWorlds.dimension){
        			
        			EntityPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(EntityPlayer, ParallelWorlds.dimension, new TeleporterParallelWorlds(EntityPlayer.mcServer.worldServerForDimension(ParallelWorlds.dimension)));
        			
        		}
        		
        		else{
        			
        			EntityPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(EntityPlayer, ParallelWorlds.dimension, new TeleporterParalelWorlds(EntityPlayer.mcServer.worldServerForDimension(0)));
        			
        		}
        	}
       
    }
 }


    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        byte b0 = 0;
        byte b1 = 1;

        if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID)
        {
            b0 = 1;
            b1 = 0;
        }

        int i1;

        for (i1 = par3; par1World.getBlockId(par2, i1 - 1, par4) == this.blockID; --i1)
        {
            ;
        }

        if (par1World.getBlockId(par2, i1 - 1, par4) != ParallelWorlds.Arcticite.blockID)
        {
            par1World.setBlockToAir(par2, par3, par4);
        }
        else
        {
            int j1;

            for (j1 = 1; j1 < 4 && par1World.getBlockId(par2, i1 + j1, par4) == this.blockID; ++j1)
            {
                ;
            }

            if (j1 == 3 && par1World.getBlockId(par2, i1 + j1, par4) == ParallelWorlds.Arcticite.blockID)
            {
                boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID;
                boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == this.blockID || par1World.getBlockId(par2, par3, par4 + 1) == this.blockID;

                if (flag && flag1)
                {
                    par1World.setBlockToAir(par2, par3, par4);
                }
                else
                {
                    if ((par1World.getBlockId(par2 + b0, par3, par4 + b1) != ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 - b0, par3, par4 - b1) != this.blockID) && (par1World.getBlockId(par2 - b0, par3, par4 - b1) != ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 + b0, par3, par4 + b1) != this.blockID))
                    {
                        par1World.setBlockToAir(par2, par3, par4);
                    }
                }
            }
            else
            {
                par1World.setBlockToAir(par2, par3, par4);
            }
        }
    }




}

 

Lastly, this is my TeleporterParallelWorlds class:

 

package assassinhero.parallelworlds.common.blocks;

import java.util.Random;

import assassinhero.parallelworlds.ParallelWorlds;

import net.minecraft.block.Block;
import net.minecraft.block.BlockPortal;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World;

public class BlockPortalArcitcite extends BlockPortal{

public BlockPortalArcitcite(int par1) {
	super(par1);
	setCreativeTab(CreativeTabs.tabBlock);


}

public void registerIcons(IconRegister par1iconregister){
	this.blockIcon = par1iconregister.registerIcon("Portal");
}


 public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
        super.updateTick(par1World, par2, par3, par4, par5Random);



}

 public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
    {
        byte b0 = 0;
        byte b1 = 0;

        if (par1World.getBlockId(par2 - 1, par3, par4) == ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 + 1, par3, par4) == ParallelWorlds.Arcticite.blockID)
        {
            b0 = 1;
        }

        if (par1World.getBlockId(par2, par3, par4 - 1) == ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2, par3, par4 + 1) == ParallelWorlds.Arcticite.blockID)
        {
            b1 = 1;
        }

        if (b0 == b1)
        {
            return false;
        }
        else
        {
            if (par1World.getBlockId(par2 - b0, par3, par4 - b1) == 0)
            {
                par2 -= b0;
                par4 -= b1;
            }

            int l;
            int i1;

            for (l = -1; l <= 2; ++l)
            {
                for (i1 = -1; i1 <= 3; ++i1)
                {
                    boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;

                    if (l != -1 && l != 2 || i1 != -1 && i1 != 3)
                    {
                        int j1 = par1World.getBlockId(par2 + b0 * l, par3 + i1, par4 + b1 * l);

                        if (flag)
                        {
                            if (j1 != ParallelWorlds.Arcticite.blockID)
                            {
                                return false;
                            }
                        }
                        else if (j1 != 0 && j1 != Block.fire.blockID)
                        {
                            return false;
                        }
                    }
                }
            }

            for (l = 0; l < 2; ++l)
            {
                for (i1 = 0; i1 < 3; ++i1)
                {
                    par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, ParallelWorlds.Portal.blockID, 0, 2);
                }
            }

            return true;
        }
        
        
     
    }

 public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity){
    
        if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null){
        	if(par5Entity instanceof EntityPlayerMP){
        		EntityPlayerMP EntityPlayer = (EntityPlayerMP) par5Entity;
        		if(par5Entity.dimension != ParallelWorlds.dimension){
        			
        			EntityPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(EntityPlayer, ParallelWorlds.dimension, new TeleporterParallelWorlds(EntityPlayer.mcServer.worldServerForDimension(ParallelWorlds.dimension)));
        			
        		}
        		
        		else{
        			
        			EntityPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(EntityPlayer, ParallelWorlds.dimension, new TeleporterParalelWorlds(EntityPlayer.mcServer.worldServerForDimension(0)));
        			
        		}
        	}
       
    }
 }


    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        byte b0 = 0;
        byte b1 = 1;

        if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID)
        {
            b0 = 1;
            b1 = 0;
        }

        int i1;

        for (i1 = par3; par1World.getBlockId(par2, i1 - 1, par4) == this.blockID; --i1)
        {
            ;
        }

        if (par1World.getBlockId(par2, i1 - 1, par4) != ParallelWorlds.Arcticite.blockID)
        {
            par1World.setBlockToAir(par2, par3, par4);
        }
        else
        {
            int j1;

            for (j1 = 1; j1 < 4 && par1World.getBlockId(par2, i1 + j1, par4) == this.blockID; ++j1)
            {
                ;
            }

            if (j1 == 3 && par1World.getBlockId(par2, i1 + j1, par4) == ParallelWorlds.Arcticite.blockID)
            {
                boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID;
                boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == this.blockID || par1World.getBlockId(par2, par3, par4 + 1) == this.blockID;

                if (flag && flag1)
                {
                    par1World.setBlockToAir(par2, par3, par4);
                }
                else
                {
                    if ((par1World.getBlockId(par2 + b0, par3, par4 + b1) != ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 - b0, par3, par4 - b1) != this.blockID) && (par1World.getBlockId(par2 - b0, par3, par4 - b1) != ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 + b0, par3, par4 + b1) != this.blockID))
                    {
                        par1World.setBlockToAir(par2, par3, par4);
                    }
                }
            }
            else
            {
                par1World.setBlockToAir(par2, par3, par4);
            }
        }
    }




}

 

 

 

 

 

Any help please?

 

If you need any extra code don't be afraid to ask :)

STOP CRUCIFYING NEW MODDERS!!!!

Posted

Hey guys,

As the title says I am making a Dimension for the first time

 

I have an issue with teleporting

 

I have an error on this piece of code in my TeleporterParallelWorlds clas

new PortalPosition(this, i, j, k, this.worldServerInstance.getTotalWorldTime()));

 

This is my main:

package assassinhero.parallelworlds;

import assassinhero.parallelworlds.client.ParallelWorldsClientPacketHandler;
import assassinhero.parallelworlds.common.ParallelWorldsCommonProxy;
import assassinhero.parallelworlds.common.ParallelWorldsServerPacketHandler;
import assassinhero.parallelworlds.common.WorldGenerator;
import assassinhero.parallelworlds.common.blocks.BlockArcticiteBlock;
import assassinhero.parallelworlds.common.blocks.BlockAscariteBlock;
import assassinhero.parallelworlds.common.blocks.BlockHeavenlyOre;
import assassinhero.parallelworlds.common.blocks.BlockHellOre;
import assassinhero.parallelworlds.common.blocks.BlockHelliteBlock;
import assassinhero.parallelworlds.common.blocks.BlockNightOre;
import assassinhero.parallelworlds.common.blocks.BlockNightStoneBlock;
import assassinhero.parallelworlds.common.blocks.BlockPortalArcitcite;
import assassinhero.parallelworlds.common.blocks.BlockTimeOre;
import assassinhero.parallelworlds.common.blocks.BlockTimeStoneBlock;
import assassinhero.parallelworlds.common.items.ItemCookedLambChopFood;
import assassinhero.parallelworlds.common.items.ItemDemonicBoots;
import assassinhero.parallelworlds.common.items.ItemDemonicChestplate;
import assassinhero.parallelworlds.common.items.ItemDemonicHelmet;
import assassinhero.parallelworlds.common.items.ItemDemonicLeggings;
import assassinhero.parallelworlds.common.items.ItemDemonicPickaxe;
import assassinhero.parallelworlds.common.items.ItemDemonicShovel;
import assassinhero.parallelworlds.common.items.ItemDemonicSword;
import assassinhero.parallelworlds.common.items.ItemDevilStoneItem;
import assassinhero.parallelworlds.common.items.ItemEnderIngotItem;
import assassinhero.parallelworlds.common.items.ItemEnderShardItem;
import assassinhero.parallelworlds.common.items.ItemHeavenlyIngotItem;
import assassinhero.parallelworlds.common.items.ItemHeavenlyPickaxe;
import assassinhero.parallelworlds.common.items.ItemHellShardItem;
import assassinhero.parallelworlds.common.items.ItemIceShardItem;
import assassinhero.parallelworlds.common.items.ItemIceStoneItem;
import assassinhero.parallelworlds.common.items.ItemMutatedAppleFood;
import assassinhero.parallelworlds.common.items.ItemNightGemItem;
import assassinhero.parallelworlds.common.items.ItemRawLambChopFood;
import assassinhero.parallelworlds.common.items.ItemSapphireAxe;
import assassinhero.parallelworlds.common.items.ItemSapphireItem;
import assassinhero.parallelworlds.common.items.ItemSapphirePickaxe;
import assassinhero.parallelworlds.common.items.ItemSapphireSword;
import assassinhero.parallelworlds.common.items.ItemTimeAxe;
import assassinhero.parallelworlds.common.items.ItemTimeGemItem;
import assassinhero.parallelworlds.common.items.ItemTimePickaxe;
import assassinhero.parallelworlds.common.items.ItemTimeShovel;
import assassinhero.parallelworlds.common.items.ItemTimeSword;
import net.minecraft.block.Block;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;

@NetworkMod(clientSideRequired=true, serverSideRequired= true,
clientPacketHandlerSpec = @cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler(channels = {"ParallelWorlds"} , packetHandler = ParallelWorldsClientPacketHandler.class),
serverPacketHandlerSpec = @cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler(channels = {"ParallelWorlds"} , packetHandler = ParallelWorldsServerPacketHandler.class))

@Mod(modid="Parallel Worlds", name = "ParallelWorlds",version = "1.0.0")


public class ParallelWorlds {

@cpw.mods.fml.common.Mod.Instance("ParallelWorlds")
public static ParallelWorlds Instance = new ParallelWorlds();

@SidedProxy(clientSide = "assassinhero.parallelworlds.client.ParallelWorldsClientProxy", serverSide = "assassinhero.parallelworlds.common.ParallelWorldsCommonProxy")
public static ParallelWorldsCommonProxy proxy;


public static Block Portal;
public static Item EnderIngot;
public static Item DemonicHelmet;
public static Item DemonicChestplate;
public static Item DemonicLeggings;
public static Item DemonicBoots;
public static Item MutatedApple;
public static Item CookedLambChop;
public static Item RawLambChop;
public static Item DemonicShovel;
public static Item DemonicPickaxe;
public static Item DevilStone;
public static Item DemonicSword;
public static Block HellOre;
public static Item HellShard;
public static Item EnderShard;
public static Item SapphireAxe;
public static Item SapphireSword;
public static Item IceStone;
public static Item IceShard;
public static Item HeavenlyPickaxe;
public static Item SapphirePickaxe;
public static Item Sapphire;
public static Item TimePickaxe;
public static Item TimeShovel;
public static Item TimeAxe;
public static Item TimeSword;
public static Block TimeOre;
public static Item AscariteHelmet;
public static Item AscariteChestplate;
public static Item AscariteLeggings;
public static Item AscariteBoots;
public static Block HeavenlyOre;
public static Item HeavenlyIngot;
public static Block Ascarite;
public static Block Hellite;
public static Block Arcticite;
public static Block NightOre;
public static Item TimeGem;
public static Block TimeStone;
public static Block NightStone;
public static Item NightGem;
@cpw.mods.fml.common.Mod.PreInit
public void PreInit(FMLPreInitializationEvent event){
	NightOre = new BlockNightOre(3657).setUnlocalizedName("Night Ore");
	NightStone = new BlockNightStoneBlock(3658).setUnlocalizedName("Night Stone");
	TimeStone = new BlockTimeStoneBlock(3659).setUnlocalizedName("Time Stone");
	Arcticite = new BlockArcticiteBlock(3660).setUnlocalizedName("Arcticite");
	Hellite = new BlockHelliteBlock(3661).setUnlocalizedName("Hellite");
	Ascarite = new BlockAscariteBlock(3662).setUnlocalizedName("Ascarite");
	HeavenlyOre = new BlockHeavenlyOre(3663).setUnlocalizedName("Heavenly Ore");
	TimeOre = new BlockTimeOre(3664).setUnlocalizedName("Time Ore");
	HellOre = new BlockHellOre(3665).setUnlocalizedName("Hell Ore");
	TimeSword = new ItemTimeSword(8000, EnumToolMaterial.TIME).setUnlocalizedName("Time Sword");
	TimePickaxe = new ItemTimePickaxe(8001, EnumToolMaterial.TIME).setUnlocalizedName("Time Pickaxe");
	TimeAxe = new ItemTimeAxe(8002, EnumToolMaterial.TIME).setUnlocalizedName("Time Axe");
	TimeShovel = new ItemTimeShovel(8003, EnumToolMaterial.TIME).setUnlocalizedName("Time Shovel");
	SapphirePickaxe = new ItemSapphirePickaxe(8004, EnumToolMaterial.SAPPHIRE).setUnlocalizedName("Sapphire Pickaxe");
	SapphireSword = new ItemSapphireSword(8005, EnumToolMaterial.SAPPHIRE).setUnlocalizedName("Sapphire Sword");
	SapphireAxe = new ItemSapphireAxe(8006, EnumToolMaterial.SAPPHIRE).setUnlocalizedName("Sapphire Axe");
	HeavenlyPickaxe = new ItemHeavenlyPickaxe(8009, EnumToolMaterial.HEAVENLY).setUnlocalizedName("Heavenly Pickaxe");
	DemonicSword = new ItemDemonicSword(8012, EnumToolMaterial.DEMONIC).setUnlocalizedName("Demonic Sword");
	DemonicPickaxe = new ItemDemonicPickaxe(8013, EnumToolMaterial.DEMONIC).setUnlocalizedName("Demonic Pickaxe");
	DemonicShovel = new ItemDemonicShovel(8014, EnumToolMaterial.DEMONIC).setUnlocalizedName("Demonic Shovel");
	NightGem = new ItemNightGemItem(5000).setUnlocalizedName("Night Gem");
	TimeGem = new ItemTimeGemItem(5001).setUnlocalizedName("Time Gem");
	HeavenlyIngot = new ItemHeavenlyIngotItem(5002).setUnlocalizedName("Heavenly Ingot");
	Sapphire = new ItemSapphireItem(5003).setUnlocalizedName("Sapphire");
	IceShard = new ItemIceShardItem(5004).setUnlocalizedName("Ice Shard");
	IceStone = new ItemIceStoneItem(5005).setUnlocalizedName("Ice Stone");
	EnderShard = new ItemEnderShardItem(5006).setUnlocalizedName("Ender Shard");
	HellShard = new ItemHellShardItem(5007).setUnlocalizedName("Hell Shard");
	DevilStone = new ItemDevilStoneItem(5008).setUnlocalizedName("Devil Stone");
	RawLambChop = new ItemRawLambChopFood(5009, 4, 4.0F, true).setUnlocalizedName("Raw Lamb Chop");
	CookedLambChop = new ItemCookedLambChopFood(5010, 8, 4.0F, true).setUnlocalizedName("Cooked Lamb Chop");
	MutatedApple = new ItemMutatedAppleFood(5011, 5, 2.0F, false).setUnlocalizedName("Mutated Apple");
	EnderIngot = new ItemEnderIngotItem(5012).setUnlocalizedName("Ender Ingot");
	DemonicHelmet = new ItemDemonicHelmet(20000, EnumArmorMaterial.DEMONIC, 8, 0).setUnlocalizedName("Demonic Helmet");
	DemonicChestplate = new ItemDemonicChestplate(20001, EnumArmorMaterial.DEMONIC, 8, 1).setUnlocalizedName("Demonic Chestplate");
	DemonicLeggings = new ItemDemonicLeggings(20002, EnumArmorMaterial.DEMONIC, 7, 2).setUnlocalizedName("Demonic Leggings");
	DemonicBoots = new ItemDemonicBoots(20003, EnumArmorMaterial.DEMONIC, 7, 3).setUnlocalizedName("Demonic Boots");
	Portal = new BlockPortalArcitcite(1000).setUnlocalizedName("Portal");




}

@Init
public void InitParallelWorlds(FMLInitializationEvent event){
	NetworkRegistry.instance().registerGuiHandler(this, proxy);
	proxy.registerBlocks();
	proxy.registerItems();
	craftingRecipes();
	EnumToolMaterial();
	EnumArmorMaterial();
	GameRegistry.registerWorldGenerator(new WorldGenerator());
	smeltingRecipes();
	MinecraftForge.EVENT_BUS.register(new ParallelWorldsSheepDropsEvent());
	DimensionManager();

}

public void craftingRecipes(){
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.NightStone, 1), "XX", "XX", Character.valueOf('X'), ParallelWorlds.NightGem);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimeStone, 1 ), "XX", "XX", Character.valueOf('X'), ParallelWorlds.TimeGem); 
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.Arcticite, 1), "XX", "XX", Character.valueOf('X'), Block.blockSnow);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.Ascarite, 1), "XX", "XX", Character.valueOf('X'), ParallelWorlds.HeavenlyIngot);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimePickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorlds.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimeSword, 1), " X ", " X ", " A ", Character.valueOf('X'), ParallelWorlds.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.SapphirePickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorlds.Sapphire, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimeAxe, 1), "XX ", "XA ", " A ", Character.valueOf('X'), ParallelWorlds.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.HeavenlyPickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorlds.HeavenlyIngot, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.IceStone, 1), "XXX", "XXX", "XXX", Character.valueOf('X'), ParallelWorlds.IceShard);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.TimeShovel, 1), " X ", " A ", " A ", Character.valueOf('X'), ParallelWorlds.TimeGem, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.SapphireSword, 1), " X ", " X ", " A ", Character.valueOf('X'), ParallelWorlds.Sapphire, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.SapphireAxe, 1), "XX ", "XA ", " A ", Character.valueOf('X'), ParallelWorlds.Sapphire, Character.valueOf('A'), Item.stick);
	GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicSword,1), " X ", " X ", " A ", Character.valueOf('X'), ParallelWorlds.DevilStone, Character.valueOf('A'), Item.blazeRod);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.Hellite,1), "XXX", "XXX", "XXX", Character.valueOf('X'), ParallelWorlds.HellShard);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicPickaxe, 1), "XXX", " A ", " A ", Character.valueOf('X'), ParallelWorlds.DevilStone, Character.valueOf('A'), Item.blazeRod);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicHelmet, 1), "   ", "XXX", "X X", Character.valueOf('X'), ParallelWorlds.DevilStone);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicChestplate, 1), "X X", "XXX", "XXX", Character.valueOf('X'), ParallelWorlds.DevilStone);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicLeggings, 1), "XXX", "X X", "X X", Character.valueOf('X'), ParallelWorlds.DevilStone);
    GameRegistry.addRecipe(new ItemStack(ParallelWorlds.DemonicBoots, 1), "   ", "X X", "X X", Character.valueOf('X'), ParallelWorlds.DevilStone);

}


public static void EnumToolMaterial(){
	EnumToolMaterial toolTime = EnumHelper.addToolMaterial("Time", 3, 2000, 10.F, 5, 20);
	EnumToolMaterial toolSapphire = EnumHelper.addToolMaterial("Sapphire", 3, 1500, 9.0F, 10, 10);
	EnumToolMaterial toolHeavenly = EnumHelper.addToolMaterial("Heavenly", 2, 300, 5.0F, 15, 5);
	EnumToolMaterial toolDemonic = EnumHelper.addToolMaterial("Demonic", 3, 0, 15.0F, 20, 30);
	EnumToolMaterial toolEnder = EnumHelper.addToolMaterial("ENDER", 3, 0, 15.0F, 15, 25);


}

public static void EnumArmorMaterial(){
	EnumArmorMaterial armorDemonic = EnumHelper.addArmorMaterial("DEMONIC", 0, new int[]{3, 8, 6, 3}, 20);
}

public void smeltingRecipes(){
	GameRegistry.addSmelting(HeavenlyOre.blockID, new ItemStack(HeavenlyIngot, 1), 0.7F);
	GameRegistry.addSmelting(RawLambChop.itemID, new ItemStack(CookedLambChop, 1), 0.3F);
}




public static int dimension;

public void DimensionManager(){
	DimensionManager.registerProviderType(dimension, WorldProviderArcticite.class, false);
	DimensionManager.registerDimension(dimension, dimension);
}


}








 

This is my portal block class and I have an error under transferPlayerToDimension here:

package assassinhero.parallelworlds.common.blocks;

import java.util.Random;

import assassinhero.parallelworlds.ParallelWorlds;

import net.minecraft.block.Block;
import net.minecraft.block.BlockPortal;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World;

public class BlockPortalArcitcite extends BlockPortal{

public BlockPortalArcitcite(int par1) {
	super(par1);
	setCreativeTab(CreativeTabs.tabBlock);


}

public void registerIcons(IconRegister par1iconregister){
	this.blockIcon = par1iconregister.registerIcon("Portal");
}


 public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
        super.updateTick(par1World, par2, par3, par4, par5Random);



}

 public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
    {
        byte b0 = 0;
        byte b1 = 0;

        if (par1World.getBlockId(par2 - 1, par3, par4) == ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 + 1, par3, par4) == ParallelWorlds.Arcticite.blockID)
        {
            b0 = 1;
        }

        if (par1World.getBlockId(par2, par3, par4 - 1) == ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2, par3, par4 + 1) == ParallelWorlds.Arcticite.blockID)
        {
            b1 = 1;
        }

        if (b0 == b1)
        {
            return false;
        }
        else
        {
            if (par1World.getBlockId(par2 - b0, par3, par4 - b1) == 0)
            {
                par2 -= b0;
                par4 -= b1;
            }

            int l;
            int i1;

            for (l = -1; l <= 2; ++l)
            {
                for (i1 = -1; i1 <= 3; ++i1)
                {
                    boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;

                    if (l != -1 && l != 2 || i1 != -1 && i1 != 3)
                    {
                        int j1 = par1World.getBlockId(par2 + b0 * l, par3 + i1, par4 + b1 * l);

                        if (flag)
                        {
                            if (j1 != ParallelWorlds.Arcticite.blockID)
                            {
                                return false;
                            }
                        }
                        else if (j1 != 0 && j1 != Block.fire.blockID)
                        {
                            return false;
                        }
                    }
                }
            }

            for (l = 0; l < 2; ++l)
            {
                for (i1 = 0; i1 < 3; ++i1)
                {
                    par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, ParallelWorlds.Portal.blockID, 0, 2);
                }
            }

            return true;
        }
        
        
     
    }

 public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity){
    
        if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null){
        	if(par5Entity instanceof EntityPlayerMP){
        		EntityPlayerMP EntityPlayer = (EntityPlayerMP) par5Entity;
        		if(par5Entity.dimension != ParallelWorlds.dimension){
        			
        			EntityPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(EntityPlayer, ParallelWorlds.dimension, new TeleporterParallelWorlds(EntityPlayer.mcServer.worldServerForDimension(ParallelWorlds.dimension)));
        			
        		}
        		
        		else{
        			
        			EntityPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(EntityPlayer, ParallelWorlds.dimension, new TeleporterParalelWorlds(EntityPlayer.mcServer.worldServerForDimension(0)));
        			
        		}
        	}
       
    }
 }


    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        byte b0 = 0;
        byte b1 = 1;

        if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID)
        {
            b0 = 1;
            b1 = 0;
        }

        int i1;

        for (i1 = par3; par1World.getBlockId(par2, i1 - 1, par4) == this.blockID; --i1)
        {
            ;
        }

        if (par1World.getBlockId(par2, i1 - 1, par4) != ParallelWorlds.Arcticite.blockID)
        {
            par1World.setBlockToAir(par2, par3, par4);
        }
        else
        {
            int j1;

            for (j1 = 1; j1 < 4 && par1World.getBlockId(par2, i1 + j1, par4) == this.blockID; ++j1)
            {
                ;
            }

            if (j1 == 3 && par1World.getBlockId(par2, i1 + j1, par4) == ParallelWorlds.Arcticite.blockID)
            {
                boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID;
                boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == this.blockID || par1World.getBlockId(par2, par3, par4 + 1) == this.blockID;

                if (flag && flag1)
                {
                    par1World.setBlockToAir(par2, par3, par4);
                }
                else
                {
                    if ((par1World.getBlockId(par2 + b0, par3, par4 + b1) != ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 - b0, par3, par4 - b1) != this.blockID) && (par1World.getBlockId(par2 - b0, par3, par4 - b1) != ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 + b0, par3, par4 + b1) != this.blockID))
                    {
                        par1World.setBlockToAir(par2, par3, par4);
                    }
                }
            }
            else
            {
                par1World.setBlockToAir(par2, par3, par4);
            }
        }
    }




}

 

Lastly, this is my TeleporterParallelWorlds class:

 

package assassinhero.parallelworlds.common.blocks;

import java.util.Random;

import assassinhero.parallelworlds.ParallelWorlds;

import net.minecraft.block.Block;
import net.minecraft.block.BlockPortal;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World;

public class BlockPortalArcitcite extends BlockPortal{

public BlockPortalArcitcite(int par1) {
	super(par1);
	setCreativeTab(CreativeTabs.tabBlock);


}

public void registerIcons(IconRegister par1iconregister){
	this.blockIcon = par1iconregister.registerIcon("Portal");
}


 public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
        super.updateTick(par1World, par2, par3, par4, par5Random);



}

 public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
    {
        byte b0 = 0;
        byte b1 = 0;

        if (par1World.getBlockId(par2 - 1, par3, par4) == ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 + 1, par3, par4) == ParallelWorlds.Arcticite.blockID)
        {
            b0 = 1;
        }

        if (par1World.getBlockId(par2, par3, par4 - 1) == ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2, par3, par4 + 1) == ParallelWorlds.Arcticite.blockID)
        {
            b1 = 1;
        }

        if (b0 == b1)
        {
            return false;
        }
        else
        {
            if (par1World.getBlockId(par2 - b0, par3, par4 - b1) == 0)
            {
                par2 -= b0;
                par4 -= b1;
            }

            int l;
            int i1;

            for (l = -1; l <= 2; ++l)
            {
                for (i1 = -1; i1 <= 3; ++i1)
                {
                    boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;

                    if (l != -1 && l != 2 || i1 != -1 && i1 != 3)
                    {
                        int j1 = par1World.getBlockId(par2 + b0 * l, par3 + i1, par4 + b1 * l);

                        if (flag)
                        {
                            if (j1 != ParallelWorlds.Arcticite.blockID)
                            {
                                return false;
                            }
                        }
                        else if (j1 != 0 && j1 != Block.fire.blockID)
                        {
                            return false;
                        }
                    }
                }
            }

            for (l = 0; l < 2; ++l)
            {
                for (i1 = 0; i1 < 3; ++i1)
                {
                    par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, ParallelWorlds.Portal.blockID, 0, 2);
                }
            }

            return true;
        }
        
        
     
    }

 public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity){
    
        if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null){
        	if(par5Entity instanceof EntityPlayerMP){
        		EntityPlayerMP EntityPlayer = (EntityPlayerMP) par5Entity;
        		if(par5Entity.dimension != ParallelWorlds.dimension){
        			
        			EntityPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(EntityPlayer, ParallelWorlds.dimension, new TeleporterParallelWorlds(EntityPlayer.mcServer.worldServerForDimension(ParallelWorlds.dimension)));
        			
        		}
        		
        		else{
        			
        			EntityPlayer.mcServer.getConfigurationManager().transferPlayerToDimension(EntityPlayer, ParallelWorlds.dimension, new TeleporterParalelWorlds(EntityPlayer.mcServer.worldServerForDimension(0)));
        			
        		}
        	}
       
    }
 }


    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        byte b0 = 0;
        byte b1 = 1;

        if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID)
        {
            b0 = 1;
            b1 = 0;
        }

        int i1;

        for (i1 = par3; par1World.getBlockId(par2, i1 - 1, par4) == this.blockID; --i1)
        {
            ;
        }

        if (par1World.getBlockId(par2, i1 - 1, par4) != ParallelWorlds.Arcticite.blockID)
        {
            par1World.setBlockToAir(par2, par3, par4);
        }
        else
        {
            int j1;

            for (j1 = 1; j1 < 4 && par1World.getBlockId(par2, i1 + j1, par4) == this.blockID; ++j1)
            {
                ;
            }

            if (j1 == 3 && par1World.getBlockId(par2, i1 + j1, par4) == ParallelWorlds.Arcticite.blockID)
            {
                boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID;
                boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == this.blockID || par1World.getBlockId(par2, par3, par4 + 1) == this.blockID;

                if (flag && flag1)
                {
                    par1World.setBlockToAir(par2, par3, par4);
                }
                else
                {
                    if ((par1World.getBlockId(par2 + b0, par3, par4 + b1) != ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 - b0, par3, par4 - b1) != this.blockID) && (par1World.getBlockId(par2 - b0, par3, par4 - b1) != ParallelWorlds.Arcticite.blockID || par1World.getBlockId(par2 + b0, par3, par4 + b1) != this.blockID))
                    {
                        par1World.setBlockToAir(par2, par3, par4);
                    }
                }
            }
            else
            {
                par1World.setBlockToAir(par2, par3, par4);
            }
        }
    }




}

 

 

 

 

 

Any help please?

 

If you need any extra code don't be afraid to ask :)

STOP CRUCIFYING NEW MODDERS!!!!

Posted

I have an error on this piece of code in my TeleporterParallelWorlds clas

new PortalPosition(this, i, j, k, this.worldServerInstance.getTotalWorldTime()));

 

The reason none has responded to this would be that from the look of it there's impossible to guess what's wrong.

You say there is an error, but nothing about what error?

I assume by error you mean eclipse marks the line or a word red?

 

If so you should tell me what it's saying when you mouse over the underlined area, what is the error it's giving and what quick fixes is it giving ya?

If you look at the bottom of your eclipse window you should see the markers tab, where you can click on the error and copy paste it easily.

 

Letting us know what error you are having will help out a lot when it comes to solving your problem <3

 

 

If you guys dont get it.. then well ya.. try harder...

Posted

I have an error on this piece of code in my TeleporterParallelWorlds clas

new PortalPosition(this, i, j, k, this.worldServerInstance.getTotalWorldTime()));

 

The reason none has responded to this would be that from the look of it there's impossible to guess what's wrong.

You say there is an error, but nothing about what error?

I assume by error you mean eclipse marks the line or a word red?

 

If so you should tell me what it's saying when you mouse over the underlined area, what is the error it's giving and what quick fixes is it giving ya?

If you look at the bottom of your eclipse window you should see the markers tab, where you can click on the error and copy paste it easily.

 

Letting us know what error you are having will help out a lot when it comes to solving your problem <3

 

 

If you guys dont get it.. then well ya.. try harder...

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.