C&P Text?
Quote:
package net.minecraft.src;
import java.util.Random;
public class BlockUVLampe extends Block
{
private final boolean powered;
protected BlockUVLampe(int par1, int par2, boolean par3) {
super(par1, par2, Material.redstoneLight);
this.setCreativeTab(CreativeTabs.tabRedstone);
this.powered = par3;
}
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4);
}
else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_ObsidianTools.LampeON.blockID);
}
}
}
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if (!par1World.isRemote)
{
if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4);
}
else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_ObsidianTools.LampeON.blockID);
}
}
}
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote && this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_ObsidianTools.LampeOFF.blockID);
}
}
}
Und das geht viel besserQuote:
LampeON = (new BlockUVLampe(LampeONID, ModLoader.addOverride("/terrain.png", "/ObsidianTools/LampeON.png"), true).setHardness(0.4F).setBlockName("Lampe An").setStepSound(Block.soundGlassFootstep).setReq uiresSelfNotify().setLightValue(2.5F));
LampeOFF = (new BlockUVLampe(LampeOFFID, ModLoader.addOverride("/terrain.png", "/ObsidianTools/LampeOFF.png"), false).setHardness(0.4F).setBlockName("Lampe Aus").setStepSound(Block.soundGlassFootstep).setRe quiresSelfNotify());
package net.minecraft.src;
public class mod_name extends BaseMod{
public static final Block TestErz;
static{
//Block
TestErz = new Block(220, 0, Material.rock).setHardness(0.5F).setLightValue(0.5F).setBlockName("Block Tutorial");
//Register
ModLoader.registerBlock(TestErz);
//Name
ModLoader.addName(TestErz, "Rubin Erz");
//Textur
TestErz.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/tutorial/block/rubin_erz.png");
}
public String getVersion() {return "Minecraft Tutorial Mod";}
public void load() {}
}
Soweit ich weiß erstellt mcp beim recompilieren einen Ordner wo die neuen/modifizierten Klassen drin sind. Diese musst du dann nurnoch kopieren und dann z.B. in deine minecraft.jar einfügen.Quote:
So--- jetzt ist nur die frage... was mach ich jetzt damit wenn ich fertig bin???
ich musste reobfusicaten und dann war se im reobf drine :)Quote:
Soweit ich weiß erstellt mcp beim recompilieren einen Ordner wo die neuen/modifizierten Klassen drin sind. Diese musst du dann nurnoch kopieren und dann z.B. in deine minecraft.jar einfügen.
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ);
{
switch(world.provider.dimensionId){
case -1: generateNether(world, random,chunkX*16,chunkZ*16);
case 0 : generateSurface(world, random,chunkX*16,chunkZ*16);
} } }
private void generateSurface(World world, Random random, int BlockX, int BlockZ) {
{
for(int i =0; i<30;i++){
if (biomeName == "Plains" ){
int Xcoord = BlockX + random.nextInt(20);
int Zcoord = BlockZ + random.nextInt(20);
int Ycoord = random.nextInt(256);
(new WorldGenMinable(Erzblock.blockID, 20)).generate(world, random, Xcoord, Ycoord, Zcoord);
}}}}
for(int i = 0; i < 25; i++){
int rndPosX = chunkX + random.nextInt(20);
int rndPosY = random.nextInt(128);
int rndPosZ = chunkZ + random.nextInt(20);
(new WorldGenNether_1(ironore.blockID, 20)).generate(world, random, rndPosX, rndPosY, rndPosZ);
}
for(int i = 0; i < 25; i++){
int CodiX = chunkX + random.nextInt(20);
int CodiY = random.nextInt(128);
int CodiZ = chunkZ + random.nextInt(20);
(new WorldGenNether_1(ironore.blockID, 20)).generate(world, random, CodiX,CodiZ, CodiZ);
}
public void load() {
public void generateNether(World world, Random random, int chunkX, int chunkZ){
for(int i = 0; i < 25; i++){
int rndPosX = chunkX + random.nextInt(20);
int rndPosY = random.nextInt(128);
int rndPosZ = chunkZ + random.nextInt(20);
(new WorldGenNether_1(ironore.blockID, 20)).generate(world, random, rndPosX, rndPosY, rndPosZ);
}
for(int i = 0; i < 25; i++){
int CodiX = chunkX + random.nextInt(20);
int CodiY = random.nextInt(128);
int CodiZ = chunkZ + random.nextInt(20);
(new WorldGenNether_1(ironore.blockID, 20)).generate(world, random, CodiX,CodiZ, CodiZ);
}}
Danke werde es gleich probieren ;)Quote:
ganz einfach nach deinem Code
und so musst du dan weider machenCode:for(int i = 0; i < 25; i++){ int rndPosX = chunkX + random.nextInt(20); int rndPosY = random.nextInt(128); int rndPosZ = chunkZ + random.nextInt(20); (new WorldGenNether_1(ironore.blockID, 20)).generate(world, random, rndPosX, rndPosY, rndPosZ); }
also dein code mus dan so aussehenCode:for(int i = 0; i < 25; i++){ int CodiX = chunkX + random.nextInt(20); int CodiY = random.nextInt(128); int CodiZ = chunkZ + random.nextInt(20); (new WorldGenNether_1(ironore.blockID, 20)).generate(world, random, CodiX,CodiZ, CodiZ); }
Code:public void load() { public void generateNether(World world, Random random, int chunkX, int chunkZ){ for(int i = 0; i < 25; i++){ int rndPosX = chunkX + random.nextInt(20); int rndPosY = random.nextInt(128); int rndPosZ = chunkZ + random.nextInt(20); (new WorldGenNether_1(ironore.blockID, 20)).generate(world, random, rndPosX, rndPosY, rndPosZ); } for(int i = 0; i < 25; i++){ int CodiX = chunkX + random.nextInt(20); int CodiY = random.nextInt(128); int CodiZ = chunkZ + random.nextInt(20); (new WorldGenNether_1(ironore.blockID, 20)).generate(world, random, CodiX,CodiZ, CodiZ); }}
du musst bei jeden weiteren Generirung musst du die 3 uint ändern nicht die gleichen nehem da sonst ein fehler oder der block wird noch mal generirt