Jump to content

energy framework-esque thing won't work and i can't figure out why it won't work


endershadow

Recommended Posts

I've tried my best to trouble shoot this, but I can't. does anyone know what I'm doing wrong with this? The problem is that when i right click it, it only updates itself, not the adjacent blocks. any help appreciated.

https://github.com/code-lyoko-modding/CodeLyokoMod/blob/master/matt/lyoko/entities/tileentity/TileEntityCable.java

https://github.com/code-lyoko-modding/CodeLyokoMod/blob/master/matt/lyoko/blocks/BlockCable.java

Link to comment
Share on other sites

Have you tried this mehtod?

 

public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {}

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

When that function is called its because one of its neighbors changed (think BUD).  When that happens, you can look at the neighboring blocks to try and see if the current block needs to change as well.

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

When that function is called its because one of its neighbors changed (think BUD).  When that happens, you can look at the neighboring blocks to try and see if the current block needs to change as well.

 

^^ My words (not quite) exactly :P

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

I'm not sure this would work because I'm only given the block ID of the block that changed. it doesn't provide the functionality I need. any other Ideas?

 

if(the ID passed == this.blockID) {
    look at all six neighbors
    if one of them has metadata I don't have
        make my metadata the same
}

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

I guess... I'll try it out and get back to you

 

The redstone wire code is good code to look at.

You can also take a peek at my sourcecode here.

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

Put a System.out.println("The onNeighbourChange method just got called!"); in the method. If you see the message (the writing in the speech marks) show up in the console, you know that it has been called.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Ahh, that is something different. The onNeighbourChange is called ONLY when the block next to it is removed/placed. Try reading through Block.java. It will hold the secret

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

You could try using a packet :/ though I am not sure if that is a good use for packets...

 

Though I guess you could "transmit" the data to the server, then send the same packet back to the client and take that data into the block you want.

 

This is just an idea of mine... Not sure if it will work.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Ahh, that is something different. The onNeighbourChange is called ONLY when the block next to it is removed/placed. Try reading through Block.java. It will hold the secret

 

That's not true.

world.setBlockMetadataWithNotify(...); takes an integer flag as its last parameter.  Pass a 3.

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

see? I told you :P

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Seriously, look at the source code for my phase stone.  It updates its neighbors just fine.

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

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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