Closed Wertzui123 closed 2 years ago
This plugin doesnt provide fixes with any other plugins, yet if you look into some piston code you may see theres a code line to set blocks unmovable by pistons. You can make your own fork of this plugin and implement it easily.
I know, but there was a fix for FactionsPE to in another point!
That fix did not work.
Ok
But I hope tedo will fix it.
Think it would be easier if Jason blocks this in myplot.
You need a Redstone-MyPlot interaction plugin. I might make one when this plugin is released on Poggit.
Ok
Jason Reads Everything 😂 Step by Step my Friend 😉
No, I asked him in his discord xD
Releas the plugin so that jason makes a interacct pl xD
Put this on your server as a php file in the plugins folder. Be warned though, it depends on BlockEntityPistonArm::recalculatePushBlocks()
being modified to be public.
<?php
declare(strict_types=1);
/**
* @name RedstoneMyPlotHelper
* @main jasonwynn10\RedstoneMyPlotHelper\Main
* @version 0.1.0
* @api 3.0.0
* @description A plugin script which Helps interaction between pistons and plot borders
* @author jasonwynn10
* @depend RedstoneCircuit
*/
namespace jasonwynn10\RedstoneMyPlotHelper {
use MyPlot\MyPlot;
use pocketmine\block\Block;
use pocketmine\event\Listener;
use pocketmine\level\Position;
use pocketmine\plugin\PluginBase;
use pocketmine\tile\Tile;
use redstone\blockEntities\BlockEntityPistonArm;
class Main extends PluginBase implements Listener {
public function onEnable() {
$myPlot = $this->getServer()->getPluginManager()->getPlugin("MyPlot");
if(!$myPlot instanceof MyPlot)
return;
$redstone = $this->getServer()->getPluginManager()->getPlugin("RedstoneCircuit");
if(!$redstone instanceof \redstone\Main)
return;
if ($redstone->getCustomConfig()->isEnablePiston()) {
Tile::registerTile(HelperPistonArm::class, ["PistonArm", "minecraft:piston_arm"]);
}
}
}
class HelperPistonArm extends BlockEntityPistonArm {
public function onUpdate() : bool {
$piston = $this->getBlock();
/** @var Block[] $blocks */
$blocks = $this->recalculatePushBlocks();
if (count($blocks) == 0) {
$this->extend = false;
return true;
}
$face = $piston->getFace();
foreach($blocks as $block) {
$pos = Position::fromObject($block->asVector3()->getSide($face), $block->level);
if(MyPlot::getInstance()->isPositionBorderingPlot($pos))
return false;
}
return parent::onUpdate();
}
}
}
Thanks Jason, I'm really surprised now. I will try it. And hope the description is fun 😅
It won't work until RedstoneCircuit makes a certain method public.
I said that in my message
Thanks Jason, I'm really surprised now. I will try it. And hope the description is fun
I don't think he read it
day 3 of trying to find Jason's Discord tag to friend him without asking
jasonwynn10#4331
Do you can add "p set flag redstone true"
Oh no, I have noticed that pistons can edit the plot borders and the road if you use the plugin "MyPlot". It would be wonderfull if you can fix this because I think that many other people with a citybuild server would love pistons!