Dislocator bypasses EnderIO Inhibitor Obelisk
Dante-tLDS opened this issue ยท 14 comments
Base information
I was wondering if this could be a thing:
Can you make a way for the Dislocators to be intercepted by an EnderIO's Inhibitor Obelisk? Because so far, that's the only method of teleporting that bypasses it.
For short, the Obelisk prevents Ender-pearl like teleportation within it's active radius,
and anything just outside the radius that gets teleported will still be TP'd outside it's radius, even if the tp is random, like with Liquid Resonant Ender.
(and it just outright disables Ender-TP while used inside of its range)
- Minecraft version: 1.12.2
- Mod version: DE: 2.3.24.349, EIO: 5.1.51
- Minecraft Forge version: 14.23.5.2847
- Mod Pack: (if applicable): Personal Pack, irrelevant to issue.
Crash report
No crashes (apart from memory-caused, which is my own issue)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@HenryLoenwind using the EnderTeleportEvent gets a little tricky when you consider that the destination could be in another dimension.
The only possible way to make that work would be to teleport the player, fire the event and then teleport the player back if the event is canceled.
I can't think of a simple solution that does not involve something like adding a custom event to BC that you would have to listen for.
Hmm, what if using the dislocator chunk-loads the area intended to TP to, and if said destination is within the range of an active inhibitor, it cancels it? I also realize this while testing, you can't set a waypoint to a specific location that you haven't been in before, IE: You can't teleport within someones base having never been in their base to set the waypoint. This is important for me personally, and that's a good thing.
But let's assume that we have access to a location within the range. If cross-dimension, though I wonder if it would work the same in any dimension, before teleportation; have it check for an active radius. If there is one, cancel the TP. If the player is within said radius and tries using it, then have it simply not enable.
I hope this is a viable idea. @brandon3055 thank you for replying thus far btw =D
Or maybe..
What if upon using the Dislocator, it sends an ender-pearl(or similar) to the intended destination, and if it isn't automatically disabled by a field, it /tp's the player to that spot?
Only issue there is, /tp's work against the field, so if you tp to a spot outside of the field while within, it'll still let you /tp out of there...
Sorry if this sounds silly as heck, I have no major modding experience to know if this is possible.
Only one problem with the chunk-loading idea; assume the chunk directly next to the spot you're wanting to teleport contains the inhibitor. If normally you would be inhibited in that area, then it wouldn't be chunk loaded to check. There would have to be a delay before teleportation happens to make sure the chunks are loaded before teleporting, and I don't think that's going to happen.
I really like this idea, but I have no clue how it could be implemented easily on DE's side now that I'm actually thinking about the details.
Indeed, dimensional teleport cannot be handled using just Forge's events. We have a special event in our API (however, I must admit that I messed up the inhibitor implementation for it in one of the ports since 1.7; fixing that is on my todo list) because we also couldn't find a proper solution.
One could fire the Forge event with target=source, then move the entity and fire the event again a second time. (Inhibitor prevents teleporting in and out of an area.)
However, I don't expect anyone to jump through either hoop.
The main reason i dont allow you to set an arbitrary dislocator destination is that it would allow you to bypass all sorts of protections.
I could add something like this to my API https://gist.github.com/brandon3055/25221bd714233e03f10532ce6c0f237e
But mods like EIO would still have to go out of their way to implement it which isnt ideal. Not to mention that would be implemented in my teleport handler in BrandonsCore soo it would apply to all teleportation IN DE and any other mod where i use that teleport handler.
Hmm... I don't know if this is at all feasible, but if it isn't viable to code it in with what we have now, what if @brandon3055 created DE's own version of an inhibitor that works against Dislocators specifically?
That event looks exactly the same as ours ;)
That may be a sign to PR it into Forge. Anyone interested in doing that? I've been banned there...
What if, for the time being, you make it so that it only disables when in the immediate presence of an inhibitor? Like, if you have the coords, you can bypass an inhibitor and enter in a base. However - you cannot use the disclocator to exit back out. Thoughts?
That is very feasible, but it's still up to brandon3055 to decide if he wants to.
That sounds reasonable enough, and easy enough to implement. I might see if I can get this to work, but I'd want Brandon's permission first.
net.minecraftforge.event.entity.living.EnderTeleportEvent
Update: Minimal code example:
EnderTeleportEvent event = new EnderTeleportEvent(entity, x, y, z, 0);
if (MinecraftForge.EVENT_BUS.post(event)) {
return false;
}
entity.setPositionAndUpdate(event.getTargetX(), event.getTargetY(), event.getTargetZ());