You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 15, 2023. It is now read-only.
You must have WorldEdit as a minimum but install the BTE modpack, it's preferable.
77
57
78
-
## Usage
58
+
##
59
+
60
+
# Installation
79
61
80
-
The only functionality is currently the railway tracks outline generation.
62
+
1. Download the [Rhino Javacsript interpreter](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino) for Java,
63
+
which you can get from [here](https://github.com/mozilla/rhino/releases/download/Rhino1_7_12_Release/rhino-1.7.12.zip).
64
+
Open the zip file, go to `/lib` and move `rhino-1.7.12.jar` (or newer) to your `mods` Minecraft folder.
65
+
(Usually `C:\Users\[USERNAME]\Twitch\Minecraft\Instances\Build The Earth modpack\mods` on Windows)
81
66
82
-
**[NOTE] The current way of doing things is a bit messy, to convert latitude and longitude to Minecraft coordinates a script
83
-
is run to enter commands very quickly in the game chat. We should find a way to get these coordinates with a function.
84
-
I already tried to translate the [java function](https://github.com/orangeadam3/terra121/blob/68ff27735ba447d6c9c017463e890eb90422569c/src/main/java/io/github/terra121/projection/ModifiedAirocean.java)
85
-
into javascript [here](./draw/tpll/tpll-node.js). It doesn't work,
86
-
if someone finds the problem I would be very grateful to him !**
67
+
2. Download the latest version of BTE-scripts [here](https://github.com/oganexon/BTE-tools/releases) and place the `craftscripts` folder in `/config/worldedit`.
87
68
88
-
### Installing the script
69
+
3. (Recommended) Change the value of `scripting-timeout` to `30000` or higher in `/config/worldedit`. (`3000` ms by default)
89
70
90
-
Before you start using CraftScripts, you’ll have to install the [Rhino JavaScript engine](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino).
91
-
A direct link to the download is [here](https://github.com/mozilla/rhino/releases/download/Rhino1_7_12_Release/rhino-1.7.12.zip).
92
-
Open the zip file, and extract `rhino-1.7.12.jar` (or newer).
93
-
Move `rhino-1.7.12.jar` to the plugins/ or plugins/WorldEdit folder (on Bukkit) or the mods folder (other platforms).
94
71
95
-
Once you have the JS engine installed, drop `draw.js` in the craftscripts folder (in the WorldEdit config folder - either plugins/WorldEdit or
96
-
config/WorldEdit depending on platform).
97
72
98
-
### Generating data using Overpass Turbo
73
+
##Usage
99
74
100
-
By using turbo overpass, you can view the selection directly. This is the recommended method.
75
+
```bash
76
+
/cs <COMMAND> [ARGS]
77
+
```
101
78
102
-
Use the [region request](http://overpass-turbo.eu/s/TwW) or the [name request](http://overpass-turbo.eu/s/TwY)
79
+
These are WorldEdit scripts, if blocks are modified you have access to `//undo`.
103
80
104
-
The region request is used to select every rail in the bounding box.
81
+
-**list** : Lists all available commands.
82
+
-**tpll** : Replaces the tpll command since permissions can be a problem.
83
+
-**tpdms** : Same as tpll but takes `degrees minutes seconds` (such as `47°35'6.32"N 6°53'50.06"E` ).
84
+
-**draw** : Traces any imported shape of an OpenStreetMap query - railroads, roads, etc.
105
85
106
-
The name request is used to select every rail of a defined line.
86
+
Do you need another function? Request it [here](https://github.com/oganexon/BTE-tools/issues).
107
87
108
-
To find a railway name, right click near the rails and click on `Query features`
109
88
110
-

111
89
112
-
Then, click on the desired rail
90
+
### list
113
91
114
-

92
+
```bash
93
+
/cs list
94
+
```
95
+
Lists all available commands.
115
96
116
-
And finally, get the name.
117
97
118
-

119
98
120
-
To get the correct data, click on `export` then `download/copy as GeoJSON`.
99
+
### tpll
121
100
122
-
### Generating data just with coordinates
101
+
```bash
102
+
/cs tpll <latitude><longitude> [altitude]
103
+
```
104
+
Replaces the tpll command since permissions can be a problem.
105
+
This modified version will take you to the highest block even if you've build already.
106
+
You don't need to remove the comma if there is one when you copy the coordinates.
123
107
124
-
Go on [OpenStreetMap](https://www.openstreetmap.org/) and select the region of interest.
108
+
Examples :
125
109
126
-
Take the coordinates of the lowest point on the right and the highest point on the left.
110
+
```bash
111
+
/cs tpll 47.58523 6.89725
112
+
/cs tpll 47.58523, 6.89725, 370
113
+
```
127
114
128
-
Put them in the config file (read the next paragraph).
129
115
130
-
### Converting data
131
116
132
-
Go to `./draw/src`
117
+
### tpdms
133
118
134
-
```sh
135
-
cd ./draw/src
119
+
```bash
120
+
/cs tpdms <latitude><longitude> [altitude]
136
121
```
122
+
Same as tpll but takes `degrees minutes seconds`
123
+
This modified version will take you to the highest block even if you've build already.
124
+
You don't need to remove the comma if there is one when you copy the coordinates.
137
125
138
-
Configure `config.json`:
139
-
140
-
```json
141
-
{
142
-
"block": "iron_block",
143
-
"logFile": "C:\\Users\\[USERNAME]\\Twitch\\Minecraft\\Instances\\Build The Earth modpack\\logs\\latest.log",
144
-
"output": "output.json",
145
-
"input": "input.json",
146
-
"overpass": false, // if true, will request data to the API with the following parameters
147
-
"requestType": "region",
148
-
"region": "47.6008,6.9398,47.6131,6.9569", // Coordinates retrieved with OpenStreetMap
149
-
"name": "LGV Rhin-Rhône",
150
-
"feature": "rails"// More to come
151
-
}
126
+
Examples :
127
+
128
+
```bash
129
+
/cs tpdms 47°35\'6.32"N 6°53\'50.06"E
130
+
/cs tpdms 47°35\'6.32"N, 6°53\'50.06"E, 370
152
131
```
153
132
154
-
If you used Overpass Turbo, put the geoJSON data in `draw/input.json`
155
133
156
-
You're all set. Open Minecraft, it will be used to convert coordinates.
157
134
158
-
```sh
159
-
node init.js
135
+
### draw
136
+
137
+
```bash
138
+
/cs draw <file><block> [options]
160
139
```
140
+
Traces any imported shape of an OpenStreetMap query - railroads, roads, etc.
161
141
162
-
Then, run convert.exe and select `temp.json`. You're asked to put a delay, if your computer is quite slow you should increase it.
163
-
After the warning, you have 2 seconds to click on Minecraft, then it will enter commands automatically.
142
+
Options :
143
+
-**u** (up): Draw a block above
164
144
165
-
When finished, run:
145
+
Setup :
146
+
- Create a `drawings` folder inside `/config/worldedit`.
147
+
- Get a geoJSON file of valid tracings / OR
148
+
- Choose one of the following links:
149
+
-[Rails - bounding box](http://overpass-turbo.eu/s/TwW) (Select the desired region using the map)
150
+
-[Rails - name](http://overpass-turbo.eu/s/TwY) (Replace with a specific railroad name) [(find a railroad name)](#find-a-railroad-name)
151
+
- Click `Run` > `Export` > `download/copy as GeoJSON`
152
+
- Place the file in the `drawings` folder.
166
153
167
-
```sh
168
-
node generate.js
154
+
Examples :
155
+
156
+
```bash
157
+
/cs draw rails1 iron_block
158
+
/cs draw file3 stone u
169
159
```
170
160
171
-
The process is over, copy `output.json` to `/drawings` in the `/worldedit` folder.
172
161
173
-
### Run the script in game
174
162
175
-
```sh
176
-
/cs draw output [block] [options]
177
-
```
163
+
## Find a railroad name
164
+
165
+
To find a railway name, right click near the rails and click on `Query features`
166
+
167
+

168
+
169
+
Then, click on the desired rail
170
+
171
+

172
+
173
+
And finally, get the name.
174
+
175
+

176
+
178
177
179
-
It should take a few seconds depending on data size. You should put `scripting-timeout` to a higher value like `30000`
180
-
in `worldedit.properties` to avoid timeout since it takes longer to compute the first time.
181
178
182
179
## Roadmap
183
180
184
181
See the [open issues](https://github.com/oganexon/BTE-tools/issues) for a list of proposed features (and known issues).
185
182
186
183
187
184
188
-
<!-- CONTRIBUTING -->
189
185
## Contributing
190
186
191
187
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
@@ -198,14 +194,12 @@ Contributions are what make the open source community such an amazing place to b
198
194
199
195
200
196
201
-
<!-- LICENSE -->
202
197
## License
203
198
204
199
Distributed under the MIT License. See `LICENSE` for more information.
0 commit comments