Jump to content

Help with drawing lines 1.10.2


xXWitherBossXx

Recommended Posts

Hi everyone! I am just wondering how to draw a line between 2 blocks. I'm making a laser mod, and I want to be able to see the lasers. Also, is there a way to let the block being hit with the laser know that it is being hit with a laser? For example, letting a mirror block know if a laser is hitting it, it's strength, color and size? Any help is very appreciated. 

Link to comment
Share on other sites

For the "block is hit by a laser" vanilla has no concept of lasers, so you would need to program some kind of interface or capability yourself.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Anything on how to render the lasers? I have no idea and I was looking at some other examples but they just render a line all the time. Also, for the block being hit by laser, I was thinking of using tile entities and sending data between tileentitys. Is this the right approach? 

Link to comment
Share on other sites

1 hour ago, xXWitherBossXx said:

Anything on how to render the lasers? I have no idea and I was looking at some other examples but they just render a line all the time. Also, for the block being hit by laser, I was thinking of using tile entities and sending data between tileentitys. Is this the right approach? 

A TileEntity is only needed if you need to store more information than metadata can provide. So no, it isn't.

 

As for rendering, I can offer this:

https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hazards/client/HazardsClientEventHandler.java#L371

It's old 1.7 code, but it's updatable as long as you know what you're doing.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.