So, i was working on a plugin and stumbled across a issue . I was trying to get the diode object to get a direction. I tried casting its materialdata (since diode extends materialdata) ...ect but it always ends up giving me a ClassCastException. I have a block which im sure is a "Diode off" material. Could anyone assist me in casting that to a diode object so that i can get its direction. Thanking you, Yugi
"Wanna get the Diode Object to get the direction" Eehh what? Maybe show us a small example of what you are trying, and your class stuff to understand what you tried so far.
Hmm the thing im trying was Code (Text): Diode d = (Diode)Block#getState().getData(); Also tried a few others such as, Code (Text): Diode d = (Diode)Block#getState(); Code (Text): Diode d = (Diode)Block; Currently not at home Ill post my listener once im home. Basically what i want to do with the diode is Diode#getfacing() So that i can assign that blockface to another diode. I was pretty sure that the proper way to cast the repeater to diode was the first once since the getData() returned MaterialData and Diode extends MaterialData. Also, im 100% sure that the block I am trying to cast is a repeater which is turned off.