Skip to content

Commit

Permalink
Add dynamic essence container textures
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Jun 4, 2024
1 parent 2d1a42b commit b17c212
Show file tree
Hide file tree
Showing 44 changed files with 249 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/mod/emt/harkenscythe/init/HSItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static void onRegisterModelsEvent(@Nonnull final ModelRegistryEvent event
{
if (item.getRegistryName().getNamespace().equals(HarkenScythe.MOD_ID))
{
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "normal"));
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mod.emt.harkenscythe.items;

import mod.emt.harkenscythe.HarkenScythe;
import mod.emt.harkenscythe.init.HSCreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/mod/emt/harkenscythe/items/HSEssenceKeeperBlood.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
package mod.emt.harkenscythe.items;

import javax.annotation.Nullable;
import mod.emt.harkenscythe.HarkenScythe;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class HSEssenceKeeperBlood extends HSEssenceKeeper
{
public HSEssenceKeeperBlood()
{
super();
setMaxDamage(40);
addPropertyOverride(new ResourceLocation(HarkenScythe.MOD_ID, "level"), new IItemPropertyGetter()
{
@SideOnly(Side.CLIENT)
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
{
return 1.0F - ((float) getDamage(stack) / getMaxDamage(stack));
}
});
}
}
18 changes: 18 additions & 0 deletions src/main/java/mod/emt/harkenscythe/items/HSEssenceKeeperSoul.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
package mod.emt.harkenscythe.items;

import javax.annotation.Nullable;
import mod.emt.harkenscythe.HarkenScythe;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class HSEssenceKeeperSoul extends HSEssenceKeeper
{
public HSEssenceKeeperSoul()
{
super();
setMaxDamage(20);
addPropertyOverride(new ResourceLocation(HarkenScythe.MOD_ID, "level"), new IItemPropertyGetter()
{
@SideOnly(Side.CLIENT)
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
{
return 1.0F - ((float) getDamage(stack) / getMaxDamage(stack));
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ public class HSEssenceVesselBlood extends HSEssenceKeeperBlood
public HSEssenceVesselBlood()
{
super();
setMaxDamage(80);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ public class HSEssenceVesselSoul extends HSEssenceKeeperSoul
public HSEssenceVesselSoul()
{
super();
setMaxDamage(40);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"textures": {
"layer0": "harkenscythe:items/essence_keeper"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,31 @@
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper"
}
}
},
"overrides": [
{
"predicate": {
"harkenscythe:level": 0.25
},
"model": "harkenscythe:item/essence_keeper_blood_025"
},
{
"predicate": {
"harkenscythe:level": 0.5
},
"model": "harkenscythe:item/essence_keeper_blood_050"
},
{
"predicate": {
"harkenscythe:level": 0.75
},
"model": "harkenscythe:item/essence_keeper_blood_075"
},
{
"predicate": {
"harkenscythe:level": 1
},
"model": "harkenscythe:item/essence_keeper_blood_100"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper_blood_025"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper_blood_050"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper_blood_075"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper_blood_100"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,31 @@
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper"
}
}
},
"overrides": [
{
"predicate": {
"harkenscythe:level": 0.25
},
"model": "harkenscythe:item/essence_keeper_soul_025"
},
{
"predicate": {
"harkenscythe:level": 0.5
},
"model": "harkenscythe:item/essence_keeper_soul_050"
},
{
"predicate": {
"harkenscythe:level": 0.75
},
"model": "harkenscythe:item/essence_keeper_soul_075"
},
{
"predicate": {
"harkenscythe:level": 1
},
"model": "harkenscythe:item/essence_keeper_soul_100"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper_soul_025"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper_soul_050"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper_soul_075"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_keeper_soul_100"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"textures": {
"layer0": "harkenscythe:items/essence_vessel"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,31 @@
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel"
}
}
},
"overrides": [
{
"predicate": {
"harkenscythe:level": 0.25
},
"model": "harkenscythe:item/essence_vessel_blood_025"
},
{
"predicate": {
"harkenscythe:level": 0.5
},
"model": "harkenscythe:item/essence_vessel_blood_050"
},
{
"predicate": {
"harkenscythe:level": 0.75
},
"model": "harkenscythe:item/essence_vessel_blood_075"
},
{
"predicate": {
"harkenscythe:level": 1
},
"model": "harkenscythe:item/essence_vessel_blood_100"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel_blood_025"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel_blood_050"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel_blood_075"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel_blood_100"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,31 @@
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel"
}
}
},
"overrides": [
{
"predicate": {
"harkenscythe:level": 0.25
},
"model": "harkenscythe:item/essence_vessel_soul_025"
},
{
"predicate": {
"harkenscythe:level": 0.5
},
"model": "harkenscythe:item/essence_vessel_soul_050"
},
{
"predicate": {
"harkenscythe:level": 0.75
},
"model": "harkenscythe:item/essence_vessel_soul_075"
},
{
"predicate": {
"harkenscythe:level": 1
},
"model": "harkenscythe:item/essence_vessel_soul_100"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel_soul_025"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel_soul_050"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel_soul_075"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/essence_vessel_soul_100"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b17c212

Please sign in to comment.