Skip to content

Commit

Permalink
add addon when calling icon on items to add item atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
12rcu committed Jan 18, 2024
1 parent eb56c97 commit 240b1bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/kotlin/com/lop/devtools/monstera/addon/item/Item.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.lop.devtools.monstera.addon.recipes.CraftingRecipe
import com.lop.devtools.monstera.files.beh.item.BehItem
import com.lop.devtools.monstera.files.beh.item.BehItemComponents
import com.lop.devtools.monstera.files.getUniqueFileName
import com.lop.devtools.monstera.files.res.ItemTextureIndex
import com.lop.devtools.monstera.files.res.items.ResItem
import java.io.File

Expand Down Expand Up @@ -40,14 +41,16 @@ class Item(val name: String, val displayName: String, private val addon: Addon)
texture.copyTo(target, true)
resItem.components {
icon(
"textures/items/monstera/${uniqueFilename.removeSuffix(".png")}"
name,
"textures/items/monstera/${uniqueFilename.removeSuffix(".png")}",
addon
)
}
}

fun vanillaTexture(texture: String, path: String = "textures/items/$texture") {
resItem.components {
icon(texture, path)
icon(texture, path, addon)
}
}

Expand Down

0 comments on commit 240b1bb

Please sign in to comment.