Jump to content

Pushing Redstone


pitbox46

Recommended Posts

I am trying to make a mod that would use a redstone remote in order to remotely connect a redstone source block to a destination block. I have encountered issues because redstone in minecraft "pulls" from surrouding blocks and there doesn't seem to be a way to "push" redstone into a block. The only way I could think of is to set the state of the destination block to BlockStateProperties.POWERED, but the issue is that I'm pretty sure that I would have to set the state every tick because World.isBlockPowered(pos) would be false(unless the block is powered from another source). This solution seems suboptimal if it would even work at all. A better alternative would be to change World.java so that there is some way to set isBlockPowered(pos) or include an if statement inside the function that would check if the BlockPos should be powered. Another alternative would be to change the classes of the blocks themselves to include some logic that would check to see if the BlockPos should be powered. Either way around, I am not sure how to solve my problem without a core mod. I have looked at both reflection and dependency injection, but neither seem to help with modifying a source class that is called by other source classes. 

 

Any help is appreciated! 

Link to comment
Share on other sites

4 hours ago, diesieben07 said:

TL;DR: You can't.

Well, that sucks. Then I would have to use a core mod? I'm not too knowlegeable on core modding other than it is advised to use a different apporach and 99% of the time there is some better way. Would a purely additive core mod, a mod that only adds fields and classes, still cause issues with other mods? 

 

Also, is there a way to change the class of a minecraft block without registering an entirely new block? If I could simply make a subclass of a block's existing class, I could register the block as being a part of the new sub-class which would contain functionality for what I want to do. This would, of course, only apply the functionality to blocks that I make a new sub-class for. 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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