Posted June 11, 20169 yr Hello, I have made a custom redstone named bluestone. It works perfectly except that it connect to redstone. Please reply if you know a sollution for this problem. My code: http://pastebin.com/a3hPY4BF http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 11, 20169 yr Author Noone have no idea how redstone works? http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 11, 20169 yr Well, I guess that before anyone is willing to help you, you should make your code readable. Try putting code-tags around your code, or better yet, put it to pastebin. Then we shall talk about your problem. Also, be patient. It has been 2 hours since you started this thread and you are already bumping it. If my post helped you, please press that "Thank You"-button to show your appreciation. Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding! Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.
June 11, 20169 yr Author Added pastebin link http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 11, 20169 yr Let me guess: Your problem is not that your block connects to redstone, but that redstone connects to your block. Am I correct? 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.
June 11, 20169 yr Author Proberly, is there a way to fix that? http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 11, 20169 yr Not easily. Redstone connects to anything that accepts power. 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.
June 12, 20169 yr Author I know what code that needs to be changed in the redstone class, I just need to override it in some way. http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 12, 20169 yr This is probably not the best way, but you could somehow stop redstone being registered as an item, and instead initialise it as a class you mak by cloning the redstone dust class and adding an exception somehow.
June 12, 20169 yr Author I created a new redstone class ModRedstone and added this code: Blocks.REDSTONE_DUST = new ModRedstone() But I gave me this error message: Can't convert from ModRedstone to BlockRedstone http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 12, 20169 yr Author I don't want it to connect to my block. protected static boolean canConnectTo(IBlockState blockState, @Nullable EnumFacing side, IBlockAccess world, BlockPos pos) { Block block = blockState.getBlock(); if (block == ModElements.bluestone_wire) { return true; } else if (Blocks.UNPOWERED_REPEATER.isSameDiode(blockState)) { EnumFacing enumfacing = (EnumFacing) blockState.getValue(BlockRedstoneRepeater.FACING); return enumfacing == side || enumfacing.getOpposite() == side; } if (block == Blocks.REDSTONE_WIRE) { return false; } else { return false; } } http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 12, 20169 yr Author The problem is that REDSTONE connect to bluestone not that bluestone connects to redstone, so that problem is that I can't change the redstone class. http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 12, 20169 yr Redstone won't connect to your block if you return false from Block#canConnectRedstone . This is what diesieben07 has been telling you. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
June 12, 20169 yr Author And how do I do that http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 12, 20169 yr Override the method in your class. It's not hard. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
June 12, 20169 yr Author Can you give me the code because the isn't any methoud canConnectToRedstone to override in the bloxk class that it extends http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 12, 20169 yr Nobody said anything about canConnectToRedstone , the method is called canConnectRedstone . Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
June 12, 20169 yr Author Thank you it now doesn't connect to redstone but now I have a bigger problem it doesn't connect to it self. How should I change the code so it doesn't check if the block can connect to redstone http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 12, 20169 yr Gosh, if only that method took in a World parameter that would let you check what block is at the location... 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.
June 12, 20169 yr Author So is it impossible ; c http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 12, 20169 yr No, you need to walk through the connecting process in the debugger and spot where one of your bluestone methods is making the decision. At that point, it should notice that it is looking at another block of itself and decide to connect rather than calling the canConnect method. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
June 13, 20169 yr Author Ok, I'll test it http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 13, 20169 yr Author I didn't find anything in the console so could you maybe send a example? http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
June 13, 20169 yr canConnectRedstone takes a World, a position, and a side as parameters. Using super duper fancy mathemagical logic, you can figure out which block is doing the asking and figure out whether that block is Bluestone or Redstone. It's almost like you'd take the side (possibly reverse it) and do World#getBlockState() on the position passed plus the side's (or its reversed cousin's) offset, then compare it to Bluestone. If bluestone, return true, else return false. The only tricky part will be figuring out whether the side passed was the direction that redstone is checking in ("I am looking north") or in the direction it's checking from ("I am interested in your south side"). It's most likely the latter. 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.
June 13, 20169 yr Author Ok... very confusing could you possibly help me more exactly what I need to do. Thank you very much for your answer http://i.imgur.com/J4rrGt6.png[/img] [Creator of mcrafterzz mod]
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.