Posted January 11, 20196 yr Hi! I'm trying to make a block in my utility mod, that randomly generates another block from an array. My problem is that I use OpenTerrainGenerator for my "modpack" , so I don't need to write any worldGenerator. If it's placed via /setblock, /fill, or with hand, than it works fine. Is there a way to update this block without making a wGen for it? Thanks for helping! Edited January 12, 20196 yr by Legenes procedure WakeMeUp(Integer plusTime); var I: Integer; begin for I := 0 to plusTime do begin println('One more minute!'); Sleep(1000); end; println('Okay, nothing to worry, I''m alive!'); println('So... somebody can give me a coffee?'); println('I know it''s Pascal, and not Java, but I love it :D.'); end;
January 11, 20196 yr I believe that OnBlockPlacedIntoWorld is called after its placed by worldgen. 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.
January 12, 20196 yr Author Which version of forge has this method? I can't find it within my Block's class. EDIT: my forge version is: 14.23.5.2796. Edited January 12, 20196 yr by Legenes Missing version. procedure WakeMeUp(Integer plusTime); var I: Integer; begin for I := 0 to plusTime do begin println('One more minute!'); Sleep(1000); end; println('Okay, nothing to worry, I''m alive!'); println('So... somebody can give me a coffee?'); println('I know it''s Pascal, and not Java, but I love it :D.'); end;
January 12, 20196 yr Might've changed, I might've remembered wrong. public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) 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.
January 12, 20196 yr Author It's not working, but I think it's because OTG does not call the event. Maybe it's generation is different than the vanilla one. I think if I add a world generator myself (I didn't wanted but not a big deal), it will work. Thanks anyway! EDIT: Thanks @Draco18s, it worked with my own world generator code. Looks like OTG does not call that method. (Picture of the result: https://imgur.com/UyUkc6p) Edited January 12, 20196 yr by Legenes Closing topic. procedure WakeMeUp(Integer plusTime); var I: Integer; begin for I := 0 to plusTime do begin println('One more minute!'); Sleep(1000); end; println('Okay, nothing to worry, I''m alive!'); println('So... somebody can give me a coffee?'); println('I know it''s Pascal, and not Java, but I love it :D.'); end;
January 13, 20196 yr OTG shouldn't have to, its called by world.setBlockState() automatically. Ooh, never mind, Forge did things that make it not called. You could make your block declare that it has a tile entity (hasTileEntity returns true) but never actually supply one (returns from getTileEntity are null checked). That'd make onBlockAdded get called for your blocks. 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.
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.