Skip to content

Commit f228eb5

Browse files
committed
Remove deprecated sound reference
1 parent 3144854 commit f228eb5

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/main/java/nourl/mythicmetals/armor/MythicArmorMaterials.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package nourl.mythicmetals.armor;
22

33
import io.wispforest.owo.registration.reflect.AutoRegistryContainer;
4-
import io.wispforest.owo.util.RegistryAccess;
54
import net.minecraft.item.*;
65
import net.minecraft.recipe.Ingredient;
76
import net.minecraft.registry.Registries;
@@ -227,7 +226,7 @@ public Class<ArmorMaterial> getTargetFieldType() {
227226
}
228227

229228
private static RegistryEntry<SoundEvent> sound(SoundEvent sound) {
230-
return RegistryAccess.getEntry(Registries.SOUND_EVENT, sound);
229+
return Registries.SOUND_EVENT.getEntry(sound);
231230
}
232231

233232
private static ArmorMaterial.Layer layer(String name) {

src/main/java/nourl/mythicmetals/item/tools/MythicTools.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
import net.minecraft.entity.player.PlayerEntity;
1010
import net.minecraft.item.*;
1111
import net.minecraft.potion.Potion;
12-
import net.minecraft.registry.Registries;
12+
import net.minecraft.registry.*;
13+
import net.minecraft.sound.SoundEvent;
1314
import net.minecraft.util.*;
1415
import nourl.mythicmetals.MythicMetals;
1516
import nourl.mythicmetals.armor.AquariumToolSet;
@@ -162,6 +163,7 @@ public void afterFieldProcessing() {
162163
RegistryHelper.item("banglum_tnt_minecart", BANGLUM_TNT_MINECART);
163164
RegistryHelper.item("doge", Frogery.DOGE);
164165
RegistryHelper.item("froge", Frogery.FROGE);
166+
Registry.registerReference(Registries.SOUND_EVENT, RegistryHelper.id("music_disc.dog4"), SoundEvent.of(RegistryHelper.id("music_disc.dog4")));
165167
RegistryHelper.item("red_aegis_sword", RED_AEGIS_SWORD);
166168
RegistryHelper.item("white_aegis_sword", WHITE_AEGIS_SWORD);
167169
RegistryHelper.item("carmot_staff", CARMOT_STAFF);
@@ -199,7 +201,7 @@ public ActionResult useOnEntity(ItemStack stack, PlayerEntity user, LivingEntity
199201
public static final Item DOGE = new Item(new Item.Settings()
200202
.rarity(Rarity.EPIC).fireproof()
201203
.equipmentSlot((entity, stack) -> EquipmentSlot.HEAD)
202-
.maxCount(1));
203-
//.component(DataComponentTypes.JUKEBOX_PLAYABLE, new JukeboxPlayableComponent()), 162);
204+
.maxCount(1)
205+
.jukeboxPlayable(RegistryKey.of(RegistryKeys.JUKEBOX_SONG, RegistryHelper.id("dog4"))));
204206
}
205207
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"comparator_output": 4,
3+
"description": {
4+
"translate": "jukebox_song.mythicmetals.doge"
5+
},
6+
"length_in_seconds": 162.0,
7+
"sound_event": "mythicmetals:music_disc.dog4"
8+
}

0 commit comments

Comments
 (0)