Skip to content

Commit

Permalink
fix: use the registry codec for sound event
Browse files Browse the repository at this point in the history
  • Loading branch information
SettingDust committed Dec 3, 2024
1 parent 0423412 commit da1c3c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/main/kotlin/settingdust/item_converter/ConvertRule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation
import net.minecraft.sounds.SoundEvent
import net.minecraft.world.item.ItemStack
import net.minecraftforge.registries.ForgeRegistries
import org.apache.commons.lang3.math.Fraction
import org.jgrapht.graph.SimpleDirectedWeightedGraph

Expand All @@ -31,7 +32,7 @@ data class ConvertRule(
instance.group(
MoreCodecs.ITEM_STACK.fieldOf("input").forGetter { it.input },
MoreCodecs.ITEM_STACK.listOf().fieldOf("output").forGetter { it.output },
SoundEvent.CODEC.fieldOf("sound").forGetter { it.sound },
ForgeRegistries.SOUND_EVENTS.codec.fieldOf("sound").forGetter { it.sound },
Codec.FLOAT.fieldOf("pitch").forGetter { it.pitch },
Codec.FLOAT.fieldOf("volume").forGetter { it.volume },
Codec.BOOL.optionalFieldOf("bidirectional", false).forGetter { it.bidirectional }
Expand Down

0 comments on commit da1c3c5

Please sign in to comment.