• Es freut uns dass du in unser Minecraft Forum gefunden hast. Hier kannst du mit über 130.000 Minecraft Fans über Minecraft diskutieren, Fragen stellen und anderen helfen. In diesem Minecraft Forum kannst du auch nach Teammitgliedern, Administratoren, Moderatoren , Supporter oder Sponsoren suchen. Gerne kannst du im Offtopic Bereich unseres Minecraft Forums auch über nicht Minecraft spezifische Themen reden. Wir hoffen dir gefällt es in unserem Minecraft Forum!

Armor Special Effect einfügen [ModLoader]

Gawain

Redstoneengineer
Registriert
5 Januar 2012
Beiträge
36
Diamanten
7
Guten Tag,
Ich habe eine Frage zum Coden mit ModLoader.
Erstellt habe ich eine neue ItemArmor-Klasse und habe ihr einen Special Effect
hinzugefügt. Abgefragt werden soll, ob alle vier Rüstungen des Typs angezogen sind.

Erstellt habe ich das folgendermaßen also neu angebaut:

ItemArmorStorm:
Code:
[FONT=Monaco] [COLOR=#931a68]public[/COLOR] [COLOR=#931a68]boolean[/COLOR] onTickInGame([COLOR=#931a68]float[/COLOR] f, Minecraft minecraft)[/FONT]
[FONT=Monaco]    {[/FONT]
[FONT=Monaco]    [COLOR=#931a68]if[/COLOR] (minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]inventory[/COLOR].armorItemInSlot(3) != [COLOR=#931a68]null[/COLOR] && minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]inventory[/COLOR].armorItemInSlot(2) != [COLOR=#931a68]null[/COLOR] && minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]inventory[/COLOR].armorItemInSlot(1) != [COLOR=#931a68]null[/COLOR] && minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]inventory[/COLOR].armorItemInSlot(0) != [COLOR=#931a68]null[/COLOR])[/FONT]
[FONT=Monaco]        {[/FONT]
[FONT=Monaco]            ItemStack itemstack0 = minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]inventory[/COLOR].armorItemInSlot(3);[/FONT]
[FONT=Monaco]            ItemStack itemstack1 = minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]inventory[/COLOR].armorItemInSlot(2);[/FONT]
[FONT=Monaco]            ItemStack itemstack2 = minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]inventory[/COLOR].armorItemInSlot(1);[/FONT]
[FONT=Monaco]            ItemStack itemstack3 = minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]inventory[/COLOR].armorItemInSlot(0);[/FONT]
[FONT=Monaco]            [COLOR=#931a68]if[/COLOR] (itemstack0.[COLOR=#0326cc]itemID[/COLOR] == mod_armor.[COLOR=#0326cc]stormhelmet[/COLOR].[COLOR=#0326cc]shiftedIndex[/COLOR] && itemstack1.[COLOR=#0326cc]itemID[/COLOR] == mod_armor.[COLOR=#0326cc]stormchestplate[/COLOR].[COLOR=#0326cc]shiftedIndex[/COLOR] && itemstack2.[COLOR=#0326cc]itemID[/COLOR] == mod_armor.[COLOR=#0326cc]stormleggins[/COLOR].[COLOR=#0326cc]shiftedIndex[/COLOR] && itemstack3.[COLOR=#0326cc]itemID[/COLOR] == mod_armor.[COLOR=#0326cc]stormshoes[/COLOR].[COLOR=#0326cc]shiftedIndex[/COLOR])[/FONT]
[FONT=Monaco]            {[/FONT]
[FONT=Monaco]                minecraft.[COLOR=#0326cc]thePlayer[/COLOR].[COLOR=#0326cc]speedOnGround[/COLOR] = 0.5F;[/FONT]
[FONT=Monaco]            }[/FONT]
[FONT=Monaco]        }[/FONT]
[FONT=Monaco]        [COLOR=#931a68]return[/COLOR] [COLOR=#931a68]true[/COLOR];[/FONT]
[FONT=Monaco]    }[/FONT]
[FONT=Monaco]}


[/FONT]

- - - Aktualisiert - - -

Glaubt ihr das es gehen würde wenn ich es in die Item.java einfüge und in keine
ModLoader Klasse einbaue, würde zwar den Sinn von ModLoader zerstören aber egal :)
 
Zuletzt bearbeitet:
Oben