-
-
Save anonymous/76242c7b70515824361a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.koopamillion.item; | |
import com.koopamillion.Main.JetpackMessage; | |
import com.koopamillion.Main.MainRegistry; | |
import com.koopamillion.lib.RefStrings; | |
import cpw.mods.fml.common.network.simpleimpl.IMessage; | |
import net.minecraft.client.Minecraft; | |
import net.minecraft.entity.Entity; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.item.ItemArmor; | |
import net.minecraft.item.ItemStack; | |
import net.minecraft.util.MathHelper; | |
import net.minecraft.world.World; | |
public class jetpack extends ItemArmor{ | |
public jetpack(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { | |
super(p_i45325_1_, p_i45325_2_, p_i45325_3_); | |
} | |
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){ | |
if(stack.getItem() == Mitems.jetpack) { | |
return RefStrings.MODID + ":textures/model/armor/jetpack.png"; | |
}else{ | |
return null; | |
} | |
} | |
@Override | |
public void onArmorTick(World world, EntityPlayer player, ItemStack stack){ | |
if(stack.getItem() == Mitems.jetpack && MainRegistry.proxy.keyBindJump()){ | |
MainRegistry.network.sendToServer(new JetpackMessage("true")); | |
Mitems.jetpack.setDamage(stack, Mitems.jetpack.getDamage(stack) + 1); | |
} | |
if(stack.getItemDamage() >= 720){ | |
player.setCurrentItemOrArmor(3, new ItemStack(Mitems.jetpackDead)); | |
} | |
if(stack.getItem() == Mitems.jetpack){ | |
player.fallDistance = 0F; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment