-
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
0 parents
commit 5fb3e1e
Showing
13 changed files
with
118 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) 2021 violine1101 | ||
|
||
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,45 @@ | ||
# MC-Region-Pregen | ||
|
||
A data pack for pregenerating larger regions in Minecraft | ||
|
||
## Usage | ||
|
||
1. Teleport to the lowest coordinates where the region starts | ||
2. Run `/function regiongen:start` | ||
3. Wait for the data pack to teleport you around | ||
4. Done! | ||
|
||
In order to stop the pregeneration prematurely, use `/function regiongen:stop`. | ||
|
||
## Configuration | ||
|
||
These configuration options are available: | ||
|
||
### Teleportation speed | ||
|
||
You can change the teleportation speed by using: | ||
|
||
``` | ||
/scoreboard players set stepLength regiongen <timeInTicks> | ||
``` | ||
|
||
The higher this value is, the slower the teleportation will go. | ||
|
||
The lower this value is, the more likely it is that your computer won't keep up with world generation. | ||
It is recommended to use lower values with low render distance (2-4 chunks). | ||
|
||
By default, the teleportation speed is 1 teleportation per second. | ||
|
||
### Region size | ||
|
||
You can change the size of the pregenerated region: | ||
|
||
``` | ||
/scoreboard players set xRegionSize regiongen <sizeInChunks> | ||
/scoreboard players set zRegionSize regiongen <sizeInChunks> | ||
``` | ||
|
||
By default, the region size is 32x32 chunks (size of a `.mca` file). | ||
|
||
## Drawbacks | ||
The current version of this pack only teleports one chunk at a time, meaning that it might take a long time for an entire region to be pregenerated. |
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,5 @@ | ||
{ | ||
"values": [ | ||
"regiongen:load" | ||
] | ||
} |
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,5 @@ | ||
{ | ||
"values": [ | ||
"regiongen:tick" | ||
] | ||
} |
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,8 @@ | ||
scoreboard objectives add regiongen dummy | ||
|
||
scoreboard players set xRegionSize regiongen 32 | ||
scoreboard players set zRegionSize regiongen 32 | ||
scoreboard players set curX regiongen 0 | ||
scoreboard players set curZ regiongen 0 | ||
scoreboard players set stepLength regiongen 20 | ||
scoreboard players set #nextStep regiongen 0 |
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,3 @@ | ||
tag @s add regiongen | ||
summon armor_stand ~ ~ ~ {Tags: [regiongen_as], NoGravity: 1b, Marker: 1b} | ||
execute as @e[tag=regiongen_as] at @s run forceload add ~ ~ |
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,2 @@ | ||
execute if score #nextStep regiongen >= stepLength regiongen run function regiongen:teleport | ||
scoreboard players add #nextStep regiongen 1 |
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,7 @@ | ||
tag @a remove regiongen | ||
scoreboard players set curX regiongen 0 | ||
scoreboard players set curZ regiongen 0 | ||
scoreboard players set #nextStep regiongen 0 | ||
|
||
kill @e[tag=regiongen_as] | ||
forceload remove all |
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,11 @@ | ||
execute unless score curX regiongen matches 0 run function regiongen:teleport_next_row | ||
execute if score curX regiongen matches 0 if score curZ regiongen matches 0 run function regiongen:teleport_next_row | ||
execute if score curX regiongen matches 0 unless score curZ regiongen matches 0 run function regiongen:teleport_next_col | ||
|
||
execute unless score curZ regiongen < zRegionSize regiongen run function regiongen:stop | ||
|
||
scoreboard players add curX regiongen 1 | ||
scoreboard players operation curX regiongen %= xRegionSize regiongen | ||
execute if score curX regiongen matches 0 run scoreboard players add curZ regiongen 1 | ||
|
||
scoreboard players set #nextStep regiongen 0 |
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,3 @@ | ||
execute as @e[tag=regiongen_as] at @s run tp @s ~ ~ ~16 | ||
execute as @a[tag=regiongen] run tp @s @e[tag=regiongen_as,limit=1,sort=nearest] | ||
execute as @e[tag=regiongen_as] at @s run forceload add ~ ~ |
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 @@ | ||
execute as @a[tag=regiongen] at @s run tp @s ~16 ~ ~ |
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 @@ | ||
execute if entity @a[tag=regiongen] run function regiongen:step |
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,6 @@ | ||
{ | ||
"pack": { | ||
"pack_format": 6, | ||
"description": "A data pack for pregenerating a certain region in the world" | ||
} | ||
} |