0.1.1 Readme + liscence
This commit is contained in:
parent
11b8ea887a
commit
d224397c87
4 changed files with 38 additions and 19 deletions
2
LICENSE
Normal file
2
LICENSE
Normal file
|
@ -0,0 +1,2 @@
|
|||
Copyright (c) 2023 unurled
|
||||
All rights reserved.
|
35
Readme.md
Normal file
35
Readme.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Cutscenes
|
||||
|
||||
A minecraft plugin that makes cutscenes...
|
||||
|
||||
## How to use
|
||||
|
||||
### Create a cutscene
|
||||
|
||||
To create a cutscene, you need to create a folder in the `plugins/ScaredRealms/cutscenes` folder. The folder can be named anything, i recommend that the folder is the name of the cutscene.Inside this folder, make a file named `cutscene.yml`.
|
||||
Here's an example :
|
||||
```yaml
|
||||
name: "Cutscene name"
|
||||
id: "TUTORIAL"
|
||||
start: "world,10,10,10,5,5"
|
||||
end: "world,20,20,20,150,150"
|
||||
markers:
|
||||
- "1"
|
||||
- "2"
|
||||
- "3"
|
||||
```
|
||||
|
||||
A Location is composed of the world name, the x, y and z coordinates and the yaw and pitch.
|
||||
|
||||
The `name` is the name of the cutscene, the `id` is the id of the cutscene (must be without space and unique), the `start` is the start location of the cutscene, the `end` is the end location of the cutscene and the `markers` is a list of markers of the cutscene.
|
||||
Next create folders for each marker. In this example we have 3 markers, so we need to create 3 folders named `1`, `2` and `3`. In each folder, create a file named `marker.yml`. Here's an example :
|
||||
```yaml
|
||||
id: "1"
|
||||
cutscene_id: "tutorial"
|
||||
start: "world,10,10,10,5,5"
|
||||
timeBetweenFrames: "50"
|
||||
overAllTime: "25000"
|
||||
```
|
||||
|
||||
The `id` is the id of the marker (must be without space and unique), the `cutscene_id` is the id of the cutscene, the `start` is the start location of the cutscene, the `timeBetweenFrames` is the time between each frame in milliseconds and the `overAllTime` is the time of the cutscene in milliseconds.
|
||||
In this marker, every frames will be 50 miliseconds or 1 minecraft tick, due to a minecraft limitation we can't go under 1 tick or 50 milliseconds.
|
|
@ -8,7 +8,7 @@ plugins {
|
|||
}
|
||||
|
||||
group = 'me.unurled.sacredrealms'
|
||||
version = '0.1.0'
|
||||
version = '0.1.1'
|
||||
def minecraft_version = '1.20.1'
|
||||
|
||||
repositories {
|
||||
|
|
|
@ -73,24 +73,6 @@ public class MarkerParser {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
if (file.contains("frames")) { // frames: [ "0,world,x,y,z,yaw,pitch", "1,world,x,y,z,yaw,pitch", ... ]
|
||||
for (String frames : file.getStringList("markers")) {
|
||||
try {
|
||||
String[] frame = frames.split(",");
|
||||
x = Double.parseDouble(frame[2]);
|
||||
y = Double.parseDouble(frame[3]);
|
||||
z = Double.parseDouble(frame[4]);
|
||||
yaw = Float.parseFloat(frame[5]);
|
||||
pitch = Float.parseFloat(frame[6]);
|
||||
Location location = new Location(Bukkit.getWorld(frame[1]), x, y, z, yaw, pitch);
|
||||
marker.addFrame(new Frame(location, Integer.parseInt(frame[0])));
|
||||
} catch (Exception e) {
|
||||
Cutscenes.getLOGGER().error("Error while parsing cutscene " + id + " frame ID: " + frames + " " + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return marker;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue