-
Notifications
You must be signed in to change notification settings - Fork 0
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
35 changed files
with
199 additions
and
1 deletion.
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
114 changes: 114 additions & 0 deletions
114
src/main/java/mod/emt/harkenscythe/items/HSDyableArmor.java
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,114 @@ | ||
package mod.emt.harkenscythe.items; | ||
|
||
import mod.emt.harkenscythe.init.HSItems; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.inventory.EntityEquipmentSlot; | ||
import net.minecraft.item.EnumRarity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
|
||
public class HSDyableArmor extends HSArmor | ||
{ | ||
private static final String[] BLOODWEAVE_ARMOR_TEXTURES = new String[] {"harkenscythe:textures/models/armor/bloodweave_1.png", "harkenscythe:textures/models/armor/bloodweave_2.png", "harkenscythe:textures/models/armor/bloodweave_1_overlay.png", "harkenscythe:textures/models/armor/bloodweave_2_overlay.png"}; | ||
private static final String[] SOULWEAVE_ARMOR_TEXTURES = new String[] {"harkenscythe:textures/models/armor/soulweave_1.png", "harkenscythe:textures/models/armor/soulweave_2.png", "harkenscythe:textures/models/armor/soulweave_1_overlay.png", "harkenscythe:textures/models/armor/soulweave_2_overlay.png"}; | ||
private final int defaultColor; | ||
|
||
public HSDyableArmor(ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn, EnumRarity rarity, int defaultColor) | ||
{ | ||
super(materialIn, renderIndexIn, equipmentSlotIn, rarity); | ||
this.defaultColor = defaultColor; | ||
} | ||
|
||
public int getDefaultColor() | ||
{ | ||
return defaultColor; | ||
} | ||
|
||
@Override | ||
public boolean hasColor(ItemStack stack) | ||
{ | ||
return stack.getTagCompound() != null && stack.getTagCompound().hasKey("display", 10) && stack.getTagCompound().getCompoundTag("display").hasKey("color", 3); | ||
} | ||
|
||
@Override | ||
public int getColor(ItemStack stack) | ||
{ | ||
NBTTagCompound nbttagcompound = stack.getTagCompound(); | ||
|
||
if (nbttagcompound != null) | ||
{ | ||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); | ||
|
||
if (nbttagcompound1.hasKey("color", 3)) | ||
{ | ||
return nbttagcompound1.getInteger("color"); | ||
} | ||
} | ||
|
||
return getDefaultColor(); | ||
} | ||
|
||
@Override | ||
public void removeColor(ItemStack stack) | ||
{ | ||
NBTTagCompound nbttagcompound = stack.getTagCompound(); | ||
|
||
if (nbttagcompound != null) | ||
{ | ||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); | ||
|
||
if (nbttagcompound1.hasKey("color")) | ||
{ | ||
nbttagcompound1.removeTag("color"); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void setColor(ItemStack stack, int color) | ||
{ | ||
NBTTagCompound nbttagcompound = stack.getTagCompound(); | ||
|
||
if (nbttagcompound == null) | ||
{ | ||
nbttagcompound = new NBTTagCompound(); | ||
stack.setTagCompound(nbttagcompound); | ||
} | ||
|
||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); | ||
|
||
if (!nbttagcompound.hasKey("display", 10)) | ||
{ | ||
nbttagcompound.setTag("display", nbttagcompound1); | ||
} | ||
|
||
nbttagcompound1.setInteger("color", color); | ||
} | ||
|
||
@Override | ||
public boolean hasOverlay(ItemStack stack) | ||
{ | ||
return true; | ||
} | ||
|
||
@Override | ||
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) | ||
{ | ||
if (stack.getItem() == HSItems.bloodweave_hood || stack.getItem() == HSItems.bloodweave_robe || stack.getItem() == HSItems.bloodweave_pants || stack.getItem() == HSItems.bloodweave_shoes) | ||
{ | ||
if (type != null && type.equals("overlay")) | ||
{ | ||
return slot == EntityEquipmentSlot.LEGS ? BLOODWEAVE_ARMOR_TEXTURES[3] : BLOODWEAVE_ARMOR_TEXTURES[2]; | ||
} | ||
return slot == EntityEquipmentSlot.LEGS ? BLOODWEAVE_ARMOR_TEXTURES[1] : BLOODWEAVE_ARMOR_TEXTURES[0]; | ||
} | ||
else | ||
{ | ||
if (type != null && type.equals("overlay")) | ||
{ | ||
return slot == EntityEquipmentSlot.LEGS ? SOULWEAVE_ARMOR_TEXTURES[3] : SOULWEAVE_ARMOR_TEXTURES[2]; | ||
} | ||
return slot == EntityEquipmentSlot.LEGS ? SOULWEAVE_ARMOR_TEXTURES[1] : SOULWEAVE_ARMOR_TEXTURES[0]; | ||
} | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/harkenscythe/models/item/bloodweave_hood.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "harkenscythe:items/bloodweave_hood" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/harkenscythe/models/item/bloodweave_pants.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "harkenscythe:items/bloodweave_pants" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/harkenscythe/models/item/bloodweave_robe.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "harkenscythe:items/bloodweave_robe" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/harkenscythe/models/item/bloodweave_shoes.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "harkenscythe:items/bloodweave_shoes" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/harkenscythe/models/item/soulweave_hood.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "harkenscythe:items/soulweave_hood" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/harkenscythe/models/item/soulweave_pants.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "harkenscythe:items/soulweave_pants" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/harkenscythe/models/item/soulweave_robe.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "harkenscythe:items/soulweave_robe" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/harkenscythe/models/item/soulweave_shoes.json
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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "harkenscythe:items/soulweave_shoes" | ||
} | ||
} |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+1.52 KB
src/main/resources/assets/harkenscythe/textures/models/armor/bloodweave_1.png
Loading
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
+135 Bytes
...in/resources/assets/harkenscythe/textures/models/armor/bloodweave_1_overlay.png
Loading
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
+647 Bytes
src/main/resources/assets/harkenscythe/textures/models/armor/bloodweave_2.png
Loading
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
+135 Bytes
...in/resources/assets/harkenscythe/textures/models/armor/bloodweave_2_overlay.png
Loading
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
+1.17 KB
src/main/resources/assets/harkenscythe/textures/models/armor/soulweave_1.png
Loading
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
+135 Bytes
...ain/resources/assets/harkenscythe/textures/models/armor/soulweave_1_overlay.png
Loading
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
+666 Bytes
src/main/resources/assets/harkenscythe/textures/models/armor/soulweave_2.png
Loading
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
+135 Bytes
...ain/resources/assets/harkenscythe/textures/models/armor/soulweave_2_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.