mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-09-20 19:30:59 +02:00
Created Web API (markdown)
parent
6cdc1c3f15
commit
e50a9dd508
27
Web-API.md
Normal file
27
Web-API.md
Normal file
@ -0,0 +1,27 @@
|
||||
FAWE allows you to upload or download schematics from a compatible and configured webserver.
|
||||
|
||||
### Relevant config options
|
||||
```yml
|
||||
web:
|
||||
# I am already hosting a web interface for you here
|
||||
url: "http://empcraft.com/fawe/"
|
||||
```
|
||||
|
||||
### Website software
|
||||
https://github.com/boy0001/plotupload + custom style
|
||||
|
||||
### Uploading a clipboard
|
||||
If it returns null, it indicates the upload was unsuccessful.
|
||||
```Java
|
||||
URL url = FaweAPI.upload(clipboard, format);
|
||||
```
|
||||
|
||||
### Downloading:
|
||||
```Java
|
||||
URL base = new URL(Settings.WEB.URL);
|
||||
URL url = new URL(base, "uploads/" + uuid + ".schematic");
|
||||
ReadableByteChannel rbc = Channels.newChannel(url.openStream());
|
||||
InputStream in = Channels.newInputStream(rbc);
|
||||
// Load and paste the stream (assuming it's a schematic format) etc.
|
||||
EditSession editSession = ClipboardFormat.SCHEMATIC.load(file).paste(world, position, allowUndo, !noAir, (Transform) null);
|
||||
```
|
Loading…
Reference in New Issue
Block a user