Jump to content

[1.6.4] Block playing a sound when powered (not working)


alphawolf918

Recommended Posts

Hello everyone. My friends and I have a 1.6.4 Tekkit server and I have been asked to make a mod using sirens that let off alarms when powered. Yes, I know that Atomic Science has this, but we want just the sirens from it and I've been able to do everything so far except get the sound to work. Right now either 1 of 2 things happens: either A.) it will play as soon as I set it down, without power, or B.) it will not play at all, even when it has power. Seems I can't find a happy medium between these two.

 

The current code can be found here: https://github.com/alphawolf918/SirenMod

 

Thank you in advance to anyone who helps, I just need help with this small thing and then I'll be good. I look forward to advice. Also, please no vague answers. If you don't know or don't want to 'waste your time with this', then please don't respond. I'm only interested in people that will actually give thorough advice. Thanks, again.

 

edit:: Nevermind, got it fixed.

http://www.dreamspand.com/

DreamSpand Gaming, a co-owned web site centered around Minecraft and its mods. We host servers and give out mods, plugins, schematics, saves, skins, and much more. Soon, we're going to have our server database synced to our site database. Then, a whole new plethora of possibilities will unveil themselves to us, at which time we will greet them with dedication and excitement.

 

We're very user-friendly and we love to help - no one will treat you badly. :)

Link to comment
Share on other sites

Hi

 

You are using static variables for the siren state.  That will for sure lead to problems.

Either remove the static, so eg your ironSirenOn and ironSirenOff have their own siren state, or combine ironSirenOn and ironSirenOff into a single ironSiren and use block metadata to store whether it is on or off.

 

You probably don't need the make your siren a BlockContainer either.  Just extend Block instead.

 

-TGG

Link to comment
Share on other sites

Alright, thank you very much. I will look into that. For now I have it working, but trust me I will definitely take your advice on that. Just gonna be a bit before I re-upload it to Git. Thanks again. :)

http://www.dreamspand.com/

DreamSpand Gaming, a co-owned web site centered around Minecraft and its mods. We host servers and give out mods, plugins, schematics, saves, skins, and much more. Soon, we're going to have our server database synced to our site database. Then, a whole new plethora of possibilities will unveil themselves to us, at which time we will greet them with dedication and excitement.

 

We're very user-friendly and we love to help - no one will treat you badly. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.