Skip to content

Commit 8cc82c8

Browse files
Genau6502PotatoPresidentyitzy299
authored
Rewrite portals API to be better (#8)
* Intital work on portals refactor * Portal command work * Fix merge * More work on portals API * Add mkdocs Co-authored-by: PotatoPresident <potatoboy9999@outlook.com> Co-authored-by: yitzy299 <yitzy299@users.noreply.github.com>
1 parent a7783ce commit 8cc82c8

77 files changed

Lines changed: 2767 additions & 236 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release Documentation
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
docs:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Set up python 3
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.x
20+
- name: Install mkdocs
21+
run: pip install mkdocs-material
22+
- name: Set up git credentials
23+
uses: oleksiyrudenko/gha-git-credentials@v2-latest
24+
with:
25+
global: true
26+
token: ${{ secrets.USER_TOKEN }}
27+
- name: Deploy docs
28+
run: mike deploy --push --update-aliases ${{ github.event.release.tag_name }} latest

build.gradle

Lines changed: 81 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,105 @@ plugins {
55
id "org.jetbrains.kotlin.jvm"
66
}
77

8-
sourceCompatibility = JavaVersion.VERSION_16
9-
targetCompatibility = JavaVersion.VERSION_16
8+
allprojects {
109

11-
archivesBaseName = project.archives_base_name
12-
version = project.mod_version
13-
group = project.maven_group
10+
plugins.apply("fabric-loom")
1411

15-
repositories {
16-
maven {
17-
url = "https://maven.nucleoid.xyz"
18-
}
19-
maven {
20-
url = "https://oss.sonatype.org/content/repositories/snapshots"
21-
}
22-
maven {
23-
url = "https://maven.kyrptonaught.dev/"
24-
}
25-
}
12+
sourceCompatibility = JavaVersion.VERSION_16
13+
targetCompatibility = JavaVersion.VERSION_16
2614

27-
dependencies {
28-
// To change the versions see the gradle.properties file
29-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
30-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
31-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
15+
archivesBaseName = project.archives_base_name
16+
version = project.mod_version
17+
group = project.maven_group
3218

33-
// Fabric API
34-
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
35-
// FLK
36-
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
19+
repositories {
20+
maven {
21+
url = "https://maven.nucleoid.xyz"
22+
}
23+
maven {
24+
url = "https://oss.sonatype.org/content/repositories/snapshots"
25+
}
26+
maven {
27+
url = "https://maven.kyrptonaught.dev/"
28+
}
29+
}
3730

38-
modImplementation(include("xyz.nucleoid:fantasy:0.4.1+1.17"))
39-
modImplementation(include("me.lucko:fabric-permissions-api:0.1-SNAPSHOT"))
31+
dependencies {
32+
// To change the versions see the gradle.properties file
33+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
34+
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
35+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
4036

41-
modImplementation(include("net.kyrptonaught:customportalapi-serversideonly:0.0.1-beta1-1.17"))
42-
}
37+
// Fabric API
38+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
39+
}
4340

44-
processResources {
45-
inputs.property "version", project.version
41+
processResources {
42+
inputs.property "version", project.version
4643

47-
filesMatching("fabric.mod.json") {
48-
expand "version": project.version
44+
filesMatching("fabric.mod.json") {
45+
expand "version": project.version
46+
}
4947
}
50-
}
5148

52-
tasks.withType(JavaCompile).configureEach {
53-
// ensure that the encoding is set to UTF-8, no matter what the system default is
54-
// this fixes some edge cases with special characters not displaying correctly
55-
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
56-
// If Javadoc is generated, this must be specified in that task too.
57-
it.options.encoding = "UTF-8"
49+
tasks.withType(JavaCompile).configureEach {
50+
// ensure that the encoding is set to UTF-8, no matter what the system default is
51+
// this fixes some edge cases with special characters not displaying correctly
52+
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
53+
// If Javadoc is generated, this must be specified in that task too.
54+
it.options.encoding = "UTF-8"
5855

59-
// Minecraft 1.17 (21w19a) upwards uses Java 16.
60-
it.options.release = 16
61-
}
56+
// Minecraft 1.17 (21w19a) upwards uses Java 16.
57+
it.options.release = 16
58+
}
6259

63-
java {
64-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
65-
// if it is present.
66-
// If you remove this line, sources will not be generated.
67-
withSourcesJar()
68-
}
60+
java {
61+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
62+
// if it is present.
63+
// If you remove this line, sources will not be generated.
64+
withSourcesJar()
65+
}
6966

70-
jar {
71-
from("LICENSE") {
72-
rename { "${it}_${project.archivesBaseName}" }
67+
jar {
68+
from("LICENSE") {
69+
rename { "${it}_${project.archivesBaseName}" }
70+
}
7371
}
7472
}
7573

7674
// configure the maven publication
77-
publishing {
78-
publications {
79-
mavenJava(MavenPublication) {
80-
// add all the jars that should be included when publishing to maven
81-
artifact(remapJar) {
82-
builtBy remapJar
83-
}
84-
artifact(sourcesJar) {
85-
builtBy remapSourcesJar
75+
publishing {
76+
publications {
77+
mavenJava(MavenPublication) {
78+
// add all the jars that should be included when publishing to maven
79+
artifact(remapJar) {
80+
builtBy remapJar
81+
}
82+
artifact(sourcesJar) {
83+
builtBy remapSourcesJar
84+
}
8685
}
8786
}
88-
}
8987

90-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
91-
repositories {
92-
// Add repositories to publish to here.
93-
// Notice: This block does NOT have the same function as the block in the top level.
94-
// The repositories here will be used for publishing your artifact, not for
95-
// retrieving dependencies.
88+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
89+
repositories {
90+
// Add repositories to publish to here.
91+
// Notice: This block does NOT have the same function as the block in the top level.
92+
// The repositories here will be used for publishing your artifact, not for
93+
// retrieving dependencies.
94+
}
9695
}
97-
}
98-
compileKotlin.kotlinOptions.jvmTarget = "16"
96+
compileKotlin.kotlinOptions.jvmTarget = "16"
97+
98+
dependencies {
99+
// FLK
100+
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
101+
102+
modImplementation(include("xyz.nucleoid:fantasy:0.4.1+1.17"))
103+
modImplementation(include("me.lucko:fabric-permissions-api:0.1-SNAPSHOT"))
104+
105+
subprojects.forEach {
106+
implementation(project(":${it.name}"))
107+
include(project("${it.name}:")) // nest within distribution
108+
}
109+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Dimension Override Argument Type
2+
3+
A series of key/value pairs seperated by colons.
4+
5+
### Syntax example
6+
7+
`key:value second_key:second_value`
8+
9+
## Properties
10+
11+
`seed` - Long - World seed of the dimension. Generator specified seeds override this.
12+
13+
`type` - Dimension - Customises the appearance of the world (fog, sky colour, etc), but does not change any world generation
14+
15+
`generator` - Dimension - Sets the generator of the world to the same as the dimension specified
16+
17+
`custom_generator` - Boolean - Controls whether to use the generator specified with the [generator command](../commands/generator.md). Is overridden by `generator`
18+
19+
`difficulty` - (peaceful | easy | normal | hard) - Sets the difficulty in a world
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Generator Argument Type
2+
3+
This argument takes a series of properties in the format below:
4+
5+
`property:my_value key:value`
6+
7+
## Properties
8+
9+
`seed` - Long - Seed of generator
10+
11+
### Biome Source
12+
13+
Only one of these options can be specified at a time
14+
15+
`single_biome` - Biome (Identifier) - Sets generator to generate a world of one biome
16+
17+
`vanilla_layered` - Boolean - Sets generator to generate a world of normal vanilla biomes
18+
19+
`the_end_biome_source` - Boolean - Sets generator to generate a world of normal vanilla end biomes
20+
21+
`multi_noise_biome_source` - Boolean - Sets generator to multi noise biome source
22+
23+
`biome_seed` - Long - Sets biome generator to use seed specified
24+
25+
### World Options
26+
27+
`large_biomes` - Boolean - Sets generator to generate a world with larger biomes
28+
29+
`superflat` - Boolean - Sets generator to generate a superflat world
30+
31+
### Structures
32+
33+
`generate_structures` - Boolean - Controls whether to generate structures
34+
35+
`generate_strongholds` - Boolean - Controls whether to generate strongholds
36+
37+
`exclude_structures` - Structure List - Excludes structures included by `generate_structures` when set to true
38+
39+
`include_structures` - Structure List - Includes structures excluded by `generate_structures` when set to false
40+
41+
#### Structure List Format
42+
43+
Structure name, separated by commas
44+
45+
Examples:
46+
47+
`monument,buried_treasure`
48+
49+
`mineshaft`
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Portal Options Argument Type
2+
3+
## Syntax
4+
5+
This argument takes a series of properties in the format below:
6+
7+
`property:my_value key:value`
8+
9+
## Properties
10+
11+
`color`: Formatting - Color of the portal for when a compatible client mod is used
12+
13+
`flat`: Boolean - Whether the portal is horizontal or not

docs/commands/create.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Create Command
2+
3+
Handles the creation of custom dimensions
4+
5+
## Syntax
6+
7+
`/dim create <name: Identifier> <maplike: Dimension> [overrides: DimensionOverrideArgumentType]`
8+
9+
`name`: The Identifier of the dimension being created
10+
11+
`maplike`: An existing dimension to base the new one off
12+
13+
`overrides`: Key/value pairs of [Dimension Override Argument Type](../arguments/dimension_override_argument_type.md) values
14+
15+
## Permissions
16+
17+
Requires permission node `interdimensional.command.root` or permission level 3

docs/commands/delete.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Delete Command
2+
3+
Command for deleting worlds made by Interdimensional
4+
5+
Permission Node: `interdimensional.command.delete`
6+
7+
Fallback: Permission Level 4
8+
9+
## Arguments
10+
11+
`/dim delete <dimension>`
12+
13+
`dimension`: Identifier. Identifier of the custom dimension being deleted
14+
15+
## World recovery
16+
17+
In the event that you have accidentally deleted a world, please let us know on the discord. There is a way to recover worlds that have been accidentally deleted.

docs/commands/generator.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Generator Command
2+
3+
This command allows you to specify a custom chunk generator for use in the [create command](../commands/create.md)
4+
5+
## Syntax
6+
7+
`/dim generator <overrides: Generator Argument Type>`
8+
9+
The overrides the current selected chunk generator.
10+
11+
If the player has already specified a custom chunk generator, the command will modify the player's currently stored chunk generator. If the player does not have a custom generator stored already, the chunk generator of the current world will be modified.

docs/commands/portal.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Portal Command
2+
3+
`/dim portal [add | remove]`
4+
5+
## Add
6+
7+
`/dim portal add <name: String> <destination: Dimension> <frame_block: Block> [options: Portal Options Argument Type]`
8+
9+
`name`: The name of the portal link
10+
11+
`destination`: Where the portal should end up
12+
13+
`frame_block`: The block used in the frame of the portal
14+
15+
`options`: Additional options for portal creation. See [Portal Options Argument Type](../arguments/portal_options_argument_type.md)
16+
17+
## Remove
18+
19+
`/dim portal remove <name>`
20+
21+
Deletes the portal link with the name specified at the next restart

docs/commands/root.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Root Command
2+
3+
This is the root node for the `/dim` command
4+
5+
## Permissions
6+
7+
Requires permission node `interdimensional.command.root` or permission level 3

0 commit comments

Comments
 (0)