Skip to content

Commit

Permalink
Known Issue: Music Disc Texture Doesn't Show.
Browse files Browse the repository at this point in the history
  • Loading branch information
HyperHaxStudios committed Jun 19, 2023
1 parent 86f8fba commit 25351e2
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 4 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ repositories {
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
}

loom {
Expand Down Expand Up @@ -55,6 +56,8 @@ dependencies {
// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

//GeckoLib
modImplementation "software.bernie.geckolib:geckolib-fabric-1.19.4:4.1.1"
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public ModLootTableGenerator(FabricDataOutput dataOutput) {
public void generate() {
addDrop(ModBlocks.HYPER_IRON_BLOCK);

oreDrops(ModBlocks.HYPER_IRON_ORE, ModItems.RAW_HYPER_IRON);
oreDrops(ModBlocks.DEEPSLATE_HYPER_IRON_ORE, ModItems.RAW_HYPER_IRON);
addDrop(ModBlocks.HYPER_IRON_ORE, oreDrops(ModBlocks.HYPER_IRON_ORE, ModItems.RAW_HYPER_IRON));
addDrop(ModBlocks.DEEPSLATE_HYPER_IRON_ORE, oreDrops(ModBlocks.DEEPSLATE_HYPER_IRON_ORE, ModItems.RAW_HYPER_IRON));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ public void generateItemModels(ItemModelGenerator itemModelGenerator) {
itemModelGenerator.register(ModItems.RAW_HYPER_IRON, Models.GENERATED);
itemModelGenerator.register(ModItems.RING, Models.GENERATED);
itemModelGenerator.register(ModItems.HYPER_IRON_INGOT, Models.GENERATED);
itemModelGenerator.register(ModItems.MUSIC_DISC, Models.GENERATED);
}
}
6 changes: 6 additions & 0 deletions src/main/java/com/hyperhaxstudios/orthodox/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemGroups;
import net.minecraft.item.MusicDiscItem;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

import static com.hyperhaxstudios.orthodox.sound.ModSounds.SPACEDRONE;

public class ModItems {
public static final Item RING = registerItem("ring",
new Item(new FabricItemSettings()));
public static final Item RAW_HYPER_IRON = registerItem("raw_hyper_iron",
new Item(new FabricItemSettings()));
public static final Item HYPER_IRON_INGOT = registerItem("hyper_iron_ingot",
new Item(new FabricItemSettings()));
public static final Item MUSIC_DISC = registerItem("music_disc",
new MusicDiscItem(6, SPACEDRONE, new FabricItemSettings().maxCount(1), 132));

private static Item registerItem(String name, Item item) {
return Registry.register(Registries.ITEM, new Identifier(Orthodox.MOD_ID, name), item);
Expand All @@ -29,6 +34,7 @@ public static void addItemsToItemGroup() {

addToItemGroup(ModItemGroup.ORTHODOX, RAW_HYPER_IRON);
addToItemGroup(ModItemGroup.ORTHODOX, HYPER_IRON_INGOT);
addToItemGroup(ModItemGroup.ORTHODOX, MUSIC_DISC);
}

public static void addToItemGroup(ItemGroup group, Item item) {
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/hyperhaxstudios/orthodox/sound/ModSounds.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.hyperhaxstudios.orthodox.sound;

import com.hyperhaxstudios.orthodox.Orthodox;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;


public class ModSounds {
public static SoundEvent SPACEDRONE = registerSoundEvent("music_disc");





private static SoundEvent registerSoundEvent(String name) {
Identifier id = new Identifier(Orthodox.MOD_ID, name);
return Registry.register(Registries.SOUND_EVENT, id, SoundEvent.of(id));
}

}
5 changes: 3 additions & 2 deletions src/main/resources/assets/orthodox/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"item.orthodox.hyper_iron_ingot": "Hyper Iron Ingot",
"block.orthodox.hyper_iron_ore": "Hyper Iron Ore",
"block.orthodox.deepslate_hyper_iron_ore": "Deepslate Hyper Iron Ore",
"block.orthodox.hyper_iron_block": "Hyper Iron Block"

"block.orthodox.hyper_iron_block": "Hyper Iron Block",
"item.orthodox.music_disc": "Music Disc",
"item.orthodox.music_disc.desc": "SpaceDrone (Radio Edit) by HyperHax"
}
10 changes: 10 additions & 0 deletions src/main/resources/assets/orthodox/sounds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"music_disc": {
"sounds": [
{
"name": "orthodox:music_disc",
"stream": true
}
]
}
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/main/resources/data/minecraft/tags/items/music_discs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"orthodox:music_disc"
]
}
1 change: 1 addition & 0 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"fabricloader": ">=0.14.21",
"minecraft": "~1.19.3",
"java": ">=17",
"geckolib": ">=4.1.1",
"fabric-api": "*"
},
"suggests": {
Expand Down

0 comments on commit 25351e2

Please sign in to comment.