Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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

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

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.

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

  • Author

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?

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.

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.

  • Author

I'm not sure if it worked or not, but I can't tell because onNeighborBlockChange isn't being called when it should. any idea on the problem now?

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

  • Author

ok, it calls the method, but only on block place/remove. how do I make it get called on right click.

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

  • Author

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?

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

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.

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

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.

  • Author

I got it work. I just had to use world.notifyBlocksOfNeighborChange(x, y, z, this.blockID);

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.