Skip to content

Commit e378d4f

Browse files
committed
Initial commit
1 parent f91e753 commit e378d4f

File tree

67 files changed

+5511
-0
lines changed

Some content is hidden

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

67 files changed

+5511
-0
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Automatically build the project and run any configured tests for every push
2+
# and submitted pull request. This can help catch issues that only occur on
3+
# certain platforms or Java versions, and provides a first line of defense
4+
# against bad commits.
5+
6+
name: build
7+
on: [pull_request, push]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
# Use these Java versions
14+
java: [
15+
1.8, # Minimum supported by Minecraft
16+
11, # Current Java LTS
17+
15 # Latest version
18+
]
19+
# and run on both Linux and Windows
20+
os: [ubuntu-20.04, windows-latest]
21+
runs-on: ${{ matrix.os }}
22+
steps:
23+
- name: checkout repository
24+
uses: actions/checkout@v2
25+
- name: validate gradle wrapper
26+
uses: gradle/wrapper-validation-action@v1
27+
- name: setup jdk ${{ matrix.java }}
28+
uses: actions/setup-java@v1
29+
with:
30+
java-version: ${{ matrix.java }}
31+
- name: make gradle wrapper executable
32+
if: ${{ runner.os != 'Windows' }}
33+
run: chmod +x ./gradlew
34+
- name: build
35+
run: ./gradlew build
36+
- name: capture build artifacts
37+
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS Java on one OS
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: Artifacts
41+
path: build/libs/

.github/workflows/checkstyle.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Checkstyle
2+
on:
3+
pull_request
4+
5+
jobs:
6+
checkstyle:
7+
name: Checkstyle
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Checkstyle
15+
uses: nikitasavinov/checkstyle-action@master
16+
with:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
checkstyle_config: 'checkstyle.xml'
19+
reporter: 'github-pr-check'
20+
level: 'warning'
21+
fail_on_error: 'true'
22+
tool_name: 'checkstyle'

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Gradle
2+
e/
3+
build/
4+
out/
5+
classes/
6+
.gradle/
7+
8+
# Eclipse
9+
*.launch
10+
11+
# IntelliJ IDEA
12+
.idea/
13+
*.iml
14+
*.ipr
15+
*.iws
16+
17+
# VS Code
18+
.settings/
19+
.vscode/
20+
bin/
21+
.classpath
22+
.project
23+
24+
# macOS
25+
*.DS_Store
26+
27+
# Fabric
28+
run/

LICENSE

Lines changed: 504 additions & 0 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
plugins {
2+
id 'fabric-loom' version '0.7-SNAPSHOT'
3+
id 'checkstyle'
4+
id 'maven-publish'
5+
}
6+
7+
sourceCompatibility = JavaVersion.VERSION_1_8
8+
targetCompatibility = JavaVersion.VERSION_1_8
9+
10+
archivesBaseName = project.archives_base_name
11+
version = "$project.mod_version+$project.minecraft_version"
12+
group = project.maven_group
13+
14+
repositories {
15+
maven { url 'https://jitpack.io' }
16+
}
17+
18+
dependencies {
19+
// To change the versions see the gradle.properties file
20+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
21+
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
22+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
23+
24+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
25+
26+
modApi "com.github.natanfudge:artifice:$project.artifice_version"
27+
include "com.github.natanfudge:artifice:$project.artifice_version"
28+
}
29+
30+
processResources {
31+
inputs.property 'version', project.version
32+
33+
filesMatching('fabric.mod.json') {
34+
expand 'version': project.version
35+
}
36+
}
37+
38+
tasks.withType(JavaCompile).configureEach {
39+
it.options.encoding = 'UTF-8'
40+
41+
def targetVersion = 8
42+
if (JavaVersion.current().isJava9Compatible()) {
43+
it.options.release = targetVersion
44+
}
45+
}
46+
47+
java {
48+
withSourcesJar()
49+
}
50+
51+
checkstyle {
52+
configFile = rootProject.file('checkstyle.xml')
53+
toolVersion = '8.31'
54+
}
55+
56+
jar {
57+
from 'LICENSE'
58+
}
59+
60+
// configure the maven publication
61+
publishing {
62+
publications {
63+
mavenJava(MavenPublication) {
64+
// add all the jars that should be included when publishing to maven
65+
artifact(remapJar) {
66+
builtBy remapJar
67+
}
68+
artifact(sourcesJar) {
69+
builtBy remapSourcesJar
70+
}
71+
}
72+
}
73+
74+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
75+
repositories {
76+
maven {
77+
name = 'GitHubPackages'
78+
url = uri('https://maven.pkg.github.com/TeamMotherlode/motherlode-base')
79+
credentials {
80+
username = project.findProperty('gpr.user') ?: System.getenv('GITHUB_USERNAME')
81+
password = project.findProperty('gpr.key') ?: System.getenv('GITHUB_TOKEN')
82+
}
83+
}
84+
}
85+
}

checkstyle.xml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
3+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
4+
<module name="Checker">
5+
<property name="charset" value="UTF-8"/>
6+
<property name="fileExtensions" value="java"/>
7+
<property name="localeLanguage" value="en"/>
8+
<property name="localeCountry" value="US"/>
9+
<property name="tabWidth" value="4"/>
10+
11+
<module name="NewlineAtEndOfFile"/>
12+
13+
<!-- disallow trailing whitespace -->
14+
<module name="RegexpSingleline">
15+
<property name="format" value="\s+$"/>
16+
<property name="message" value="Trailing whitespace"/>
17+
</module>
18+
19+
<!-- note: RegexpMultiline shows nicer messages than Regexp,but has to be outside TreeWalker -->
20+
<!-- disallow multiple consecutive blank lines -->
21+
<module name="RegexpMultiline">
22+
<property name="format" value="\n[\t ]*\r?\n[\t ]*\r?\n"/>
23+
<property name="message" value="Adjacent blank lines"/>
24+
</module>
25+
26+
<!-- disallow blank after { -->
27+
<!-- <module name="RegexpMultiline">
28+
<property name="format" value="\{[\t ]*\r?\n[\t ]*\r?\n"/>
29+
<property name="message" value="Blank line after '{'"/>
30+
</module> -->
31+
32+
<!-- disallow blank before } -->
33+
<module name="RegexpMultiline">
34+
<property name="format" value="\n[\t ]*\r?\n[\t ]*\}"/>
35+
<property name="message" value="Blank line before '}'"/>
36+
</module>
37+
38+
<!-- require blank before { in the same indentation level -->
39+
<module name="RegexpMultiline">
40+
<!-- the regex works as follows:
41+
It matches (=fails) for \n<indentation><something>\n<same indentation><control statement>[...]{\n
42+
while <something> is a single line comment,it'll look for a blank line one line earlier
43+
if <something> is a space,indicating a formatting error or ' */',it'll ignore the instance
44+
if <something> is a tab,indicating a continued line,it'll ignore the instance
45+
<control statement> is 'if','do','while','for','try' or nothing (instance initializer block)
46+
- first \n: with positive lookbehind (?<=\n) to move the error marker to a more reasonable place
47+
- capture tabs for <indentation>,later referenced via \1
48+
- remaining preceding line as a non-comment (doesn't start with '/','//',' ' or '\t') or multiple lines where all but the first are a single line comment with the same indentation
49+
- new line
50+
- <indentation> as captured earlier
51+
- <control statement> as specified above
52+
- { before the next new line -->
53+
<property name="format"
54+
value="(?&lt;=\n)([\t]+)(?:[^/\r\n \t][^\r\n]*|/[^/\r\n][^\r\n]*|[^/\r\n][^\r\n]*(\r?\n\1//[^\r\n]*)+)\r?\n\1(|(if|do|while|for|try)[^\r\n]+)\{[\t ]*\r?\n"/>
55+
<property name="message" value="Missing blank line before block at same indentation level"/>
56+
</module>
57+
58+
<!-- require blank after } in the same indentation level -->
59+
<module name="RegexpMultiline">
60+
<!-- \n<indentation>}\n<same indentation><whatever unless newline,'}' or starting with cas(e) or def(ault)> -->
61+
<property name="format"
62+
value="(?&lt;=\n)([\t]+)\}\r?\n\1(?:[^\r\n\}cd]|c[^\r\na]|ca[^\r\ns]|d[^\r\ne]|de[^\r\nf])"/>
63+
<property name="message" value="Missing blank line after block at same indentation level"/>
64+
</module>
65+
66+
<module name="TreeWalker">
67+
<!-- Ensure all imports are ship shape -->
68+
<module name="AvoidStarImport"/>
69+
<module name="IllegalImport"/>
70+
<module name="RedundantImport"/>
71+
<module name="UnusedImports"/>
72+
73+
<module name="ImportOrder">
74+
<property name="groups" value="java,javax,net.minecraft,net.fabricmc,motherlode,*"/>
75+
<property name="ordered"
76+
value="false"/><!-- the plugin orders alphabetically without considering separators.. -->
77+
<property name="separated" value="false"/>
78+
<property name="option" value="bottom"/>
79+
<property name="sortStaticImportsAlphabetically" value="false"/>
80+
</module>
81+
82+
<!-- Ensures braces are at the end of a line -->
83+
<module name="LeftCurly"/>
84+
<module name="RightCurly"/>
85+
86+
<module name="EmptyLineSeparator">
87+
<property name="allowNoEmptyLineBetweenFields" value="true"/>
88+
<property name="allowMultipleEmptyLines" value="false"/>
89+
<!-- exclude METHOD_DEF and VARIABLE_DEF -->
90+
<property name="tokens"
91+
value="PACKAGE_DEF,IMPORT,STATIC_IMPORT,CLASS_DEF,INTERFACE_DEF,ENUM_DEF,STATIC_INIT,INSTANCE_INIT,CTOR_DEF"/>
92+
</module>
93+
94+
<module name="OperatorWrap">
95+
<!-- Exclude QUESTION and COLON -->
96+
<property name="tokens"
97+
value="EQUAL,NOT_EQUAL,DIV,PLUS,MINUS,STAR,MOD,SR,BSR,GE,GT,SL,LE,LT,BXOR,BOR,LOR,BAND,LAND,TYPE_EXTENSION_AND,LITERAL_INSTANCEOF"/>
98+
</module>
99+
<module name="SeparatorWrap">
100+
<property name="tokens" value="DOT,ELLIPSIS,AT"/>
101+
<property name="option" value="nl"/>
102+
</module>
103+
<module name="SeparatorWrap">
104+
<property name="tokens" value="COMMA,SEMI"/>
105+
<property name="option" value="eol"/>
106+
</module>
107+
108+
<module name="Indentation">
109+
<property name="basicOffset" value="4"/>
110+
<property name="caseIndent" value="4"/>
111+
<property name="throwsIndent" value="4"/>
112+
<property name="arrayInitIndent" value="4"/>
113+
<property name="lineWrappingIndentation" value="4"/>
114+
</module>
115+
116+
<module name="ParenPad"/>
117+
<module name="NoWhitespaceBefore"/>
118+
<module name="NoWhitespaceAfter">
119+
<!-- allow ARRAY_INIT -->
120+
<property name="tokens" value="AT,INC,DEC,UNARY_MINUS,UNARY_PLUS,BNOT,LNOT,DOT,ARRAY_DECLARATOR,INDEX_OP"/>
121+
</module>
122+
<module name="WhitespaceAfter"/>
123+
<module name="WhitespaceAround">
124+
<!-- Allow PLUS,MINUS,STAR,DIV as they may be more readable without spaces in some cases -->
125+
<property name="tokens"
126+
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/>
127+
</module>
128+
<module name="SingleSpaceSeparator"/>
129+
<module name="GenericWhitespace"/>
130+
<module name="CommentsIndentation"/>
131+
132+
<module name="ArrayTypeStyle"/>
133+
<module name="DefaultComesLast">
134+
<property name="skipIfLastAndSharedWithCase" value="true"/>
135+
</module>
136+
<module name="SimplifyBooleanExpression"/>
137+
<module name="SimplifyBooleanReturn"/>
138+
<module name="StringLiteralEquality"/>
139+
140+
<module name="ModifierOrder"/>
141+
<module name="RedundantModifier"/>
142+
143+
<module name="AnnotationLocation"/>
144+
<module name="MissingOverride"/>
145+
146+
<!-- By default this allows catch blocks with only comments -->
147+
<module name="EmptyCatchBlock"/>
148+
149+
<module name="OuterTypeFilename"/>
150+
<module name="PackageDeclaration"/>
151+
<module name="PackageName">
152+
<property name="format"
153+
value="^motherlode\.[a-z]+(\.[a-z0-9]+)*$"/>
154+
</module>
155+
156+
<!--<module name="InvalidJavadocPosition"/>-->
157+
<module name="JavadocParagraph"/>
158+
<module name="JavadocStyle"/>
159+
<module name="AtclauseOrder">
160+
<property name="tagOrder" value="@param,@return,@throws,@deprecated"/>
161+
</module>
162+
</module>
163+
</module>

gradle.properties

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
org.gradle.jvmargs=-Xmx1G
2+
3+
# Fabric Properties
4+
# check these on https://modmuss50.me/fabric.html
5+
minecraft_version=21w11a
6+
yarn_mappings=21w11a+build.12
7+
loader_version=0.11.3
8+
9+
# Mod Properties
10+
mod_version = 1.1.0
11+
maven_group = motherlode
12+
archives_base_name = motherlode-base
13+
14+
# Dependencies
15+
fabric_version=0.34.2+1.17
16+
artifice_version=1.17-SNAPSHOT

gradle/wrapper/gradle-wrapper.jar

57.8 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)