Comments (13)
After read http://pluginbase.pocoo.org/ it seems that we need:
«Setuptools based plugins are very useful to extend libraries from other libraries.»
The way to go:
https://packaging.python.org/guides/creating-and-discovering-plugins/
The first approach must be the simplest one: "Using naming convention".
The goal is to discover the plugins installed, the ones called mcthings_, load them and make visible its things to be used (mcthings will be extended with the new things).
So mcthings will be extended in the app used by the system with the plugins installed. The plugin will reuse the mcthings framework and extend it with new things.
from mcthings.
Let's create a new package mcthings-drawings that it will add a new Thing called Sphere implemented using https://minecraft-stuff.readthedocs.io/en/latest/minecraftdrawing.html#minecraftstuff.MinecraftDrawing.drawSphere
If everything goes ok, we will add several new Things created using MinecraftDrawing. With it, we can create richer scenes!
from mcthings.
https://github.com/martinohanlon/minecraft-stuff/blob/master/LICENSE is MIT so great to reuse it!
from mcthings.
There are samples which you can use it as reference as https://pypi.org/project/flask-talisman/ With this plugin, when you are using Flask, it protects you against some attacks:
from flask import Flask
from flask_talisman import Talisman
app = Flask(__name__)
Talisman(app)
So the plugin changes the Flask behaviour, extending it. In our case, the code must be something like:
from mcthings.scene import Scene
from mcthings_drawing import Sphere
def main():
try:
mc = mcpi.minecraft.Minecraft.create(address=MC_SEVER_HOST, port=MC_SEVER_PORT)
Scene.server = mc
mc.postToChat("Building a scene with several things")
pos = mc.entity.getTilePos(mc.getPlayerEntityId(BUILDER_NAME))
pos.x += 1
sphere = Spehre(pos)
sphere.build()
from mcthings.
We have it: https://pypi.org/project/mcthings-drawing/0.0.1/
I am going to try to use all in a notebook!
from mcthings.
All have worked from a notebook as expected:
from mcthings.
And also the persistence works! We can load the scene from a file:
from mcthings.
The plan is to have another repository called mcthings_extra in which includes Things from the samples in:
https://github.com/arpruss/raspberryjammod-minetest/tree/master/raspberryjammod/mcpipy
We need to debug all of them, because for example, the castle.py example needs some fixes to work. And it does all block by block, which is pretty slow. But the result is great!
from mcthings.
Mostly done, I will close it once the mcthings-extra repo with some example is created.
from mcthings.
Probably the best thing is to merge mcthings_drawing in mcthings_extra, in order to have just one repo for third party Things! But it is a nice sample on howto create a library to extend McThings. So not sure yet. Let's think about it.
from mcthings.
Extra Things repository working!
from mcthings.
So in order to extend McThings there are two repository samples doing it. And using the extra things is as easy as included both libraries. So time to close this ticket!
from mcthings.
McThings Drawing has been included in McThings and removed the repository. So we have two repositories now, the core and the extras.
from mcthings.
Related Issues (20)
- Learn Vulcan API HOT 3
- Research Open Source Physics engines HOT 5
- Learn Computer Graphics HOT 1
- Research Ray Tracing HOT 11
- Explore the Cyrille Rossant Python Ray Tracer HOT 4
- Implement a Ray Cast renderer for McThings
- Test that McThings works with MC 1.16.1 HOT 2
- Create a Blender renderer for McThings
- Remove McDrawing reimplementing the Sphere
- Research resources pack in Minecraft HOT 4
- Research shaders in Minecraft HOT 1
- Research the use of textures inside Blender
- Research the use of shaders inside Blender
- Implement voxels collisions in Godot physics testbed HOT 14
- Create a Godot renderer for McThings
- vox2schematic - TypeError: to_nbt() takes 3 positional arguments but 4 were given HOT 1
- Test McThings with the last version of Minecraft HOT 2
- Research the migration from TravisCI to GitHub Actions HOT 1
- vox2schematic not working
- Implement McThings over Godot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcthings.