Skip to content

Commit

Permalink
Remove deprecated sound reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Noaaan committed Aug 20, 2024
1 parent 3144854 commit f228eb5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package nourl.mythicmetals.armor;

import io.wispforest.owo.registration.reflect.AutoRegistryContainer;
import io.wispforest.owo.util.RegistryAccess;
import net.minecraft.item.*;
import net.minecraft.recipe.Ingredient;
import net.minecraft.registry.Registries;
Expand Down Expand Up @@ -227,7 +226,7 @@ public Class<ArmorMaterial> getTargetFieldType() {
}

private static RegistryEntry<SoundEvent> sound(SoundEvent sound) {
return RegistryAccess.getEntry(Registries.SOUND_EVENT, sound);
return Registries.SOUND_EVENT.getEntry(sound);
}

private static ArmorMaterial.Layer layer(String name) {
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/nourl/mythicmetals/item/tools/MythicTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.*;
import net.minecraft.potion.Potion;
import net.minecraft.registry.Registries;
import net.minecraft.registry.*;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.*;
import nourl.mythicmetals.MythicMetals;
import nourl.mythicmetals.armor.AquariumToolSet;
Expand Down Expand Up @@ -162,6 +163,7 @@ public void afterFieldProcessing() {
RegistryHelper.item("banglum_tnt_minecart", BANGLUM_TNT_MINECART);
RegistryHelper.item("doge", Frogery.DOGE);
RegistryHelper.item("froge", Frogery.FROGE);
Registry.registerReference(Registries.SOUND_EVENT, RegistryHelper.id("music_disc.dog4"), SoundEvent.of(RegistryHelper.id("music_disc.dog4")));
RegistryHelper.item("red_aegis_sword", RED_AEGIS_SWORD);
RegistryHelper.item("white_aegis_sword", WHITE_AEGIS_SWORD);
RegistryHelper.item("carmot_staff", CARMOT_STAFF);
Expand Down Expand Up @@ -199,7 +201,7 @@ public ActionResult useOnEntity(ItemStack stack, PlayerEntity user, LivingEntity
public static final Item DOGE = new Item(new Item.Settings()
.rarity(Rarity.EPIC).fireproof()
.equipmentSlot((entity, stack) -> EquipmentSlot.HEAD)
.maxCount(1));
//.component(DataComponentTypes.JUKEBOX_PLAYABLE, new JukeboxPlayableComponent()), 162);
.maxCount(1)
.jukeboxPlayable(RegistryKey.of(RegistryKeys.JUKEBOX_SONG, RegistryHelper.id("dog4"))));
}
}
8 changes: 8 additions & 0 deletions src/main/resources/data/mythicmetals/jukebox_song/dog4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"comparator_output": 4,
"description": {
"translate": "jukebox_song.mythicmetals.doge"
},
"length_in_seconds": 162.0,
"sound_event": "mythicmetals:music_disc.dog4"
}

0 comments on commit f228eb5

Please sign in to comment.