Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
131 additions
and
12 deletions.
There are no files selected for viewing
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
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+586 Bytes
resources/assets/tinker/textures/items/armor/exosuit_chestplate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package tconstruct.items.armor; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
import com.google.common.collect.Multimap; | ||
|
||
import net.minecraft.client.renderer.texture.IconRegister; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.SharedMonsterAttributes; | ||
import net.minecraft.entity.ai.attributes.AttributeModifier; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.*; | ||
import tconstruct.library.TConstructRegistry; | ||
import tconstruct.library.armor.ArmorCore; | ||
import tconstruct.library.armor.EnumArmorPart; | ||
|
||
public class ExoArmor extends ArmorCore | ||
{ | ||
String textureName; | ||
protected static final UUID speed = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CF"); //These are temporary. Do not use them in release | ||
protected static final UUID attack = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CE"); | ||
protected static final UUID health = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CD"); | ||
protected static final UUID knockback = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CC"); | ||
public ExoArmor(int id, EnumArmorPart part, String texture) | ||
{ | ||
super(id, 0, part); | ||
this.textureName = texture; | ||
this.setCreativeTab(TConstructRegistry.materialTab); | ||
} | ||
|
||
@Override | ||
public void registerIcons (IconRegister par1IconRegister) | ||
{ | ||
this.itemIcon = par1IconRegister.registerIcon("tinker:armor/" + textureName + "_" | ||
+ (this.armorType == 0 ? "helmet" : this.armorType == 1 ? "chestplate" : this.armorType == 2 ? "leggings" : this.armorType == 3 ? "boots" : "helmet")); | ||
} | ||
|
||
@Override | ||
public String getArmorTexture (ItemStack stack, Entity entity, int slot, int layer) | ||
{ | ||
return "tinker:textures/armor/" + textureName + "_" + layer + ".png"; | ||
} | ||
|
||
public void getSubItems (int par1, CreativeTabs par2CreativeTabs, List par3List) | ||
{ | ||
ItemStack armor = new ItemStack(par1, 1, 0); | ||
NBTTagCompound baseTag = new NBTTagCompound(); | ||
NBTTagList list = new NBTTagList(); | ||
|
||
list.appendTag(getAttributeTag("generic.attackDamage", "ExoAttack", 10.0, true, knockback)); | ||
list.appendTag(getAttributeTag("generic.movementSpeed", "ExoSpeed", 1.5, false, speed)); | ||
list.appendTag(getAttributeTag("generic.maxHealth", "ExoHealth", 10.0, true, health)); | ||
list.appendTag(getAttributeTag("generic.knockbackResistance", "ExoKnockback", 0.5, false, knockback)); | ||
|
||
baseTag.setTag("AttributeModifiers", list); | ||
armor.setTagCompound(baseTag); | ||
par3List.add(armor); | ||
} | ||
|
||
private NBTTagCompound getAttributeTag(String attributeType, String modifierName, double amount, boolean flat, UUID uuid) | ||
{ | ||
NBTTagCompound knockbackTag = new NBTTagCompound(); | ||
knockbackTag.setString("AttributeName", attributeType); | ||
knockbackTag.setString("Name", modifierName); | ||
knockbackTag.setDouble("Amount", amount); | ||
knockbackTag.setInteger("Operation", flat ? 0 : 1);//0 = flat increase, 1 = % increase | ||
knockbackTag.setLong("UUIDMost", uuid.getMostSignificantBits()); | ||
knockbackTag.setLong("UUIDLeast", uuid.getLeastSignificantBits()); | ||
return knockbackTag; | ||
} | ||
} |
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
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