Skip to content

Windfarer Integration - #63

Open
DerToaster98 wants to merge 39 commits into
Intybyte:masterfrom
TTE-DevTeam:TTE-Compat
Open

DerToaster98 wants to merge 39 commits into
Intybyte:masterfrom
TTE-DevTeam:TTE-Compat

Conversation

@DerToaster98

Copy link
Copy Markdown

Adds integration code for the Windfarer Movecraft derivate.

Needs to be tested, but it should work in theory. Sadly due to the fact that Movecraft and Windfarer share certain classes, a few little ugly workarounds are necessary.

Let me know what you think of it.

@Intybyte Intybyte left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nitpicks, also after you did testing let me know if everything works as expected, if yes I will merge, but not sure how much i can upkeep this section as i don't know your plugin like movecraft

Comment thread cannons-bukkit/pom.xml
Comment thread cannons-bukkit/src/main/java/at/pavlov/cannons/hooks/movecraft/MovecraftHook.java Outdated
}

// Check for cannon, if there is one, add it to ourselves
final Cannon atLocation = CannonManager.getInstance().getCannon(movecraftLocation.toBukkit(craft.getWorld()), playerCraft.getPilot().getUniqueId());

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember this call not always working but it was some time ago, so let me know after testing if everything works

Also as i was making the advanced schematic detection part of this logic was changed in favour of scanning all the cannons once at pilot and then moving the cannons at translation, maybe with added detection at creation if to add to the ship, so I will probably need to change this later regardless

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, is there a more reliable way? Also, are those methods safe to be accessed via multiple threads? The way i wrote the detection step it uses multithreading to split the workload and accelerate the step.

What that exact part does in short is that it detects the cannons on piloting as well (it adds an additonal step to detection), then validates what it found once the event fires (happens after it) and then uses the cached objects.

Are the Cannon objects always there or are they created and removed on demand?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of those methods delegate to the cannon manager class, which uses ConcurrentHashMap, so they should be threadsafe for the most part but I never double checked properly

@DerToaster98

Copy link
Copy Markdown
Author

A few nitpicks, also after you did testing let me know if everything works as expected, if yes I will merge, but not sure how much i can upkeep this section as i don't know your plugin like movecraft

Thank you for the review. I will begin with testing once your nitpicks have been adressed. As for maintenance, personally i think Movecraft doesn't have that much of a future, as far as I can tell from writing the integration here, Windfarer behaves mostly similar to Movecraft. I wrote the integration to make use of newer APIs and to make it more performant with Windfarer.

@Intybyte Intybyte left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More nitpicks after another review, after those it should be fine codewise

Comment thread cannons-bukkit/src/main/java/at/pavlov/cannons/hooks/movecraft/MovecraftHook.java Outdated
@Intybyte

Copy link
Copy Markdown
Owner

does this close #62 ? so i can link it

@DerToaster98

Copy link
Copy Markdown
Author

does this close #62 ? so i can link it

it potentially does, i have contact to that person, so, once i got cannons to build, i'll give them a test build as well

@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants