Skip to content

Add projectile trajectory calculation for player launching#16

Draft
DLandDS with Copilot wants to merge 6 commits into
devfrom
copilot/add-calculate-force-function
Draft

Add projectile trajectory calculation for player launching#16
DLandDS with Copilot wants to merge 6 commits into
devfrom
copilot/add-calculate-force-function

Conversation

Copilot AI commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

No force calculation existed for creating parabolic trajectories to land players at target locations.

Changes

  • New utility class: TrajectoryCalculator in org.rendang.plugin.core.util

    • calculateForce(Player, Block) - computes velocity vector using projectile motion equations
    • calculateForce(Location, Location) - overload for custom locations
    • calculateForceWithTime(...) - time-based variant for predictable flight duration
  • Physics implementation

    • Trajectory equation: y = x·tan(θ) - (g·x²)/(2·v²·cos²(θ))
    • Minecraft gravity: 0.08 blocks/tick²
    • Auto-selects launch angle based on target elevation
    • Target location: block center (0.5, 0.5) + 1 block above surface
  • Example command: /example launch demonstrates usage by launching player to targeted block

Usage

Block targetBlock = player.getTargetBlockExact(100);
Vector velocity = TrajectoryCalculator.calculateForce(player, targetBlock);
player.setVelocity(velocity);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.papermc.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/RendangPlugin/RendangPlugin org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/RendangPlugin/RendangPlugin org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits February 9, 2026 15:58
Co-authored-by: DLandDS <28994412+DLandDS@users.noreply.github.com>
Co-authored-by: DLandDS <28994412+DLandDS@users.noreply.github.com>
…ication

Co-authored-by: DLandDS <28994412+DLandDS@users.noreply.github.com>
Co-authored-by: DLandDS <28994412+DLandDS@users.noreply.github.com>
Co-authored-by: DLandDS <28994412+DLandDS@users.noreply.github.com>
Copilot AI changed the title [WIP] Add calculateForce function for player landing optimization Add projectile trajectory calculation for player launching Feb 9, 2026
Copilot AI requested a review from DLandDS February 9, 2026 16:05
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