-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block: (Walls) implement tall/short connections #6624
base: stable
Are you sure you want to change the base?
Conversation
src/block/Wall.php
Outdated
foreach(Facing::HORIZONTAL as $facing){ | ||
$block = $this->getSide($facing); | ||
if($block instanceof static || $block instanceof FenceGate || $block instanceof Thin || $block->getSupportType(Facing::opposite($facing)) === SupportType::FULL){ | ||
if(!isset($this->connections[$facing])){ | ||
$this->connections[$facing] = WallConnectionType::SHORT; | ||
if($this->getSide(Facing::UP)->getTypeId() == BlockTypeIds::AIR) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if($this->getSide(Facing::UP)->getTypeId() == BlockTypeIds::AIR) { | |
if($this->getSide(Facing::UP)->getTypeId() === BlockTypeIds::AIR){ |
I'm also fairly sure the logic for this is more complex than just checking for air.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill do some more testing but I haven't found any issues yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defiantly issues, will continue testing and implementing more logic for vertical connections
Yeah i'm working on it now, i'm implementing the logic from dragonfly. |
Fence::class => Facing::opposite($face) === Facing::DOWN || Facing::opposite($face) === Facing::UP, | ||
Hopper::class => Facing::opposite($face) === Facing::UP, | ||
Slab::class => $side->getSlabType() === SlabType::DOUBLE || ($side->getSlabType() === SlabType::TOP && Facing::opposite($face) === Facing::UP) || Facing::opposite($face) === Facing::DOWN, | ||
Stair::class => (!$side->isUpsideDown() && Facing::opposite($face) === Facing::DOWN) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No way, there has to be a better way than hardcoding logic for every block...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The supportType can probably be used here (juste the idea, i don't have checked)
Fence::class => Facing::opposite($face) === Facing::DOWN || Facing::opposite($face) === Facing::UP, | ||
Hopper::class => Facing::opposite($face) === Facing::UP, | ||
Slab::class => $side->getSlabType() === SlabType::DOUBLE || ($side->getSlabType() === SlabType::TOP && Facing::opposite($face) === Facing::UP) || Facing::opposite($face) === Facing::DOWN, | ||
Stair::class => (!$side->isUpsideDown() && Facing::opposite($face) === Facing::DOWN) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The supportType can probably be used here (juste the idea, i don't have checked)
if (!$connected){ | ||
if($side instanceof Wall || $side instanceof Thin) $connected = true; | ||
if($side instanceof FenceGate && $side->getFacing() === $face) $connected = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all in one if can be done here
Related issues & PRs
Behavioural changes
Changed how walls behave with block on top of them.
Tests