Jump to content

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


Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

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

Posted

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

Posted

well, does anyone know how to make my block "transmit" data to adjacent blocks of the same type. I seem to have found a good method of doing it, I just need to figure out how to get it to work. any ideas?

Posted

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

Posted

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.

Posted

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

Posted

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.

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.