Minecraft Mods erstellen [ModLoader]

04/10/2012 20:36 JONMI2000#166
Hallo alle zusammen!
Ich modde schon seit ein paar Wochen und habe ein bisschen Ahnung, mein Problem ist nur ,dass das mit der Tür bei mir überhaupt nicht geht kann mir da jemand helfen.
(Ich modde 1.2.5)
04/10/2012 21:51 the_cake#167
Quote:
Originally Posted by JONMI2000 View Post
Hallo alle zusammen!
Ich modde schon seit ein paar Wochen und habe ein bisschen Ahnung, mein Problem ist nur ,dass das mit der Tür bei mir überhaupt nicht geht kann mir da jemand helfen.
(Ich modde 1.2.5)
Entschuldigung war mein Fehler ich habe einen Code 2 mal eingefügt beim Item
:rtfm::rtfm::rtfm::rtfm::rtfm::rtfm::rtfm::rtfm:


chris26

ich habe mal den Mod weiter geschrieben es fehlen noch die Boss Leben anzeige und das Biome

Hier mal ein paar Bilder.

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
04/11/2012 09:42 chris26#168
sieht ja gut aus :D
04/11/2012 11:46 -i[Gyxx]*#169
Du gibst dir hier viel Mühe.
Morgen bin ich wieder Zuhause, denn werde ich dir ein paar Datein schicken wo auch sowas wie die Animation erklärt wird.
04/11/2012 12:47 idattnertv#170
Gutes Tutorial! Eine Frage:
Ich will meine eigene Fackel erstellen. Hab ich auch geschafft, aber...
1. will ich, dass die Flamme grün ist und nicht gelb und...
2. Hat die Fackel nur eine Textur wenn sie platziert ist. Wenn ich sie zerstöre dann bekomme ich den Block 0!
Kann mir jdm helfen?
04/11/2012 12:48 JONMI2000#171
Hallo nochmal!
Danke the_cake für die schnelle Antwort.
Jetzt funktioniert es auch.
Hab aber nochmal ne Frage kenn jemand zufällig ein Tutorial wo erklärt ist wie man seine eigene Pflanze macht? (die soll wie Getreide sein)
Für 1.2.5 natürlich
Danke schon mal
04/11/2012 13:09 -i[Gyxx]*#172
Pflanzen müssten eig. so sein.

Mod datei:


Seed datei:


Pflanzen datei:

Code:

Die Namen der Texturen sind:
Beere1
Beere2
Beere3
Beere4
Beere5
Beere6
Beere7
Beere8
BeereSeeds
BeereFrucht

sie kommen in den Ordner Pflanze
04/11/2012 16:32 the_cake#173
Quote:
Originally Posted by idattnertv View Post
Gutes Tutorial! Eine Frage:
Ich will meine eigene Fackel erstellen. Hab ich auch geschafft, aber...
1. will ich, dass die Flamme grün ist und nicht gelb und...
2. Hat die Fackel nur eine Textur wenn sie platziert ist. Wenn ich sie zerstöre dann bekomme ich den Block 0!
Kann mir jdm helfen?
Erst einmal danke

Code:
1. will ich, dass die Flamme grün ist und nicht gelb und...
Ich schau mal wie man die Ändern kann muss wahrscheinlich die Partikel Farbe des Feuers ändern

Code:
2. Hat die Fackel nur eine Textur wenn sie platziert ist. Wenn ich sie zerstöre dann bekomme ich den Block 0!
Zu dieser frage ich habe es auch einmal Versucht mit einer eignen Fackel allerdings konnte ich auch nicht das Icon ändern.
04/11/2012 17:30 -i[Gyxx]*#174
Das Feuer der Fackel ist ein Effect.
04/11/2012 22:13 the_cake#175
Echt ok wuste ich nicht
04/11/2012 22:38 -i[Gyxx]*#176
EntityFlameFX sind die Feuer Particle der Fakel.

Um die Particle umzufärben schreib das in eine .java Datei:
Code:
package net.minecraft.src;

import java.util.Random;

public class EntityFlameGreenFX extends EntityFX
{
    /** the scale of the flame FX */
    private float flameScale;

    public EntityFlameGreenFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
    {
        super(par1World, par2, par4, par6, par8, par10, par12);
        motionX = motionX * 0.0099999997764825821D + par8;
        motionY = motionY * 0.0099999997764825821D + par10;
        motionZ = motionZ * 0.0099999997764825821D + par12;
        par2 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
        par4 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
        par6 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
        flameScale = particleScale;
        particleRed = 0F;
        particleGreen = 0F; 
        particleBlue = 1.0F;
        particleMaxAge = (int)(8D / (Math.random() * 0.80000000000000004D + 0.20000000000000001D)) + 4;
        noClip = true;
        setParticleTextureIndex(48);
    }

    public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
    {
        float f = ((float)particleAge + par2) / (float)particleMaxAge;
        particleScale = flameScale * (1.0F - f * f * 0.5F);
        super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
    }

    public int getBrightnessForRender(float par1)
    {
        float f = ((float)particleAge + par1) / (float)particleMaxAge;

        if (f < 0.0F)
        {
            f = 0.0F;
        }

        if (f > 1.0F)
        {
            f = 1.0F;
        }

        int i = super.getBrightnessForRender(par1);
        int j = i & 0xff;
        int k = i >> 16 & 0xff;
        j += (int)(f * 15F * 16F);

        if (j > 240)
        {
            j = 240;
        }

        return j | k << 16;
    }

    /**
     * Gets how bright this entity is.
     */
    public float getBrightness(float par1)
    {
        float f = ((float)particleAge + par1) / (float)particleMaxAge;

        if (f < 0.0F)
        {
            f = 0.0F;
        }

        if (f > 1.0F)
        {
            f = 1.0F;
        }

        float f1 = super.getBrightness(par1);
        return f1 * f + (1.0F - f);
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        prevPosX = posX;
        prevPosY = posY;
        prevPosZ = posZ;

        if (particleAge++ >= particleMaxAge)
        {
            setDead();
        }

        moveEntity(motionX, motionY, motionZ);
        motionX *= 0.95999997854232788D;
        motionY *= 0.95999997854232788D;
        motionZ *= 0.95999997854232788D;

        if (onGround)
        {
            motionX *= 0.69999998807907104D;
            motionZ *= 0.69999998807907104D;
        }
    }
}
und mit dem Code:
Code:
ModLoader.getMinecraftInstance().effectRenderer.addEffect(new EntityFlameGreenFX(world, d, d1, d2, d3, d4, d5));
in der jeweiligen Block datei werden die Neuen Particle gespawnt
04/12/2012 15:37 idattnertv#177
WOW! Danke!!!!
Eine Frage noch:
Ich will einen Block machen, der sich wie eine GlowstoneLampe verhält. Das ist ja die BlockRedstoneLight.java, oder?
Jetzt meine 2 Fragen:
1. Dort ist angegeben " public BlockRedstoneLight(int par1, boolean par2)"! Was muss ich als boolean eintragen? Das steht nicht mit drin!?
2. Die Lampe hat ja zwei Texturen! Also die Lampe an und die Lampe aus! Wie stelle ich diese ein?
04/12/2012 16:18 the_cake#178
Quote:
Originally Posted by -i[Gyxx]* View Post
EntityFlameFX sind die Feuer Particle der Fakel.

Um die Particle umzufärben schreib das in eine .java Datei:
Code:
package net.minecraft.src;

import java.util.Random;

public class EntityFlameGreenFX extends EntityFX
{
    /** the scale of the flame FX */
    private float flameScale;

    public EntityFlameGreenFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
    {
        super(par1World, par2, par4, par6, par8, par10, par12);
        motionX = motionX * 0.0099999997764825821D + par8;
        motionY = motionY * 0.0099999997764825821D + par10;
        motionZ = motionZ * 0.0099999997764825821D + par12;
        par2 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
        par4 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
        par6 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
        flameScale = particleScale;
        particleRed = 0F;
        particleGreen = 0F; 
        particleBlue = 1.0F;
        particleMaxAge = (int)(8D / (Math.random() * 0.80000000000000004D + 0.20000000000000001D)) + 4;
        noClip = true;
        setParticleTextureIndex(48);
    }

    public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
    {
        float f = ((float)particleAge + par2) / (float)particleMaxAge;
        particleScale = flameScale * (1.0F - f * f * 0.5F);
        super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
    }

    public int getBrightnessForRender(float par1)
    {
        float f = ((float)particleAge + par1) / (float)particleMaxAge;

        if (f < 0.0F)
        {
            f = 0.0F;
        }

        if (f > 1.0F)
        {
            f = 1.0F;
        }

        int i = super.getBrightnessForRender(par1);
        int j = i & 0xff;
        int k = i >> 16 & 0xff;
        j += (int)(f * 15F * 16F);

        if (j > 240)
        {
            j = 240;
        }

        return j | k << 16;
    }

    /**
     * Gets how bright this entity is.
     */
    public float getBrightness(float par1)
    {
        float f = ((float)particleAge + par1) / (float)particleMaxAge;

        if (f < 0.0F)
        {
            f = 0.0F;
        }

        if (f > 1.0F)
        {
            f = 1.0F;
        }

        float f1 = super.getBrightness(par1);
        return f1 * f + (1.0F - f);
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        prevPosX = posX;
        prevPosY = posY;
        prevPosZ = posZ;

        if (particleAge++ >= particleMaxAge)
        {
            setDead();
        }

        moveEntity(motionX, motionY, motionZ);
        motionX *= 0.95999997854232788D;
        motionY *= 0.95999997854232788D;
        motionZ *= 0.95999997854232788D;

        if (onGround)
        {
            motionX *= 0.69999998807907104D;
            motionZ *= 0.69999998807907104D;
        }
    }
}
und mit dem Code:
Code:
ModLoader.getMinecraftInstance().effectRenderer.addEffect(new EntityFlameGreenFX(world, d, d1, d2, d3, d4, d5));
in der jeweiligen Block datei werden die Neuen Particle gespawnt
Du warst zu schnell xD

Quote:
Originally Posted by idattnertv View Post
WOW! Danke!!!!
Eine Frage noch:
Ich will einen Block machen, der sich wie eine GlowstoneLampe verhält. Das ist ja die BlockRedstoneLight.java, oder?
Jetzt meine 2 Fragen:
1. Dort ist angegeben " public BlockRedstoneLight(int par1, boolean par2)"! Was muss ich als boolean eintragen? Das steht nicht mit drin!?
2. Die Lampe hat ja zwei Texturen! Also die Lampe an und die Lampe aus! Wie stelle ich diese ein?
Das muss ihn deine Block datei.

Code:
    public void onNeighborBlockChange(World world, int i, int j, int k, int l)
    {
        if(world.isBlockIndirectlyGettingPowered(i, j, k))
        {
            world.setBlockWithNotify(i, j, k, mod_deinmodname.lampeAn.blockID);
        } else
        {
            world.setBlockWithNotify(i, j, k, mod_deinmodname.lampeAus.blockID););
        }
    }
Da du hoffentlich schon weist das jeder Block eine andere Textur haben kann. Weis du einfach lampeAn eine Textur zu wenn sie an ist also heller und bei lampeAus wie halt dein block aus sieht wenn er dunkel ist. Du must natürlich beiden eine eigenes Licht geben geben
04/12/2012 16:19 idattnertv#179
Ich war mal wieder zu schnell :D
Tut mir leid! Okay, VIELEN, VIELEN Dank!!!
Es klappt jetzt! Hab es zwar ein bisschen anders gemacht, aber es klappt! ;)
Das hier hat mir gefehlt...
Code:
mod_deinmodname.lampeAn.blockID
Ich hab doch tatsächlich vergessen, wie man auf andere Class Dateien zugreift :D
04/12/2012 16:39 the_cake#180
Quote:
Originally Posted by idattnertv View Post
Ich war mal wieder zu schnell :DD
Tut mir leid! Okay, VIELEN, VIELEN Dank!!!
Das ist der Block text

Code:
package net.minecraft.src;

public class BlockNeonlight extends Block
{
    protected BlockNeonlight(int par1, int par2)
    {
        super(par1, par2, Material.ground);
    }
    
    public void onNeighborBlockChange(World world, int i, int j, int k, int l)
    {
        if(world.isBlockIndirectlyGettingPowered(i, j, k))
        {
            world.setBlockWithNotify(i, j, k, mod_Name.neonlighton.blockID);
        } else
        {
            world.setBlockWithNotify(i, j, k, mod_Name.neonlightoff.blockID);
        }
    }
}