Skip to content

Instantly share code, notes, and snippets.

/jetpack.java Secret

Created Mar 27, 2016
Embed
What would you like to do?
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