when i add the constructor "call this();" when i put it in there it has an error saying
Multiple markers at this line
- Syntax error, insert "AssignmentOperator Expression" to complete Assignment
- call cannot be resolved to a variable
- Syntax error, insert ";" to complete BlockStatements
- Constructor call must be the first statement in a constructor
package net.minecraft.src;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_Crystrum extends BaseMod
{
public static final BlockVerticalPortal portal = (BlockVerticalPortal)new BlockVerticalPortal(241, ModLoader.addOverride("/terrain.png", "/mods/portal.png")).setParameters(10).setLightValue(2.5F).setBlockName("portal");
public static final BiomeGenBase sea = new BiomeGenSea(40).setBiomeName("Sea");
public static final BiomeGenBase terrain = new BiomeGenTerrain(41).setBiomeName("Terrain");
public static final DimAPIBase dim = new DimAPIBase(10, "Example", new WorldProviderDim()).setBlocks(22, 241, 240);
public static final Block starter = new BlockPortalStarter(240, 1).setBlockName("starter");
public mod_Crystrum()
{
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}
@Override
public void load()
{
ModLoader.addRecipe(new ItemStack(mod_Crystrum.portal, 1), new Object[]{
"X", Character.valueOf('X'), Block.dirt
});
ModLoader.setInGameHook(this, true, false);
ModLoader.registerBlock(portal);
ModLoader.addName(portal, "Example Portal");
ModLoader.registerBlock(starter);
ModLoader.addName(starter, "Starter Block");
ModLoader.addRecipe(new ItemStack(mod_Crystrum.starter, 1), new Object[]{
"XX", Character.valueOf('X'), Block.dirt
});
this();
}
public boolean onTickInGame(float f, Minecraft minecraft)
{
dim.mainPortalLoop();
return true;
}
}
and here is the error i still have
Constructor call must be the first statement in a constructor
i deleted the this(); so i make the frame out of lapis lazuli 4x5 and then i get the starter block in my hand i right click on the inside of the lapis frame and it places the block on the inside it doesnt start the portal am i supposed to do something else with the starter or is my code wrong or what
would I put a number such as 7, and if so what is the number range I can use?
or would it be TimeTravel since my mod_ file is mod_TimeTravel?
EDIT
OK all my code works and above I just put 1.. Still please answer that but now I still dont know how to craft my portal because the vertical portal thing I put in my mod_ file doesn't make a new block or anything...
would I put a number such as 7, and if so what is the number range I can use?
or would it be TimeTravel since my mod_ file is mod_TimeTravel?
EDIT
OK all my code works and above I just put 1.. Still please answer that but now I still dont know how to craft my portal because the vertical portal thing I put in my mod_ file doesn't make a new block or anything...
Can I see your mod_TimeTravel file? I'll try to help you.
i deleted the this(); so i make the frame out of lapis lazuli 4x5 and then i get the starter block in my hand i right click on the inside of the lapis frame and it places the block on the inside it doesnt start the portal am i supposed to do something else with the starter or is my code wrong or what
i deleted the this(); so i make the frame out of lapis lazuli 4x5 and then i get the starter block in my hand i right click on the inside of the lapis frame and it places the block on the inside it doesnt start the portal am i supposed to do something else with the starter or is my code wrong or what
You onle need to place init code of starter block directly under sea biome init code; I've tried to do this and all worked fine.
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT cc98e0ed --------
Generated 15.04.12 18:18
Minecraft: Minecraft 1.2.4
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Mobility Radeon HD 3650 version 3.3.10750 Compatibility Profile Context, ATI Technologies Inc.
java.lang.RuntimeException: java.lang.NullPointerException: Cannot find dimension with ID 10
at net.minecraft.src.BlockVerticalPortal.onEntityCollidedWithBlock(BlockVerticalPortal.java:244)
at net.minecraft.src.Entity.moveEntity(Entity.java:816)
at net.minecraft.src.EntityPlayerSP.moveEntity(EntityPlayerSP.java:46)
at net.minecraft.src.EntityLiving.moveEntityWithHeading(EntityLiving.java:1291)
at net.minecraft.src.EntityPlayer.moveEntityWithHeading(EntityPlayer.java:1528)
at net.minecraft.src.EntityLiving.onLivingUpdate(EntityLiving.java:1528)
at net.minecraft.src.EntityPlayer.onLivingUpdate(EntityPlayer.java:498)
at net.minecraft.src.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:255)
at net.minecraft.src.EntityLiving.onUpdate(EntityLiving.java:644)
at net.minecraft.src.EntityPlayer.onUpdate(EntityPlayer.java:261)
at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:2164)
at net.minecraft.src.World.updateEntity(World.java:2135)
at net.minecraft.src.World.updateEntities(World.java:2021)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1884)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:842)
at net.minecraft.client.Minecraft.run(Minecraft.java:747)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException: Cannot find dimension with ID 10
... 17 more
--- END ERROR REPORT a1f76d24 ----------
This is my mod:
package net.minecraft.src;
public class mod_ExtraOres extends BaseMod
{
public static final BlockVerticalPortal portal = (BlockVerticalPortal) new BlockVerticalPortal(235, 0).setParameters(10).setBlockName("portal");
public static final Block starter = new BlockPortalStarter(236, 0).setBlockName("starter");
public static final BiomeGenBase sea = new BiomeGenSea(20).setBiomeName("Sea");
public static final BiomeGenBase terrain = new BiomeGenTerrain(21).setBiomeName("Terrain");
public mod_ExtraOres()
{
ModLoader.registerBlock(portal);
ModLoader.addName(portal, "Portal to Ore World");
portal.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/ores/portal.png");
//BUG TESTING
ModLoader.addRecipe(new ItemStack(mod_ExtraOres.portal, 10), new Object[]{"X ", Character.valueOf('X'), Block.dirt});
ModLoader.addRecipe(new ItemStack(mod_ExtraOres.starter, 10), new Object[]{"XX", Character.valueOf('X'), Block.dirt});
ModLoader.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[]{"XX", "XX", Character.valueOf('X'), Block.dirt});
}
public String getVersion(){
return "1.2.4";
}
public void load()
{
ModLoader.registerBlock(portal);
ModLoader.addName(portal, "Portal to Ore World");
portal.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/ores/portal.png");
ModLoader.registerBlock(starter);
ModLoader.addName(starter, "Starter of the Ore World");
starter.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/ores/starter.png");
}
}
And this is my WorldProviderDim:
package net.minecraft.src;
import java.util.*;
public class WorldProviderDim extends WorldProvider
{
public void registerWorldChunkManager()
{
BiomeGenBase[] b = new BiomeGenBase[]{mod_ExtraOres.sea, mod_ExtraOres.terrain};//Array of biomes that you can meet in this dimension
this.worldChunkMgr = new WorldChunkManagerDimAPI(this.worldObj, B);
this.hasNoSky = true;
this.worldType = 10;
}
public IChunkProvider getChunkProvider()
{
return new ChunkProviderHell(this.worldObj, this.worldObj.getSeed());
} public Vec3D getFogColor(float var1, float var2)
{
return Vec3D.createVector(0.2D, 0.0D, 0.2D);//Sky color (red, green, blue)
}
public boolean canCoordinateBeSpawn(int var1, int var2)
{
int var3 = this.worldObj.getFirstUncoveredBlock(var1, var2);
return var3 == 0 ? false : Block.blocksList[var3].blockMaterial.isSolid();
} public boolean func_48217_e()
{
return false;
}
public boolean canRespawnHere()
{
return true;
} public boolean func_48218_b(int par1, int par2)
{
return true;
}
}
Can You help me?
To solve this you only need to register your dimension through mod_ExtraOres file.
Your API automatically adds a lot of .java files into the game, but I dont know how to make it so my custom block will be the portal outline and my custom item will be the starter... Thanks
When right click in the frame of lapis it doesnt turn on the portal but then i craft the portal and place it it doesnt do the message and stuff and it says taking me to null and not to the world i told it too but when i do enter null it creates the lapis portal frame with the portals inside so how do i get the starter block to turn on the portal frame here is my mod_crystrum file
here is my mod_crystrum :
package net.minecraft.src;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_Crystrum extends BaseMod
{
public static final BlockVerticalPortal portal = (BlockVerticalPortal)new BlockVerticalPortal(241, ModLoader.addOverride("/terrain.png", "/mods/portal.png")).setParameters(10).setLightValue(2.5F).setBlockName("portal");
public static final BiomeGenBase sea = new BiomeGenSea(40).setBiomeName("Sea");
public static final BiomeGenBase terrain = new BiomeGenTerrain(41).setBiomeName("Terrain");
public static final DimAPIBase dim = new DimAPIBase(10, "Example", new WorldProviderDim()).setBlocks(22, 241, 240);
public static final Block starter = new BlockPortalStarter(240, 1).setBlockName("starter");
public mod_Crystrum()
{
ModLoader.addRecipe(new ItemStack(mod_Crystrum.portal, 1), new Object[]{
"X", Character.valueOf('X'), Block.dirt
});
ModLoader.registerBlock(portal);
ModLoader.addName(portal, "Example Portal");
ModLoader.addRecipe(new ItemStack(mod_Crystrum.starter, 1), new Object[]{
"XX", Character.valueOf('X'), Block.dirt
});
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}
@Override
public void load()
{
ModLoader.addRecipe(new ItemStack(mod_Crystrum.portal, 1), new Object[]{
"X", Character.valueOf('X'), Block.dirt
});
ModLoader.setInGameHook(this, true, false);
ModLoader.registerBlock(portal);
ModLoader.addName(portal, "Example Portal");
ModLoader.registerBlock(starter);
ModLoader.addName(starter, "Starter Block");
ModLoader.addRecipe(new ItemStack(mod_Crystrum.starter, 1), new Object[]{
"XX", Character.valueOf('X'), Block.dirt
});
}
public boolean onTickInGame(float f, Minecraft minecraft)
{
dim.mainPortalLoop();
return true;
}
}
instead of this:
it says
and here is the error i still have
would I put a number such as 7, and if so what is the number range I can use?
or would it be TimeTravel since my mod_ file is mod_TimeTravel?
EDIT
OK all my code works and above I just put 1.. Still please answer that but now I still dont know how to craft my portal because the vertical portal thing I put in my mod_ file doesn't make a new block or anything...
Can I see your mod_TimeTravel file? I'll try to help you.
You may use 256 dimension IDs. Maybe I'll expand this to 4096.
You onle need to place init code of starter block directly under sea biome init code; I've tried to do this and all worked fine.
To solve this you only need to register your dimension through mod_ExtraOres file.
First of all im kind of new so i dont really know what that means can u like copy and past the edited part of my code in the forums and ill put it in
here is my mod_crystrum :