I've now updated the API to 1.2.4; the Forge patch and updated sample dimension should come within the next day or so. I'm hoping to add more to the sample dimension to explain the newer features of the API more thoroughly.
Awesome!
Pudlehund... i'm have another Problem... When I'm Spawn in One Biome. the Decorator Block of this Biome, Will work in all Biomes... I'm dont Know to solve this... So You can help me?
I have anothers Problems... My Biomes, not Spawn in Dimension... I'm only put for Spawn two Biomes... Those Biomes, not spawn... Whats is wrong? And Now Have a Crasher...
Understood. But I thinking about to Add around 4 Biomes...
And for Me change the Cave generator, I need create another class with Cave Generator(MapGenCaves)? I thinking about to remove Dirt, Grass, Stones, sand, sandstone... And Change for My Blocks... have a Way to do this in all world??
Firtsly, Thank You for the Excelent API, is Amazing.
Second, I think all is right, but My Portal not Work...
Do You can help me with this? The Game Start Normally, The problem is with the Portal, Not ignite.
In My Mod:
//Dimension
public mod_moonbase() {
DimensionAPI.registerDimension(new WorldProviderBlueAsteroid()); }
In WorldGen:
package net.minecraft.src;
public class WorldProviderBlueAsteroid extends WorldProviderBase
{
public int getDimensionID()
{
return 3;
}
public boolean renderClouds()
{
return false;
}
public boolean renderVoidFog()
{
return true;
}
public float setSunSize()
{
return 3.5F;
}
public float setMoonSize()
{
return 0.5F;
}
public boolean renderStars()
{
return true;
}
public boolean darkenSkyDuringRain()
{
return false;
}
public String getRespawnMessage()
{
return "Welcome to Moon!.";
}
public void registerWorldChunkManager()
{
worldChunkMgr = new WorldChunkManagerBlueAsteroid(worldObj);
}
public IChunkProvider getChunkProvider()
{
return new ChunkProviderBlueAsteroid(worldObj, worldObj.getSeed(), hasNoSky);
}
}
In Chunk Manager:
package net.minecraft.src;
import java.util.*;
public class WorldChunkManagerBlueAsteroid extends WorldChunkManager
{
private GenLayer genBiomes;
/** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
private GenLayer biomeIndexLayer;
/** The BiomeCache object for this world. */
private BiomeCache biomeCache;
/** A list of biomes that the player can spawn in. */
private List biomesToSpawnIn;
protected WorldChunkManagerBlueAsteroid()
{
biomeCache = new BiomeCache(this);
biomesToSpawnIn = new ArrayList();
biomesToSpawnIn.add(BiomeGenBase.BlueAsteroid);
}
public WorldChunkManagerBlueAsteroid(long par1, WorldType par3WorldType)
{
this();
GenLayer agenlayer[] = GenLayer.func_48425_a(par1, par3WorldType);
genBiomes = agenlayer[0];
biomeIndexLayer = agenlayer[1];
}
public WorldChunkManagerBlueAsteroid(World par1World)
{
this(par1World.getSeed(), par1World.getWorldInfo().getTerrainType());
}
/**
* Gets the list of valid biomes for the player to spawn in.
*/
public List getBiomesToSpawnIn()
{
return biomesToSpawnIn;
}
/**
* Returns the BiomeGenBase related to the x, z position on the world.
*/
public BiomeGenBase getBiomeGenAt(int par1, int par2)
{
return biomeCache.getBiomeGenAt(par1, par2);
}
/**
* Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.
*/
public float[] getRainfall(float par1ArrayOfFloat[], int par2, int par3, int par4, int par5)
{
IntCache.resetIntCache();
if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
{
par1ArrayOfFloat = new float[par4 * par5];
}
int ai[] = biomeIndexLayer.getInts(par2, par3, par4, par5);
for (int i = 0; i < par4 * par5; i++)
{
float f = (float)BiomeGenBase.biomeList[ai[i]].getIntRainfall() / 65536F;
if (f > 1.0F)
{
f = 1.0F;
}
par1ArrayOfFloat[i] = f;
}
return par1ArrayOfFloat;
}
/**
* Return an adjusted version of a given temperature based on the y height
*/
public float getTemperatureAtHeight(float par1, int par2)
{
return par1;
}
/**
* Returns a list of temperatures to use for the specified blocks. Args: listToReuse, x, y, width, length
*/
public float[] getTemperatures(float par1ArrayOfFloat[], int par2, int par3, int par4, int par5)
{
IntCache.resetIntCache();
if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
{
par1ArrayOfFloat = new float[par4 * par5];
}
int ai[] = biomeIndexLayer.getInts(par2, par3, par4, par5);
for (int i = 0; i < par4 * par5; i++)
{
float f = (float)BiomeGenBase.biomeList[ai[i]].getIntTemperature() / 65536F;
if (f > 1.0F)
{
f = 1.0F;
}
par1ArrayOfFloat[i] = f;
}
return par1ArrayOfFloat;
}
/**
* Returns an array of biomes for the location input.
*/
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5)
{
IntCache.resetIntCache();
if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
{
par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
}
int ai[] = genBiomes.getInts(par2, par3, par4, par5);
for (int i = 0; i < par4 * par5; i++)
{
par1ArrayOfBiomeGenBase[i] = BiomeGenBase.biomeList[ai[i]];
}
return par1ArrayOfBiomeGenBase;
}
/**
* Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the
* WorldChunkManager Args: oldBiomeList, x, z, width, depth
*/
public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5)
{
return getBiomeGenAt(par1ArrayOfBiomeGenBase, par2, par3, par4, par5, true);
}
/**
* Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
* don't check biomeCache to avoid infinite loop in BiomeCacheBlock)
*/
public BiomeGenBase[] getBiomeGenAt(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5, boolean par6)
{
IntCache.resetIntCache();
if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
{
par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
}
if (par6 && par4 == 16 && par5 == 16 && (par2 & 0xf) == 0 && (par3 & 0xf) == 0)
{
BiomeGenBase abiomegenbase[] = biomeCache.getCachedBiomes(par2, par3);
System.arraycopy(abiomegenbase, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
return par1ArrayOfBiomeGenBase;
}
int ai[] = biomeIndexLayer.getInts(par2, par3, par4, par5);
for (int i = 0; i < par4 * par5; i++)
{
par1ArrayOfBiomeGenBase[i] = BiomeGenBase.biomeList[ai[i]];
}
return par1ArrayOfBiomeGenBase;
}
/**
* checks given Chunk's Biomes against List of allowed ones
*/
public boolean areBiomesViable(int par1, int par2, int par3, List par4List)
{
int i = par1 - par3 >> 2;
int j = par2 - par3 >> 2;
int k = par1 + par3 >> 2;
int l = par2 + par3 >> 2;
int i1 = (k - i) + 1;
int j1 = (l - j) + 1;
int ai[] = genBiomes.getInts(i, j, i1, j1);
for (int k1 = 0; k1 < i1 * j1; k1++)
{
BiomeGenBase biomegenbase = BiomeGenBase.biomeList[ai[k1]];
if (!par4List.contains(biomegenbase))
{
return false;
}
}
return true;
}
/**
* Finds a valid position within a range, that is once of the listed biomes.
*/
public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random)
{
int i = par1 - par3 >> 2;
int j = par2 - par3 >> 2;
int k = par1 + par3 >> 2;
int l = par2 + par3 >> 2;
int i1 = (k - i) + 1;
int j1 = (l - j) + 1;
int ai[] = genBiomes.getInts(i, j, i1, j1);
ChunkPosition chunkposition = null;
int k1 = 0;
for (int l1 = 0; l1 < ai.length; l1++)
{
int i2 = i + l1 % i1 << 2;
int j2 = j + l1 / i1 << 2;
BiomeGenBase biomegenbase = BiomeGenBase.biomeList[ai[l1]];
if (par4List.contains(biomegenbase) && (chunkposition == null || par5Random.nextInt(k1 + 1) == 0))
{
chunkposition = new ChunkPosition(i2, 0, j2);
k1++;
}
}
return chunkposition;
}
/**
* Calls the WorldChunkManager's biomeCache.cleanupCache()
*/
public void cleanupCache()
{
biomeCache.cleanupCache();
}
}
In PortalBlock:
package net.minecraft.src;
import java.util.Random;
import java.util.*;
public class BlockEclipse extends BlockPortalBase
{
public BlockEclipse(int i, int j)
{
super(i, j, Material.portal);
}
public int idDropped(int i, Random random)
{
return mod_moonbase.Eclipse.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
//required:
public WorldProviderBase getDimension()
{
return new WorldProviderBlueAsteroid();
}
public Teleporter getTeleporter()
{
return new TeleporterBlueAsteroid();
}
public String getEnteringMessage()
{
return "Entering in the Moon";
}
public String getLeavingMessage()
{
return "Leaving of The Moon";
}
//not required:
public boolean isPortalImmediate()
{
return false;//does have a delay
}
public boolean displayPortalAnimation()
{
return true;//displays Nether portal animation
}
public List canTeleportFromDimension()
{
ArrayList arraylist = new ArrayList();
arraylist.add(Integer.valueOf(0));//player can teleport from overworld to this dimension
arraylist.add(Integer.valueOf(-1));//player can teleport from Nether to this dimension
return arraylist;
}
public int returnsPlayerToDimension()
{
return 0;//returns player to the Nether
}
public double getDistanceRatio()
{
return 0.2D;//slow travel
}
public int getPortalDelay()
{
return 150;//default
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_moonbase.EclipseBottom;
}
if (i == 1)
{
return mod_moonbase.EclipseBottom;
}
else
{
return mod_moonbase.EclipseSides;
}
}
}
In teleporter:
package net.minecraft.src;
public class TeleporterBlueAsteroid extends Teleporter{
}
Okay so, I think your talking aboput how the biome spawns etc, well you will have to type it like this:
topBlock = (byte)mod_***.****.blockID;
fillerBlock = (byte)mod_***.***.blockID; Unless your talking about the trees etc im not to sure how to use that yet, but i will play around with it after i fix my pig spawning one thanks
Yes. I'm type This, but when I'm arrive in the Biome, Minecraft Crash... If I change for another block, Like Gold, They Work Normally...
I'm really dont Know what happen...
Im sorry but i dont quite understand what you said.... but, i am working on a way to do it without editing Base Classes. im just busy with the mod im working on at the moment.
Sorry. I'm Will explain:
So... The Biome Can Not Pass of 20 X 20, like a Small Biome. Because I'm tested the Code, and Work! But The Biome is Bigger...
My Problem is with the Decorator... I think I'm cannot use My Blocks in the Biome Correctly?
And Thank You for the Fast Answer! And Good Luck with MapleCraft!
Have a Way to do A Biome Generator, without edit the Base Class? And For Let the Biome a Little rare? I need do the same of Mushroom? And.. I need the Biome be ltlle... Not so Big, Do is possible do those things?
So... If I'm Put one of My Blocks How a Decorator... The Minecraft Crash...
package net.minecraft.src;
import java.util.Random;
import java.util.List;
public class mod_moonbase extends BaseMod
{
public static final Item bluedust = new Itembluedust(5000).setItemName("BlueStone");
public static final Block moonsand = new Blockmoonsand (132,0) .setBlockName("moonsand").setHardness(0.8F).setResistance(2F).setLightValue(0.750F).setStepSound(Block.soundSandFootstep);
public static final Block moonglass = new Blockmoonglass (133,0) .setBlockName("moonglass").setHardness(0.4F).setResistance(1F).setLightValue(0.500F).setStepSound(Block.soundGlassFootstep);
public static final Block moongrass = new Blockmoongrass (134,0) .setBlockName("moongrass").setHardness(0.8F).setResistance(2F).setLightValue(0.850F).setStepSound(Block.soundGravelFootstep);
public static final Block moondirt = new Blockmoondirt (135,0) .setBlockName("moondirt").setHardness(0.8F).setResistance(2F).setLightValue(0.750F).setStepSound(Block.soundGravelFootstep);
[b] public static final Block moonstone = new Blockmoonstone (131,0) .setBlockName("moonstone").setHardness(1.8F).setResistance(3F).setLightValue(0.150F).setStepSound(Block.soundStoneFootstep);[/b]
//Blocks with various texture
public static int moongrassBottom = ModLoader.addOverride("/terrain.png", "/moongrassbottom.png");
public static int moongrassTop = ModLoader.addOverride("/terrain.png", "/moongrasstop.png");
public static int moongrassSides = ModLoader.addOverride("/terrain.png", "/moongrasssides.png");
public void load()
//Blocks below
{
ModLoader.registerBlock(moonsand);
ModLoader.addName(moonsand,"Moonsand");
moonsand.blockIndexInTexture = ModLoader.addOverride( "/terrain.png", "/moonsand.png" );
ModLoader.addRecipe(new ItemStack(moonsand, 2), new Object[] {
"aaa", Character.valueOf('a'), Block.dirt
});
}
{
ModLoader.registerBlock(moonglass);
ModLoader.addName(moonglass,"MoonGlass");
moonglass.blockIndexInTexture = ModLoader.addOverride( "/terrain.png", "/moonglass.png" );
ModLoader.addSmelting(moonsand.blockID, new ItemStack(moonglass, 1));
};
{
ModLoader.registerBlock(moongrass);
ModLoader.addName(moongrass,"MoonGrass");
moongrass.blockIndexInTexture = ModLoader.addOverride( "/terrain.png", "/moongrasslado.png" );
ModLoader.addRecipe(new ItemStack(moongrass, 2), new Object[] {
"a", "b", "b", Character.valueOf('a'), Block.dirt , Character.valueOf('b'), Block.sand
});
{
ModLoader.registerBlock(moonstone);
ModLoader.addName(moonstone,"MoonStone");
moonsand.blockIndexInTexture = ModLoader.addOverride( "/terrain.png", "/MoonStone.png" );
ModLoader.addRecipe(new ItemStack(moonstone, 2), new Object[] {
"a", "b", Character.valueOf('a'), Block.dirt , Character.valueOf('b'), Block.sand
});
}
{
ModLoader.registerBlock(moondirt);
ModLoader.addName(moondirt,"MoonDirt");
moondirt.blockIndexInTexture = ModLoader.addOverride( "/terrain.png", "/moondirt.png" );
ModLoader.addRecipe(new ItemStack(moondirt, 2), new Object[] {
"aa", "bb", Character.valueOf('a'), Block.dirt , Character.valueOf('b'), Block.sand
});
}
//Items below
{
bluedust.iconIndex = ModLoader.addOverride("/gui/items.png", "/blue.png");
ModLoader.addName(bluedust, "BlueStone");
ModLoader.addRecipe(new ItemStack(bluedust, 5), new Object [] {"###", "#X#",Character.valueOf('X'), Item.redstone, Character.valueOf('#'), new ItemStack (Item.dyePowder, 1, 4)});
}
}
public String getVersion()
{
return "Minecraft Version 1.2_03";
}
}
package net.minecraft.src;
import java.util.Random;
public class Blockmoonstone extends Block
{
public Blockmoonstone(int i, int j)
{
super(i, j, Material.ground);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
}
}
Make a Circuit, like a Redstone, is really hard? Or not so hard??
0
Especially the Tutorial of Crops, Really help a lot of people.
Thanks
0
Awesome!
Pudlehund... i'm have another Problem... When I'm Spawn in One Biome. the Decorator Block of this Biome, Will work in all Biomes... I'm dont Know to solve this... So You can help me?
And Thanks A Lot!
PS: I send the code by PM.
0
I'm using Now! Thank You Pudlehand!
0
I have anothers Problems... My Biomes, not Spawn in Dimension... I'm only put for Spawn two Biomes... Those Biomes, not spawn... Whats is wrong? And Now Have a Crasher...
0
And for Me change the Cave generator, I need create another class with Cave Generator(MapGenCaves)? I thinking about to remove Dirt, Grass, Stones, sand, sandstone... And Change for My Blocks... have a Way to do this in all world??
And Thanks for the Help.
0
ThankYou for the BigHelp!
I'm forgoted one thing:
Only one More Question, for Ignite the Portal, What I need do? I tried with TrytoCreatePortal, but Not ignite...
And For Add My Biome, What part of Chunk Provider I need change?
0
I'm try only Walk and Not Get the Dimension...
Probably Not... But without Inginite, The Portal Need start right?
0
Firtsly, Thank You for the Excelent API, is Amazing.
Second, I think all is right, but My Portal not Work...
Do You can help me with this? The Game Start Normally, The problem is with the Portal, Not ignite.
In My Mod:
In WorldGen:
In Chunk Manager:
In teleporter:
I'm Put in Spoilers, for Not "Flood" the Topic
Thank You.
0
Yes. I'm type This, but when I'm arrive in the Biome, Minecraft Crash... If I change for another block, Like Gold, They Work Normally...
I'm really dont Know what happen...
0
Sorry. I'm Will explain:
So... The Biome Can Not Pass of 20 X 20, like a Small Biome. Because I'm tested the Code, and Work! But The Biome is Bigger...
My Problem is with the Decorator... I think I'm cannot use My Blocks in the Biome Correctly?
And Thank You for the Fast Answer! And Good Luck with MapleCraft!
0
Have a Way to do A Biome Generator, without edit the Base Class? And For Let the Biome a Little rare? I need do the same of Mushroom? And.. I need the Biome be ltlle... Not so Big, Do is possible do those things?
So... If I'm Put one of My Blocks How a Decorator... The Minecraft Crash...
0
Thanks!
0
0
Firstly, Thank You for The Nice Tutorials... Will Help a Lot!
And... Do You can make a Tutorial of a New Dimension with Forge?
0
Make a Circuit, like a Redstone, is really hard? Or not so hard??
Thank you for the fast Suport!