use of net.minecraft.item.IItemPropertyGetter in project Skree by Skelril.
the class LoadedBow method applyPropertyOverrides.
private void applyPropertyOverrides() {
this.addPropertyOverride(new ResourceLocation("skree", "pull"), new IItemPropertyGetter() {
@SideOnly(Side.CLIENT)
public float apply(ItemStack item, @Nullable World world, @Nullable EntityLivingBase living) {
if (living == null) {
return 0.0F;
} else {
ItemStack itemstack = living.getActiveItemStack();
return itemstack != null ? (item.getMaxItemUseDuration() - living.getItemInUseCount()) / 20.0F : 0.0F;
}
}
});
this.addPropertyOverride(new ResourceLocation("skree", "pulling"), new IItemPropertyGetter() {
@SideOnly(Side.CLIENT)
public float apply(ItemStack item, @Nullable World world, @Nullable EntityLivingBase living) {
return living != null && living.isHandActive() && living.getActiveItemStack() == item ? 1.0F : 0.0F;
}
});
}
Aggregations