FlansMods / FlansMod

Flan's Mod for Minecraft
Other
236 stars 151 forks source link

Planes are destroying bedrocks #1210

Closed ken1882 closed 4 years ago

ken1882 commented 4 years ago

Describe the bug

When plane wings collided with blocks the block will break also damaging the part, including bedrock

To Reproduce Steps to reproduce the behaviour:

  1. Using /fill to generate a bedrock plain
  2. Get a plane and put it on bedrock
  3. Wreck your plane
  4. Destroy bedrock and fall out of the world

Expected behaviour

Indestructible blocks should not be destroyed

Screenshots

Versions (please complete the following information)

Additional context

It seems already on TODO but I'll post it anyway. When the block hardness is -1, the damage factor should changed to much higher value like 100 and don't destroy the block EntityDriveable.java line 1334

// Attack the part
if(!attackPart(p.part, DamageSource.IN_WALL, 
    blockHardness * blockHardness * (float)speed) && TeamsManager.driveablesBreakBlocks) {

    // And if it didn't die from the attack, break the block
    // TODO: [1.12] Heck
    // playAuxSFXAtEntity(null, 2001, pos, Block.getStateId(state));

    if(!world.isRemote){
        WorldServer worldServer = (WorldServer)world;
        destroyBlock(worldServer, pos, getDriver(), true);
    }
}