New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifications to BlockBasePiston and an Orientation Event #192
Conversation
- tryExtend and canExtend methods modified - changed the y >= 255 to y >= world.getHeight()
Like it, should be added in! |
Currently only added to BlockPistonBase This will allow a hook to override placement orientation of an object Used in LittleBlocks to override piston orientation in LittleWorld
Apologies for the dual commits! |
Is it likely that this change will be made? If so I'll distribute LittleBlocks without the piston functionality temporarily until someone has the time to review and commit. |
Should be done, one of the guys that works on MCForge apparently said that they are preparing for somekind of big update. Also you should notify them to add it on their IRC: #minecraftforge |
hmmm. |
Sounds good do you know of some simple explanation for using the event bus? |
There are examples of it in Minecraft Forge, look em up! |
I've based my hook on the observer pattern, but Ill look how the event bus works and see if I can move it over. |
Hi guys! |
- Added BlockEvent - Added BlockOrientationEvent extends BlockEvent - Modified BlockPistonBase to post orientation event
As promised, I've now committed a better (advised) solution, an event that's posted on the orientation of the piston. This will allow manipulation of the orientation values used in calculating the facing of the piston via a handler. |
SHOULD get now pulled. |
Just had a thought. Should BlockOrientationEvent extend PlayerEvent instead?..... Hmmm.... Difficult to classify, since Blocks shouldn't technically be able to generate an event rather the Player is generating the event..... Hmmmm....... Thoughts? |
Go on the Minecraft Forge wiki and ask, Lex should be able to help you. |
Just to note the above modification will also work for BlockLog orientation |
- BlockPlacementEvent added - BlockOrientationEvent extends BlockPlacementEvent
That should be the final commit -.- I decided that a BlockEvent should come from a Living entity event. Although I suppose it can depend. Maybe the block was placed by a deployer..... |
Still not pulled... |
Last thing cpw said was 'we dont know what we're going to do about that one yet' |
I'm actually going to do what Malfunction did with his onBlockActivated hook. I'll add the event into ForgeHooks EDIT on second thoughts that hook does quite a different thing |
Can I get a confirmation on this PR please? |
You should sumbit it clean and then see if it will get pulled. |
Still it would be great to get confirmation before I do the work again. Rather than 'see' if it's pulled, will it get pulled if I resubmit. Doesn't help anyone doing uncecessary work after all. |
Cleaning up a PR so that it's a clean submission is not something I'd class as unnecessary, at all. JMHO. |
You don't have to resubmit the PR. You can just modify the branch to the state you want, and this PR will update. (Use git push -f if you're replacing commits.) |
tryExtend and canExtend methods modified
Added BlockEvent, BlockPlacementEvent and BlockOrientationEvent
Modified BlockPistonBase to post a BlockOrientationEvent int determineOrientation allowing mods to register a handler to intercept this event (that parses world, entity, x, y, z)
Note: this will currently allow Pistons and Logs to work corrently in the LittleBlocksMod without the base edit.