Skip to content

Commit

Permalink
Sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
miyucomics committed Jul 4, 2024
1 parent 6b294e7 commit e24aa54
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 4 deletions.
Binary file removed amethyst.png
Binary file not shown.
Binary file added media.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/main/java/miyucomics/hexical/registry/HexicalItems.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder
import net.minecraft.client.item.CompassAnglePredicateProvider
import net.minecraft.client.item.CompassAnglePredicateProvider.CompassTarget
import net.minecraft.client.item.ModelPredicateProviderRegistry
import net.minecraft.client.item.UnclampedModelPredicateProvider
import net.minecraft.client.world.ClientWorld
import net.minecraft.entity.Entity
import net.minecraft.entity.LivingEntity
import net.minecraft.item.BlockItem
import net.minecraft.item.Item.Settings
import net.minecraft.item.ItemGroup
Expand Down Expand Up @@ -52,6 +54,7 @@ object HexicalItems {

@JvmStatic
fun clientInit() {
ModelPredicateProviderRegistry.register(CONJURED_STAFF_ITEM, Identifier("sprite")) { stack: ItemStack, _: ClientWorld?, _: LivingEntity?, _: Int -> stack.orCreateNbt.getFloat("sprite") }
ModelPredicateProviderRegistry.register(CONJURED_COMPASS_ITEM, Identifier("angle"), CompassAnglePredicateProvider(CompassTarget { _: ClientWorld?, stack: ItemStack?, player: Entity? ->
if (player != null && stack != null && stack.hasNbt()) {
val nbt = stack.nbt!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"predicate": {
"angle": 0
},
"model": "hexical:item/conjured_compass"
"model": "hexical:item/conjured_compass_16"
},
{
"predicate": {
Expand Down Expand Up @@ -200,7 +200,7 @@
"predicate": {
"angle": 0.984375
},
"model": "hexical:item/conjured_compass"
"model": "hexical:item/conjured_compass_16"
}
]
}
18 changes: 16 additions & 2 deletions src/main/resources/assets/hexical/models/item/conjured_staff.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"parent": "minecraft:item/handheld_rod",
"textures": {
"layer0": "hexical:item/conjured_staff"
}
"layer0": "hexical:item/conjured_staff/staff"
},
"overrides": [
{
"predicate": {
"sprite": 0.5
},
"model": "hexical:item/conjured_staff_handbell"
},
{
"predicate": {
"sprite": 1
},
"model": "hexical:item/conjured_staff_key"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexical:item/conjured_staff/key"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexical:item/conjured_staff/handbell"
}
}
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 e24aa54

Please sign in to comment.