- Fougerite Compatibility
- All Versions
This library is included in Fougerite 1.0.8+
This is not a plugin!
Server owners scroll down.
If you are a Plugin Developer, and using PyCharm (And you installed IronPython) you already have the full library installed. You can work with those, but be warned. Some of the (folder) libraries cannot be imported. The only folder that I found working now is the encoding folder, since that uses the codecs.py file for import.
All the other single files can be imported.
To import a lib you have to do the following:
To make this Lib to be optional:
Json Example for Developers:
If you are a Server Owner:
If a Plugin Requires this library, the only thing you have to do is to place all the py files, with the encoding folder to:
Server/Save/Lib (Where you can find the Magma, JsPlugins and PyPlugins folder. Just create a new folder called Lib and paste all the files inside.)
That's all.
This is not a plugin!
Server owners scroll down.
If you are a Plugin Developer, and using PyCharm (And you installed IronPython) you already have the full library installed. You can work with those, but be warned. Some of the (folder) libraries cannot be imported. The only folder that I found working now is the encoding folder, since that uses the codecs.py file for import.
All the other single files can be imported.
To import a lib you have to do the following:
Python:
import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite
import sys
path = Util.GetRootFolder()
sys.path.append(path + "\\Save\\Lib\\")
import random #import nameoflib
Python:
Lib = True
try:
import random
except ImportError:
Lib = False # If the plugin couldn't import random It means the lib doesn't exist in the folder.
Json Example for Developers:
Python:
import sys
import json
obj = {"name":"balu","coords":{'x':1.1,'y':2.2,'z':3.3}}
jsonString = json.encode(obj)
pretty = json.makepretty(jsonString)
fromjson = json.decode(jsonString)
fromprettyjson = json.decode(pretty)
Server.Broadcast(fromjson["name"] + " @ " + str(fromprettyjson["coords"]))
If you are a Server Owner:
If a Plugin Requires this library, the only thing you have to do is to place all the py files, with the encoding folder to:
Server/Save/Lib (Where you can find the Magma, JsPlugins and PyPlugins folder. Just create a new folder called Lib and paste all the files inside.)
That's all.