thexaero / open-parties-and-claims

Minecraft mod that adds chunk claims and player parties
https://www.curseforge.com/minecraft/mc-mods/open-parties-and-claims
Other
42 stars 21 forks source link

(Fabric) Create train conductors are not protected against taking off train schedule #487

Open Noire86 opened 5 months ago

Noire86 commented 5 months ago

Hello! When Create trains are inside the protected chunk - any player may take off the conductors' train schedule, actually ruining the set up train scheme.

Steps to reproduce:

Key notes:

Thanks in advance!

thexaero commented 5 months ago

Thanks for reporting!

thexaero commented 5 months ago

So strange how I need to spam click the conductor to reproduce this. Was it the same for you?

Noire86 commented 5 months ago

Not really, single right-click i s enough to put off the schedule from conductor. Are you sure you are not using Blaze Burner?

Noire86 commented 5 months ago

I tried to upload a video of bug reproducing, but its sad that Github does not allow to upload video with more than 10mb of weight

thexaero commented 5 months ago

For me giving a conductor a schedule only works if I spam right click. Taking it works first try though.

thexaero commented 5 months ago

I think it's because I'm currently on 1.18.2. Anyway, I've noticed that there is just so much weird stuff going on with the forge event EntityInteractSpecific that they're using. It's absolutely broken on 1.18.2. It's not fired correctly, at the wrong time and with the wrong arguments. Looks fixed on newer forge versions, but I haven't tested it yet. What MC version are you using?

thexaero commented 5 months ago

Oh, wait, it was fixed on 1.18.2 too. Let me see what I can do with this now.

thexaero commented 5 months ago

Alright, seems to be completely fixed when using 40.2.5 or newer on 1.18.2. I'll go check how other MC versions are affected.

Noire86 commented 5 months ago

I'm using Forge 1.20.1, by the way

thexaero commented 5 months ago

From looking at the 1.20.1 code, there should be no issue, but I haven't got to testing it yet.

thexaero commented 5 months ago

Alright, entity interaction protection works fine on 1.20.1 too for me. Are you sure the entity you're interacting with doesn't have a non-attack interaction exception? What mob specifically are you using?

Noire86 commented 5 months ago

You can use any animal, or Steam N Rails conductor guy.

Just seat them in front of train controls, and grant a schedule.

thexaero commented 5 months ago

I'm doing that obviously. Who are you yourself using specifically?

Noire86 commented 5 months ago

Also, grant a bypass for create:contraption_carriage to allow players interact with seats

Noire86 commented 5 months ago

My bad, it's create:carriage_contraption

thexaero commented 5 months ago

Can you please tell me what mob you are using as the conductor?

Noire86 commented 5 months ago

I'm doing that obviously. Who are you yourself using specifically?

Personally, I've used parrot and steam n rails guy.

thexaero commented 5 months ago

Alright, thanks! Was it a tamed parrot?

Noire86 commented 5 months ago

P.S: We can talk about details in discord, if you would like

Noire86 commented 5 months ago

Alright, thanks! Was it a tamed parrot?

Not really, what I did was spawning a parrot from the egg and linking it with a leash. No taming whatsoever.

thexaero commented 5 months ago

I see. Can you please send me the main config file openpartiesandclaims-server.toml? I don't know about Discord. I'd prefer discussing it here in case I need to look up this issue in the future.

Noire86 commented 5 months ago

I see. Can you please send me the main config file openpartiesandclaims-server.toml? I don't know about Discord. I'd prefer discussing it here in case I need to look up this issue in the future.

No problem!

Speaking about config, here it is: openpartiesandclaims-server.toml.txt

thexaero commented 5 months ago

Thanks! Don't see any issues with the config. So strange how I was able to reproduce this on 1.18.2 because of a bug that shouldn't exist on 1.20.1. Pretty unexplainable at this point. What Forge version exactly are you using and what Create version exactly?

Noire86 commented 5 months ago

While I'm collecting the versions info, can you please clarify what's happened on your side?

You are not able to set or take off schedule from the conductor on a claimed chunk?

thexaero commented 5 months ago

On my side the protection works perfectly fine. I can only give or take the schedule when I have permission to do so in the claim. The only way to circumvent it for me is to drop the schedule on the station block.

Noire86 commented 5 months ago

Create: v0.5.1f Forge: 47.2.20

thexaero commented 5 months ago

Thanks, those are my versions too, so this is very strange. I'll have to take another look at this later. Have to go now.

Noire86 commented 5 months ago

On my side the protection works perfectly fine. I can only give or take the schedule when I have permission to do so in the claim. The only way to circumvent it for me is to drop the schedule on the station block.

Even if so, after allowing to interact with train contraption - there is still a possibility to take off the schedule from a conductor, or intercept train controls.

P.S Could it be the Arclight core issue? (Please don't hit me with sharp stones for that)

thexaero commented 5 months ago

P.S Could it be the Arclight core issue? (Please don't hit me with sharp stones for that)

Yes, I can now reproduce this when using Arclight. Going to investigate why that is.

thexaero commented 5 months ago

Alright, figured it out. They're overwriting a method completely, removing all of my injections. Looks like they're using a better approach in newer versions but I'm not entirely sure it works there either. Although I'm pretty sure I can now switch to using the Forge event instead of the injections, now that it has been fixed on Forge's end. Hopefully going to fix this issue too.

thexaero commented 5 months ago

Yep, seems to fix the issue.

Noire86 commented 5 months ago

Really, really thank you! That's great news!

HLHTHoldWind commented 2 months ago

This issue is still on fabric 1.20.1 version.

I only need to right click the conductor, openpac will pop a [Main hand] red warning, but I still stole the schedule and stop the train.

HLHTHoldWind commented 2 months ago

Fabric 0.15.11 Create 0.5.1f Opac 0.23.2 Opac create 1.6.0

thexaero commented 2 months ago

@HLHTHoldWind There's probably an exception enabled for whatever the entity is, e.g. a villager.

HLHTHoldWind commented 2 months ago

@HLHTHoldWind There's probably an exception enabled for whatever the entity is, e.g. a villager.

Untamed cat is also an exception?

HLHTHoldWind commented 2 months ago

@HLHTHoldWind There's probably an exception enabled for whatever the entity is, e.g. a villager.

I find only the blaze burner has been protected, you can steal schedules from any other conductors

thexaero commented 2 months ago

@HLHTHoldWind I don't know what exceptions you have configured. Test if you can interact with mobs in general and test interaction with armor stands.

HLHTHoldWind commented 2 months ago

@HLHTHoldWind I don't know what exceptions you have configured. Test if you can interact with mobs in general and test interaction with armor stands.

No, I can't interact with other mobs that not on the train (and armor stand). like I can't feed sheep in the claim. The only thing I can do in this claim is steal the train schedule from the mob conductor.

thexaero commented 2 months ago

@HLHTHoldWind Did you try interacting with other mobs with an empty hand? Conductors are just normal mobs, protected the same way as everything else. There is no reason for them to work differently. Did you actually test after I asked you?

HLHTHoldWind commented 2 months ago

@HLHTHoldWind Did you try interacting with other mobs with an empty hand? Conductors are just normal mobs, protected the same way as everything else. There is no reason for them to work differently. Did you actually test after I asked you?

2024-09-22_21 48 47 can't interact with empty hand

and, when stealing the train schedule, the warning will also pop, but will not protect the schedule

HLHTHoldWind commented 2 months ago

You need to spam click like 4~5 times to give the conductor schedule

But only one click can steal the schedule

HLHTHoldWind commented 2 months ago

@HLHTHoldWind Did you try interacting with other mobs with an empty hand? Conductors are just normal mobs, protected the same way as everything else. There is no reason for them to work differently. Did you actually test after I asked you?

I find also another interact method maybe similar with the schedule given or stolen - "Repair the iron golem using the iron ingot" use the iron ingot to repair the golem will also bypass the entity protection, probably the similar reason why I can steal the schedule

thexaero commented 2 months ago

@HLHTHoldWind Did you actually test armor stands? This won't make sense unless those are also not protected.

HLHTHoldWind commented 2 months ago

@HLHTHoldWind Did you actually test armor stands? This won't make sense unless those are also not protected.

2024-09-22_22 00 58 The armor stand

thexaero commented 2 months ago

@HLHTHoldWind Try taking something off it, e.g. a helmet.

HLHTHoldWind commented 2 months ago

2024-09-22_22 02 25 2024-09-22_22 02 15 I can't either take or put a helmet on it

HLHTHoldWind commented 2 months ago

Maybe the schedule is apply to the train instead of change the state of the conductor?

HLHTHoldWind commented 2 months ago

As I know, the train will automatically give the new conductor a schedule when there's a schedule on the train before (like the old conductor has been killed) Probably the schedule editing is apply to the train by create mod itself, instead of the change made by player

thexaero commented 2 months ago

@HLHTHoldWind Are you also using Arclight on the server?