mods.shadowfacts.net/_includes/item.html

26 lines
836 B
HTML
Raw Permalink Normal View History

2017-05-08 23:02:29 +00:00
{% assign parts = include.item | split: "*" %}
{% if parts.size == 2 %}
{% assign count = parts[1] %}
{% else %}
{% assign count = "1" %}
{% endif %}
{% assign bits = parts[0] | split: ":" %}
{% if bits.size == 1 %}
{% assign modid = "minecraft" %}
{% assign name = bits[0] %}
{% assign meta = "0" %}
{% elsif bits.size == 2 %}
{% assign modid = bits[0] %}
{% assign name = bits[1] %}
{% assign meta = "0" %}
{% elsif bits.size == 3 %}
{% assign modid = bits[0] %}
{% assign name = bits[1] %}
{% assign meta = bits[2] %}
{% endif %}
{% assign data = site.data.sheets[modid][modid][name][meta] %}
<span class="mcitem" style="background-image: url(/img/sheets/{{ modid }}.png); background-position: -{{ data[0] }}px -{{ data[1] }}px;">
{% unless count == "1" %}
<span class="count">{{ count }}</span>
{% endunless %}
</span>