Open Parties and Claims

Open Parties and Claims

25M Downloads

Possibility to explicitly allow players to interact with seats on Create contraptions

Noire86 opened this issue ยท 16 comments

commented

Hello! I`ve found, that it is impossible to explicitly allow players to interact ONLY with Create contraption seat (e.g Train from server-claimed metro system).

If I do allow to interact with create:carriage_contraption - players can now grief the trains` schedule or intercept train controls.
When the interaction with train entity is prohibited - train schedule is secured, but players can not embark onto the train, and may fall out due to server ping or whatever reasons. I think it is vital to Create trains to embark players in place in order to sync the movement of the player and train contraption.

Is it (technically) possible to allow to interact with specific part of contraptions like seats?

Thanks in advance.

commented

It could get annoying to try to implement something like this. I'd probably have to disable the general entity protection for trains and protect every individual train interaction type other than with seats. Which means I'll have to keep track of every new type of interaction added to Create in the future, and no longer support many modded interaction types by default.
Alternatively, OPAC could try to predict and check whether every condition is met for an entity interaction to "have to" be a seat interaction, with its own ray trace and everything, but it shares similar issues of having to keep up with Create code changes and supporting less mods.

commented

Thanks, a very comprehensive response. I guess we have to ask Create authors to add specific seat embarking packet (similar to train controls packet) to be able to seamlessly implement OPAC protection for this.

commented

What is interesting for me - is the mechanism of determining a tile entity inside a carriage contraption, and how create allows us to open chests and more on a moving train. At first, I thought it was a kind of entity -> tile-entity redirection of interacting actions. But looking through code with a glance - didn't help :(

commented

If I remember correctly, the contraptions are basically their own "worlds". When you interact with one, I think it converts your position and rotation into the contraption's "world's" space and raytraces for blocks the same way it would in a regular world. They could actually allow all blocks to work inside contraptions, I'm not too sure why only specific hard-coded interactions are allowed. It's most likely for performance reasons though.

commented

Great news! Will be patiently waiting for new builds.
I will also create a separate issue for conductors and conductor entities.

commented

Maybe we can do something from another perspective? The only thing that is basically needed to be protected - is a conductor and its schedule. I tried conductor from Steam and rails, and somehow, it bypasses the strict chunk access to contraption. On the other side, the blaze burner conductor is protected by OPAC. Maybe it is possible to target only conductor entity?

commented

As for interacting with conductors, I think I might have missed another custom packet there.
Please create a separate issue on the tracker, if you can confirm that the conductor entities are protected from other interactions.

commented

It seems that any entity sat as a conductor to train bypasses the chunk protection. I used parrot as train operator, and I can freely grant a train schedule to it, bypassing the OPAC.

commented

It seems that any entity sat as a conductor to train bypasses the chunk protection. I used parrot as train operator, and I can freely grant a train schedule to it, bypassing the OPAC.

Are you sure you didn't disable the protection for those entities?

I decided to take a look at the contraption protection code again and realized that Create is using a custom packet for that, not regular entity interaction. And the packet contains the local coordinates of the block inside the contraption. So it actually shouldn't be too difficult to separate protection for seats, surprisingly.

commented

So it actually shouldn't be too difficult to separate protection for seats, surprisingly.

To explain this a little further. I basically forgot that in-contraption block interactions don't work through normal entity interaction, so I don't have to disable protection for that, so none of the problems I was worried about matter.

commented

Just to keep you informed, new issue have been created: #487

commented

Hi again! As long as conductor entity protection has been fixed for Arclight, Ive found some corresponding issue with train controls.

When you allow access for players to interact with train contraption entity - the train controls are available for players, hence, any player may interrupt the programmed schedule.

Is it possible to separate train controls operations, train replacement (and any other packet-based interaction) exclusively from the entity protection? To be exact, making a specific setting in the claim config.

Thanks again for your input!

commented

Basically, that`s the only issue (I hope the are no more of them under the hood) that disrupts the idea of safe public train system on multiplayer servers. ๐Ÿ˜

commented

I think I can drop the entity protection altogether when right click interacting with the contraption. If all goes well you'll be able to add train controls and seats as block exceptions instead.

commented

That would be great! Looking forward to try that workaround

commented

Hi! Just asking if you managed to add the aforementioned functionality ๐Ÿ˜‰

The train controls remain unprotected, while seats are available for interacton