-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add teleport event for Meka Tool #517
Comments
When I get around to working on this would it be acceptable if instead of passing the Vec3, I just pass the target BlockPos? Basically passing this instead of creating say a new Vec3 object (and if you need it in Vec3 form allowing you to be the one creating the object rather than us creating one for it to just be GCd away without use if no one needs it. The from position, the post teleport position and the player should all be covered anyway as I am planning on just extending forge's |
The BlockHitResult extends HitResult so it already has a vec3 stored for the end location iirc. But if the blockPos will always be the clicked block and not the air block in front, then that will be fine. I had bad times with Forge's projectile impact event's vec3 randomly having the vec3 outside the bounds of the hit block when throwing pearls at a block which was fun to debug... |
Hmm unsure, but I will compare the existing Vec3 and BlockPos to see how they act. The one case where it won't would be when teleporting to no block is enabled at which point yes it may be air but that isn't one of the blocks you are interested in so then you would just ignore it as intended. |
I played a bit with the meka tool the other day and it looks like it is right click based and not actually projectile based. Would that mean I can use PlayerInteractEvent.RightClickItem and check for meka tool to see if it’s nbt contains the teleport module? And then do the raytrace myself? I guess that could work but I would need to know a reliable way to know if the meka tool is teleporting mode and how long the raytrace needs to be. But a meka tool event might still be better than this workaround |
I think a dedicated event would work better as while yes I believe you could use our existing API to query if the item has the module enabled, you might not have all the information accessible via it to calculate if it has enough energy to actually perform the teleport |
Describe the feature you'd like
For Bumblezone, I would like to be able to detect if a player uses the Meka Tool teleporting behavior on a Beehive/Beenest block.
First thing I need is a way to know the teleport event is for the Meka Tool (can be a sub event of Forge's Teleport event and I can subscribe to Mekanism's sub event in a dedicated mod compat fashion)
The second thing I need is the Vec3 position of the raytraced spot for the teleporting to so I can check around there to see if it right up against a beehive/beenest block.
Third thing I need is the entity using the Meka Tool so I can make it use my own teleportation code to send them into my dimension.
You can add other info into the event but as long as I get the 3 needs met, I should be good. I don't think I will cancel the Meka Tool teleporting so that the Meka Tool still gets drained of power and stuff
Describe alternatives you've considered
Pain and suffering of a mixin into another mod
Additional context
TelepathicGrunt/Bumblezone#213
The text was updated successfully, but these errors were encountered: