Add textures for "Song Items" (#22)
This commit is contained in:
parent
83651896eb
commit
08e8a86b4b
4 changed files with 24 additions and 0 deletions
|
@ -15,8 +15,12 @@ public class SongItemUtils {
|
|||
public static final String SONG_DATA_KEY = "SongData";
|
||||
public static final String FILE_NAME_KEY = "FileName";
|
||||
public static final String DISPLAY_NAME_KEY = "DisplayName";
|
||||
public static final String MODEL_KEY = "CustomModelData";
|
||||
|
||||
public static ItemStack createSongItem(ItemStack stack, byte[] songData, String filename, String displayName) {
|
||||
NbtCompound songPlayerInitNbt = new NbtCompound();
|
||||
songPlayerInitNbt.putInt(MODEL_KEY, new Integer("751642938"));
|
||||
stack.setNbt(songPlayerInitNbt);
|
||||
NbtCompound songPlayerNbt = new NbtCompound();
|
||||
stack.setSubNbt(SONG_ITEM_KEY, songPlayerNbt);
|
||||
songPlayerNbt.putString(SONG_DATA_KEY, Base64.getEncoder().encodeToString(songData));
|
||||
|
|
13
src/main/resources/assets/minecraft/models/item/paper.json
Normal file
13
src/main/resources/assets/minecraft/models/item/paper.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/paper"
|
||||
},
|
||||
"overrides": [{
|
||||
"predicate": {
|
||||
"custom_model_data": 751642938
|
||||
},
|
||||
"model": "songplayer:item/song_item"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/paper",
|
||||
"layer1": "songplayer:item/song_item"
|
||||
}
|
||||
}
|
BIN
src/main/resources/assets/songplayer/textures/item/song_item.png
Normal file
BIN
src/main/resources/assets/songplayer/textures/item/song_item.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 150 B |
Loading…
Reference in a new issue