Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible for me to add playAudio function to version 1.89 #2081

Open
yusufarslan7 opened this issue Jan 30, 2025 · 2 comments
Open

Is it possible for me to add playAudio function to version 1.89 #2081

yusufarslan7 opened this issue Jan 30, 2025 · 2 comments

Comments

@yusufarslan7
Copy link

yusufarslan7 commented Jan 30, 2025

Hello, I'm playing with my friends on minecraft 1.12.2 so we are using cc version 1.89,

now we need to use the playAudio function but it's added in 1.100 ,

i'm not really experienced about modding so i want to ask that is it possible for me to manually add the sound functions, (the version we play has the speaker item but it might need some changes too)

if possible, how? if not, is there a workaround?

@zyxkad
Copy link
Contributor

zyxkad commented Jan 30, 2025

To add function, you need use the @LuaFunction annotation in the peripheral's class.
You can view other functions in CC:T as examples.

@SquidDev
Copy link
Member

SquidDev commented Jan 30, 2025

So this is possible, but it's also a lot of work, and so not something I'd recommend for someone starting off modding. An awful lot changed between Minecraft 1.12 and 1.16 (both for Minecraft itself, and CC:T), and so you'd have to implement most of the feature from scratch.

Some of this is relatively easy (as @zyxkad mentions, you need to register the peripheral function. Though not with @LuaFunction), but anything involving the actual playing of sounds will probably be quite difficult. The sound engine changed post 1.12, and so I think some of the integration with that will be quite different.

If you're just looking for a way to play music from a file, Computronics has a tape drive, that can play DFPWM audio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants