PlotSquared icon indicating copy to clipboard operation
PlotSquared copied to clipboard

Allow pistons to break blocks at borders

Open CommandDan opened this issue 3 years ago • 12 comments
trafficstars

Overview

Description

Pistons are now able to break blocks when pushing against a plot border or plot area border

Submitter Checklist

  • [x] Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • [x] Ensure that the pull request title represents the desired changelog entry.
  • [x] New public fields and methods are annotated with @since TODO.
  • [x] I read and followed the contribution guidelines.

CommandDan avatar Jul 16 '22 12:07 CommandDan

It does not affect the plot border. Nothing will be pushed outside the plot area as the block is broken when being pushed.

This change fixes the current issue that breakable blocks, in my situation sugarcane, next to the border can not be broken by pistons facing against the border.

It is currently possible to break these blocks using pistons as long as the breakable block is not the last in the row.

CommandDan avatar Jul 16 '22 15:07 CommandDan

Here are previews of the change Current behaviour New behaviour Top Bottom comparison

CommandDan avatar Jul 16 '22 16:07 CommandDan

Just realised where my change has a flaw. Am going on camping vacation so I won't be able to make the changes in the coming 2 weeks but will look at fixing it when I am back home.

But yea I see it would have an issue if the border contains a breakable block

CommandDan avatar Jul 16 '22 21:07 CommandDan

Oops forgot to remove comments

CommandDan avatar Jul 17 '22 06:07 CommandDan

Should be good now

CommandDan avatar Jul 17 '22 06:07 CommandDan

The change looks good now, but justification is needed still. Items dropped on the last block on the plot inevetibly land on the border or road, which possibly leads to unwanted side effects for servers. More feedback is needed.

NotMyFault avatar Jul 19 '22 21:07 NotMyFault

Yea that is true but wouldn't that be the case either way? I guess, if not working like that already, we can implement so blocks breaking keep their drops inside the plot or outside the area

CommandDan avatar Jul 20 '22 07:07 CommandDan

I like the idea - thanks CommandDan!

The change looks good now, but justification is needed still. Items dropped on the last block on the plot inevetibly land on the border or road, which possibly leads to unwanted side effects for servers. More feedback is needed.

Dropping items will not be the problem, I think. You can use the plot and way flags and the kill-road-items option.

With this change, the behavior of the piston looks more "normal".

RedstoneFuture avatar Jul 25 '22 20:07 RedstoneFuture

Np. And yeah that is what I meant for both points

CommandDan avatar Jul 25 '22 20:07 CommandDan

The change looks good now, but justification is needed still. Items dropped on the last block on the plot inevetibly land on the border or road, which possibly leads to unwanted side effects for servers. More feedback is needed.

What would you want to be done regards to the items?

If anything should be done

CommandDan avatar Aug 11 '22 12:08 CommandDan

The change looks good now, but justification is needed still. Items dropped on the last block on the plot inevetibly land on the border or road, which possibly leads to unwanted side effects for servers. More feedback is needed.

What would you want to be done regards to the items?

If anything should be done

I'd say, if kill-road-items is set to true in the config, kill the item when dropping onto the road / border. Not sure if the position of the final item can be predicted tbh - could be quite hard.

Otherwise, what might be unsafe, is dropping the item based on the first solid block underneath the piston retraction (Using dropItem instead of dropItemNaturally). Basically, accessing the Blocks from the event, calling getDrops on those and drop these in the middle of the lowest block. But feedback regarding that would be highly appreciated, as that solution isn't the best probably.

PierreSchwang avatar Aug 11 '22 21:08 PierreSchwang

Yea, I can add the check for kill-road-items

CommandDan avatar Aug 11 '22 23:08 CommandDan