APDevTeam / Movecraft

The original movement plugin for Paper. Reloaded. Again.
GNU General Public License v3.0
122 stars 79 forks source link

Wreck decay problems #480

Open MysteryTimeTrav opened 2 years ago

MysteryTimeTrav commented 2 years ago

Describe the bug A torpedo set with a MinHeightLimit that isn't low enough that that torpedo sinks and hits the ground or ocean floor when it runs out of range is immortal and does not release.

Basically, what happens is that the torpedo flies normally and then sinks when it reaches its max range. But it sinks down and stops at the MinHeightLimit set. But if it does not hit a block as it sinks, it sits floating in the air piloted and does not release itself unless replaced with air using world edit.

To Reproduce Steps to reproduce the behavior:

  1. Set a Torpedo like craft file to use Gravity and have a MinHeightLimit and MaxHeightLimit around sea level (The torpedo should fall into and sail across the surface of the water for a while normally)
  2. Launch the torpedo.
  3. Wait for it to run out of range
  4. Go to the torpedo
  5. Observe it sitting at the set MinHeightLimit
  6. Try to break it (It should be protected as a craft)
  7. /Craftreport to see that it's still a piloted craft.

Expected behavior The torpedo should probably be able to sink below its MinHeightLimit and/or should automatically release itself once it reaches the min height limit when sinking.

Screenshots 2021-12-16_22 31 08

Versions (please complete the following information):

Additional context Craft File:


maxSize: 7
minSize: 2
allowedBlocks: 
    - COAL_BLOCK

forbiddenBlocks:
    - BEDROCK

canCruise: true
cruiseOnPilot: true
focusedExplosion: true
mustBeSubcraft: true
cruiseSkipBlocks: 1
cruiseSpeed: 7.5
canFly: false
minHeightLimit: 60
maxHeightLimit: 62
useGravity: true
detectionMultiplier: 90.0
underwaterDetectionMultiplier: 35.0
collisionExplosion: 5.0
explodeOnCrash: 1.0
moveEntities: false
speed: 5.0
tryNudge: false
sinkPercent: 100.0
overallSinkPercent: 99.0
sinkSpeed: 5.0
passthroughBlocks:
    - kelp
    - kelp_plant
    - tall_seagrass
    - seagrass
    - bubble_column
    - cave_air
    - white_wool
    - orange_wool
    - magenta_wool
    - light_blue_wool
    - yellow_wool
    - lime_wool
    - pink_wool
    - gray_wool
    - light_gray_wool
    - cyan_wool
    - purple_wool
    - blue_wool
    - brown_wool
    - green_wool
    - red_wool
    - black_wool
    - barrier
    - air
flyblocks:
    COAL_BLOCK:
        - 10.0
        - 100.0
TylerS1066 commented 2 years ago

I suspect that a sinking craft can not bypass the minHeightLimit set in the type file.

TylerS1066 commented 2 years ago

There seem to be two things with this issue.

The first is whether or not sinking crafts should obey their min height limit. In previous versions I'm not sure the behavior here, since AP always ran our craft types with a min/max limit of the world limits (for the most part). I've created a separate issue to track this: #521.

The second is a problem in the handling of sinking crafts, and this part affects much more than just torpedoes, and likely won't get fixed until we can get around to rewriting wreck behavior (after much internal rewriting). I've updated the issue title to reflect this new direction for the issue.

TylerS1066 commented 2 months ago

Does this still affect the latest versions?