I currently have a plugin that flips objects on their axes,but the problem is that the blocks are still facing the same direction even after the flip. How do I reverse the block direction on the relevant axis? Code: PHP: if($args[0] == "rotate") { if($args[1] == "x") { $this->structures[$player->getName()] = array_reverse($this->structures[$player->getName()]); $player->sendMessage("Successfully rotated save on " . $args[1] . " axis"); return true; } elseif($args[1] == "y") { foreach (array_keys($this->structures[$player->getName()]) as $block) { $this->structures[$player->getName()][$block] = array_reverse($this->structures[$player->getName()][$block]); } $player->sendMessage("Successfully rotated save on " . $args[1] . " axis"); return true; } elseif($args[1] == "z") { foreach (array_keys($this->structures[$player->getName()]) as $block) { foreach (array_keys($this->structures[$player->getName()][$block]) as $y) { $this->structures[$player->getName()][$block][$y] = array_reverse($this->structures[$player->getName()][$block][$y]); } } $player->sendMessage("Successfully rotated save on " . $args[1] . " axis"); return true; }
This code doesn't rotate objects? Or it works and doesn't rotate directions of objects such as stairs, slabs, vines, etc...?
It works and rotates locations of objects, but I don't know how to rotate directions of objects, so doors and stairs and furnaces and whatnot are a huge problem
Directions you change by changing block meta. I don't know how, you must test it or see some Block meta can be updated using PHP: Block->setDamage(int $meta);
BuilderTools refuses to work on my server for some reason, but I can easily write my own plugin to get block meta. Thanks for the tip!