This repository has been archived by the owner on Jun 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Tomachi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# CheckRegionIntersects | ||
|
||
![Java CI with Maven](https://github.com/jaoafa/MyMaid3/workflows/Java%20CI%20with%20Maven/badge.svg) | ||
![Support jdk](https://img.shields.io/badge/Support%20jdk-oraclejdk8-red.svg) | ||
![Author](https://img.shields.io/badge/Author%20MinecraftID-mine__book000-orange.svg) | ||
[![License](https://img.shields.io/github/license/jaoafa/CheckRegionIntersects)](https://github.com/jaoafa/CheckRegionIntersects/blob/master/LICENSE) | ||
|
||
[jao Minecraft Server](https://jaoafa.com)における、自治体申請時に既存自治体と交差していないかを調べるためのJavaアプリケーションです。 | ||
|
||
## 使い方 | ||
|
||
1. [Releases](https://github.com/jaoafa/CheckRegionIntersects/releases)から最新の`CheckRegionIntersects.jar`をダウンロード。 | ||
2. 比較する自治体の範囲情報を後述する[#範囲情報JSON構築](#範囲情報JSON構築)を使ってそれぞれ構築。 | ||
3. ダウンロード先フォルダをカレントディレクトリとしてターミナル(`cmd.exe`, `powershell.exe`...)を開き、`java -jar CheckRegionIntersects.jar <比較する範囲情報JSON1> <比較する範囲情報JSON2>`と実行。 | ||
4. 終了ステータスが0なら交差無し、1なら交差あり。 | ||
|
||
例: `爆新地`と`とまちー市`が交差しているか調べるならば(2020/07/19現在): | ||
|
||
```shell | ||
java -jar CheckRegionIntersects.jar [{"x":-513,"z":-512},{"x":-513,"z":512},{"x":512,"z":512},{"x":512,"z":-512}] [{"x":528,"z":-513},{"x":528,"z":512},{"x":1128,"z":512},{"x":1128,"z":-513}] | ||
``` | ||
|
||
※場合によっては各JSONをアポストロフィー(`'`)か何かで囲む必要があるかも。 | ||
|
||
## 範囲情報JSON構築 | ||
|
||
爆新地を例とした場合、以下は範囲情報。 | ||
|
||
```text | ||
#1 -513 -512 | ||
#2 -513 512 | ||
#3 512 512 | ||
#4 512 -512 | ||
``` | ||
|
||
これを以下のようなJSONに変換する。 | ||
|
||
```json | ||
[ | ||
{ | ||
"x": -513, | ||
"z": -512 | ||
}, | ||
{ | ||
"x": -513, | ||
"z": 512 | ||
}, | ||
{ | ||
"x": 512, | ||
"z": 512 | ||
}, | ||
{ | ||
"x": 512, | ||
"z": -512 | ||
} | ||
] | ||
``` | ||
|
||
これを1列のJSONにして引数として使う。 | ||
|
||
## ライセンス | ||
|
||
ライセンスは[MIT License](https://github.com/jaoafa/CheckRegionIntersects/blob/master/LICENSE)を適用します。 |