i dont use modloader and i just need to know how to make them spawn using any way possible. in other words how would you do it. or what file calls the regular dungeon to spawn.
Look in ChunkProviderGenerate in the popular() method.
You can look at the different bits of generation code for examples, and the dungeon's particular portion will be a few lines starting at around line 505.
Also, world generation generally looks something like this:
for (int i = 0; i < 50; i++)
{
int randPosX = ChunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = ChunkZ + random.nextInt(16);
new WorldGenMinable(blockFrozenStone.blockID, 50).generate(world, random, randPosX, randPosY, randPosZ);
Note that the number 50 after the ID of the block to generate is abnormally large, normally being the ore vein size, and thus usually a much lower number. I needed a much larger vein size for this particular instance of its usage.
yeah it worked but it filled every avialable space id like it to stay a distance away from ooze (other wise ooze cant spread)
What it should be doing is filling in all the available air blocks with haze, then the haze block itself it supposed to be checking for blocks of ooze in its vicinity and destroying itself if it finds ooze within 3 blocks, since I used canPlaceBlockAt() it should also be checking for ooze when you try and place the block.
I only made it check for ooze blocks and modify itself in the event that it detects one, so that shouldn't be preventing the spread of the ooze block itself unless you also code ooze to avoid haze.
Well for one, we can't blindly guess what your code looks like, and two, if you use ModLoader you should be able to just use the generateSurface() method to generate the dungeons and not have to edit any basefiles or screw around with a new ChunkProvider.
it worked but i didnt see this part returnthis.blockCheckLoop(world, x, y, z)!=Block.dirt.blockID; and after i changed it to the ooze block it just wouldnt do anything,
All i have for code right now is some basic ore gen code and one block. Its small, and shouldn't consume much. I use eclipse to start my modded minecraft, and it still hogs CPU.
1. Show me the ore generation code
2. Tell me your operating system
3. Tell me what your CPU is and at what clockspeed
4. Tell me what your graphics card is
5. How much RAM (memory) the computer has
6. How old the computer is
7. If you have any backround programs open besides something like a file browser
Yeah it always was, I just want to know how to make it fire in a straight direction like arrows in a dispenser.
If the TNT entity can use an equivalent of the EntityThrowable code that lets throwable items be shot from dispensers, then you can now use the same code as they do with the TNT.
package net.minecraft.src;
import java.util.Random;
public class BlockRedundantNameBlock1 extends Block
{
protected BlockRedundantNameBlock1(int id)
{
super(id, Material.rock);
}
public int tickRate()
{
return 60;
}
public void updateTick(World world, int x, int y, int z, Random random)
{
/* Loop checking 9 by 9 by 9 area */
for (int posY1 = y - 9; posY1 <= y + 9; posY1++)
for (int posX1 = x - 9; posX1 <= x + 9; posX1++)
for (int posZ1 = z - 9; posZ1 <= z + 9; posZ1++)
{
if (((posY1 <= 256) && (posY1 > 0)))
{
/* If there's a block of air at the coordinates given by the loop then place a block of haze and start it updating at a tickrate of 60 */
if(world.isAirBlock(posX1, posY1, posZ1))
{
/* Replace stone with the haze block */
world.setBlockWithNotify(posX1, posY1, posZ1, Block.stone.blockID);
world.scheduleBlockUpdate(posX1, posY1, posZ1, Block.stone.blockID, 60);
}
}
}
}
}
The block of haze:
package net.minecraft.src;
import java.util.Random;
public class BlockRendundantNameBlock2 extends Block
{
public boolean canBePlaced;
protected BlockRendundantNameBlock2(int id)
{
super(id, Material.rock);
}
/* 1 tick per 3 seconds */
public int tickRate()
{
return 60;
}
/* Checks 3 by 3 by 3 area and returns the ID of blocks */
public int blockCheckLoop(World world, int x, int y, int z)
{
int posXChecked = 0;
int posYChecked = 0;
int posZChecked = 0;
for (int posY1 = y - 3; posY1 <= y + 3; posY1++)
for (int posX1 = x - 3; posX1 <= x + 3; posX1++)
for (int posZ1 = z - 3; posZ1 <= z + 3; posZ1++)
{
posXChecked = posX1;
posYChecked = posY1;
posZChecked = posZ1;
}
int blockChecked = world.getBlockId(posXChecked, posYChecked, posZChecked);
/* Just to make sure the coordinates are actually being assigned to the variables */
System.out.println("X: " + posXChecked + "Y: " + posYChecked + "Z: " + posZChecked);
return blockChecked;
}
/* Block can only be placed if blockCheckLoop doesn't return the ID of the ooze block */
public boolean canPlaceBlockAt(World world, int x, int y, int z)
{
/* Change to ID of ooze */
return this.blockCheckLoop(world, x, y, z) != Block.dirt.blockID;
}
/* If the block can't stay, remove it (set it to an air block) */
public void updateTick(World world, int x, int y, int z, Random random)
{
if(!this.canBlockStay(world, x, y, z))
{
world.setBlock(x, y, z, 0);
}
}
I haven't actually tested this but it should work as intended. I'll leave tying it into your own code up to you.
If you need more help I'll be glad to oblige.
yeah i know that feel, youve alrdy helped a good bit, the haze idea ive been kinda ify on a friends suggested it and it was a cool idea but its been trouble from the start so it may easily be tossed out
but Ill play with it for a bit and see
I fixed my own dumb problem and reminded myself (hopefully for the last time) that doing a certain something that I've done multiple times before results in an infinite loop...
for(int xToPlaceIn = x - radiusSmall; xToPlaceIn <= x + radiusSmall; xToPlaceIn++)
Now that that's over with I'll probably be able to knock your basic code out like nothing.
Also should haze only replace air blocks? I would assume so, just posing the question before I go to sleep.
yes initially it will be spawned from the spore block
I'll look at it tomorrow. Right now I'm dealing with my own set of loops...which has gone out of control and nearly caused my system to run out of memory for the umpteenth time, and I'm probably making one stupid ass typo. It would be cruel and unusual punishment to make you go through the same, seeing as it's apparently NOT MY DAY.
Note: 9 cubed rapidly becomes a resource intensive number when the number of blocks becomes more than a few, be aware of this.
ill take any help i can get,
so theres 3 block, spore, haze and ooze, ooze spreads out on its own, so will haze but haze will have to have a spore block within a 9x9x9 area but cant be within 3 blocks (in any direction) of an ooze block
Is the haze going to be spawned from code in the spore block?
0
0
It probably just isn't getting tick updates scheduled (I left that part out...woops :D)
Try adding this into the file (possibly into the files for the other blocks too)
0
Look in ChunkProviderGenerate in the popular() method.
You can look at the different bits of generation code for examples, and the dungeon's particular portion will be a few lines starting at around line 505.
Also, world generation generally looks something like this:
Note that the number 50 after the ID of the block to generate is abnormally large, normally being the ore vein size, and thus usually a much lower number. I needed a much larger vein size for this particular instance of its usage.
0
What it should be doing is filling in all the available air blocks with haze, then the haze block itself it supposed to be checking for blocks of ooze in its vicinity and destroying itself if it finds ooze within 3 blocks, since I used canPlaceBlockAt() it should also be checking for ooze when you try and place the block.
I only made it check for ooze blocks and modify itself in the event that it detects one, so that shouldn't be preventing the spread of the ooze block itself unless you also code ooze to avoid haze.
0
0
Did it work with dirt?
2
1. Show me the ore generation code
2. Tell me your operating system
3. Tell me what your CPU is and at what clockspeed
4. Tell me what your graphics card is
5. How much RAM (memory) the computer has
6. How old the computer is
7. If you have any backround programs open besides something like a file browser
0
If the TNT entity can use an equivalent of the EntityThrowable code that lets throwable items be shot from dispensers, then you can now use the same code as they do with the TNT.
0
Is the dispenser shooting the entity now then? If so, tell me what you need to alter about how it's firing.
0
The block that will spawn the haze:
The block of haze:
I haven't actually tested this but it should work as intended. I'll leave tying it into your own code up to you.
If you need more help I'll be glad to oblige.
0
0
I fixed my own dumb problem and reminded myself (hopefully for the last time) that doing a certain something that I've done multiple times before results in an infinite loop...
!= infinite loop
== infinite loop
Now that that's over with I'll probably be able to knock your basic code out like nothing.
Also should haze only replace air blocks? I would assume so, just posing the question before I go to sleep.
0
I'll look at it tomorrow. Right now I'm dealing with my own set of loops...which has gone out of control and nearly caused my system to run out of memory for the umpteenth time, and I'm probably making one stupid ass typo. It would be cruel and unusual punishment to make you go through the same, seeing as it's apparently NOT MY DAY.
Note: 9 cubed rapidly becomes a resource intensive number when the number of blocks becomes more than a few, be aware of this.
0
Is the haze going to be spawned from code in the spore block?
3
They already said they've modified other Mobs.
Simple blocks are trivial if you've already done Entities.