Skip to content

Commit

Permalink
Update plugin cloning and directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
SilkePilon committed Dec 1, 2023
1 parent bd1b248 commit 072efc5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
20 changes: 18 additions & 2 deletions lodestone/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
import os
import shutil
import git

if os.path.isdir('plugins'):
try:
from lodestone.plugins import Base as plugins
except:
from .plugins import Base as plugins
else:
import lodestone
lodestone.bot.get_plugins()
if os.path.isdir('plugins'):
shutil.rmtree('plugins')
git.Repo.clone_from("https://github.com/the-lodestone-project/Plugins", "plugins")
try:
source_dir = 'plugins/plugins'
target_dir = 'plugins'

file_names = os.listdir(source_dir)

for file_name in file_names:
shutil.move(os.path.join(source_dir, file_name), target_dir)

shutil.rmtree('plugins/plugins')
except:
logger.warning("Plugins folder is empty!")
pass
try:
from lodestone.plugins import Base as plugins
except:
Expand Down
17 changes: 0 additions & 17 deletions lodestone/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,23 +1204,6 @@ def placeBlock(self, referenceBlock, faceVector, no_checks=False):
else:
self.placeBlockWithOptions(referenceBlock, faceVector, { "swingArm": "right" })

def get_plugins():
if os.path.isdir('plugins'):
shutil.rmtree('plugins')
git.Repo.clone_from("https://github.com/the-lodestone-project/Plugins", "plugins")
try:
source_dir = 'plugins/plugins'
target_dir = 'plugins'

file_names = os.listdir(source_dir)

for file_name in file_names:
shutil.move(os.path.join(source_dir, file_name), target_dir)

shutil.rmtree('plugins/plugins')
except:
logger.warning("Plugins folder is empty!")
pass



Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lodestone"
version = "0.0.51"
version = "0.0.52"
description = "🤖 Create Minecraft bots with a powerful, stable, and high level Python API."
authors = [
{ name = "Silke Pilon", email = "[email protected]" },
Expand Down

0 comments on commit 072efc5

Please sign in to comment.