Init to comit it!
This commit is contained in:
30
.gitignore
vendored
Normal file
30
.gitignore
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# gradle
|
||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
out/
|
||||||
|
classes/
|
||||||
|
|
||||||
|
# eclipse and vscode
|
||||||
|
*.launch
|
||||||
|
.settings/
|
||||||
|
.vscode/
|
||||||
|
bin/
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
|
||||||
|
# intellij
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# apple
|
||||||
|
*.DS_Store
|
||||||
|
|
||||||
|
# run configurations / game data
|
||||||
|
run/
|
||||||
|
|
||||||
|
# local JDK override helpers
|
||||||
|
.jdks/
|
||||||
|
.env
|
||||||
|
*.log
|
||||||
7
.gitmodules
vendored
Normal file
7
.gitmodules
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[submodule "libs/forge-template"]
|
||||||
|
path = libs/forge-template
|
||||||
|
url = https://github.com/quat1024/modern-forge-1.12-template.git
|
||||||
|
[submodule "libs/MinecraftForge"]
|
||||||
|
path = libs/MinecraftForge
|
||||||
|
url = https://github.com/MinecraftForge/MinecraftForge.git
|
||||||
|
branch = 1.12.x
|
||||||
16
README.md
Normal file
16
README.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Vixi's Mod!
|
||||||
|
|
||||||
|
More to come!
|
||||||
|
|
||||||
|
Make sure you have the gitmodules!
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# Make sure you point to a valid version of the jdk8, i got mine from jdk8-openjdk
|
||||||
|
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
|
||||||
|
./gradlew genIntellijRuns # or genVSCodeRuns
|
||||||
|
./gradlew runClient
|
||||||
|
```
|
||||||
127
build.gradle
Normal file
127
build.gradle
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url = "https://maven.minecraftforge.net/" }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath group: "net.minecraftforge.gradle", name: "ForgeGradle", version: "5.1.+"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: "java"
|
||||||
|
apply plugin: "net.minecraftforge.gradle"
|
||||||
|
|
||||||
|
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
|
||||||
|
compileJava {
|
||||||
|
sourceCompatibility = "8"
|
||||||
|
targetCompatibility = "8"
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = "https://maven.minecraftforge.net/"
|
||||||
|
}
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
sidePatch {
|
||||||
|
transitive = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
|
// Pre-BUKKIT Side enum used to patch the mapped Forge jar for runs.
|
||||||
|
sidePatch "net.minecraftforge:mergetool:0.2.3.3"
|
||||||
|
}
|
||||||
|
|
||||||
|
minecraft {
|
||||||
|
mappings channel: mappings_channel, version: mappings_version
|
||||||
|
|
||||||
|
runs {
|
||||||
|
"client" {
|
||||||
|
workingDirectory file("./run")
|
||||||
|
mods { "${project.name}" { source sourceSets.main } }
|
||||||
|
}
|
||||||
|
|
||||||
|
"server" {
|
||||||
|
workingDirectory file("./run/server")
|
||||||
|
mods { "${project.name}" { source sourceSets.main } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
inputs.property "version", project.version
|
||||||
|
inputs.property "mcversion", minecraft_version
|
||||||
|
|
||||||
|
filesMatching("mcmod.info") {
|
||||||
|
expand "version": project.version, "mcversion": minecraft_version
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Forge 1.12 expects resources next to classes on the classpath.
|
||||||
|
sourceSets.all { it.output.resourcesDir = it.output.classesDirs.getFiles().iterator().next() }
|
||||||
|
|
||||||
|
// FG5 injects mergetool's Side.BUKKIT into the mapped Forge jar, which makes
|
||||||
|
// NetworkRegistry.newChannel NPE. Patch a project-local copy for run tasks.
|
||||||
|
// https://github.com/MinecraftForge/ForgeGradle/issues/748
|
||||||
|
def patchedForgeJar = file("${buildDir}/forge-patched/forge-mapped-no-bukkit.jar")
|
||||||
|
|
||||||
|
tasks.register("patchForgeSide") {
|
||||||
|
dependsOn configurations.minecraft
|
||||||
|
inputs.files(configurations.minecraft, configurations.sidePatch)
|
||||||
|
outputs.file(patchedForgeJar)
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
def forgeJar = configurations.minecraft.files.find {
|
||||||
|
it.name.contains("forge-") && it.name.contains("_mapped_") && it.name.endsWith(".jar")
|
||||||
|
}
|
||||||
|
if (forgeJar == null) {
|
||||||
|
throw new GradleException("Could not find mapped Forge jar on the minecraft configuration")
|
||||||
|
}
|
||||||
|
|
||||||
|
def sideSource = configurations.sidePatch.singleFile
|
||||||
|
def work = file("${buildDir}/forge-patched/work")
|
||||||
|
delete(work)
|
||||||
|
delete(patchedForgeJar)
|
||||||
|
work.mkdirs()
|
||||||
|
patchedForgeJar.parentFile.mkdirs()
|
||||||
|
|
||||||
|
ant.copy(file: forgeJar, tofile: patchedForgeJar, overwrite: true)
|
||||||
|
|
||||||
|
ant.unzip(src: sideSource, dest: work) {
|
||||||
|
patternset {
|
||||||
|
include(name: "net/minecraftforge/fml/relauncher/Side.class")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ant.jar update=true does not reliably replace entries; delete then add.
|
||||||
|
exec {
|
||||||
|
commandLine "zip", "-d", patchedForgeJar.absolutePath, "net/minecraftforge/fml/relauncher/Side.class"
|
||||||
|
ignoreExitValue = true
|
||||||
|
}
|
||||||
|
exec {
|
||||||
|
workingDir work
|
||||||
|
commandLine "zip", "-u", patchedForgeJar.absolutePath, "net/minecraftforge/fml/relauncher/Side.class"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.configureEach { task ->
|
||||||
|
if (task.name == "runClient" || task.name == "runServer") {
|
||||||
|
task.dependsOn("patchForgeSide")
|
||||||
|
task.doFirst {
|
||||||
|
def original = classpath.files.find {
|
||||||
|
it.name.contains("forge-") && it.name.contains("_mapped_") && it.name.endsWith(".jar")
|
||||||
|
}
|
||||||
|
if (original == null) {
|
||||||
|
throw new GradleException("Could not find mapped Forge jar on ${task.name} classpath")
|
||||||
|
}
|
||||||
|
classpath = files(classpath.files.collect { it == original ? patchedForgeJar : it })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
gradle.properties
Normal file
10
gradle.properties
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
org.gradle.jvmargs=-Xmx2G
|
||||||
|
|
||||||
|
group=com.vixis
|
||||||
|
name=vixis
|
||||||
|
version=0.1.0
|
||||||
|
|
||||||
|
minecraft_version=1.12.2
|
||||||
|
forge_version=14.23.5.2860
|
||||||
|
mappings_channel=stable
|
||||||
|
mappings_version=39-1.12
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
244
gradlew
vendored
Executable file
244
gradlew
vendored
Executable file
@@ -0,0 +1,244 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015-2021 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD=maximum
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "$( uname )" in #(
|
||||||
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
|
Darwin* ) darwin=true ;; #(
|
||||||
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
|
NONSTOP* ) nonstop=true ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
|
else
|
||||||
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD=java
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
|
case $MAX_FD in #(
|
||||||
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
|
warn "Could not query maximum file descriptor limit"
|
||||||
|
esac
|
||||||
|
case $MAX_FD in #(
|
||||||
|
'' | soft) :;; #(
|
||||||
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
|
# * args from the command line
|
||||||
|
# * the main class name
|
||||||
|
# * -classpath
|
||||||
|
# * -D...appname settings
|
||||||
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
92
gradlew.bat
vendored
Normal file
92
gradlew.bat
vendored
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
1
libs/MinecraftForge
Submodule
1
libs/MinecraftForge
Submodule
Submodule libs/MinecraftForge added at 3effde4f1f
12
libs/README.md
Normal file
12
libs/README.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Vendor libraries (git submodules)
|
||||||
|
|
||||||
|
| Path | Repo | Purpose |
|
||||||
|
|------|------|---------|
|
||||||
|
| `forge-template/` | [quat1024/modern-forge-1.12-template](https://github.com/quat1024/modern-forge-1.12-template) | Upstream FG5 / 1.12.2 build recipe reference |
|
||||||
|
| `MinecraftForge/` | [MinecraftForge/MinecraftForge](https://github.com/MinecraftForge/MinecraftForge) (`1.12.x`) | Forge source for browsing / reference |
|
||||||
|
|
||||||
|
Initialize after clone:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
1
libs/forge-template
Submodule
1
libs/forge-template
Submodule
Submodule libs/forge-template added at 344ade81f7
5
settings.gradle
Normal file
5
settings.gradle
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
plugins {
|
||||||
|
id "org.gradle.toolchains.foojay-resolver-convention" version "0.7.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = "vixis"
|
||||||
31
src/main/java/com/vixis/Vixis.java
Normal file
31
src/main/java/com/vixis/Vixis.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package com.vixis;
|
||||||
|
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
@Mod(
|
||||||
|
modid = Vixis.MODID,
|
||||||
|
name = Vixis.NAME,
|
||||||
|
version = Vixis.VERSION,
|
||||||
|
acceptedMinecraftVersions = "[1.12.2]"
|
||||||
|
)
|
||||||
|
public class Vixis {
|
||||||
|
public static final String MODID = "vixis";
|
||||||
|
public static final String NAME = "Vixis";
|
||||||
|
public static final String VERSION = "0.1.0";
|
||||||
|
|
||||||
|
public static final Logger LOGGER = LogManager.getLogger(MODID);
|
||||||
|
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
LOGGER.info("Vixis preInit ({})", event.getModMetadata().version);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
|
LOGGER.info("Vixis ready.");
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/main/java/com/vixis/advancement/VixisAdvancements.java
Normal file
30
src/main/java/com/vixis/advancement/VixisAdvancements.java
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package com.vixis.advancement;
|
||||||
|
|
||||||
|
import com.vixis.Vixis;
|
||||||
|
import net.minecraft.advancements.Advancement;
|
||||||
|
import net.minecraft.advancements.AdvancementProgress;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public final class VixisAdvancements {
|
||||||
|
public static final ResourceLocation KISS_A_FOX = new ResourceLocation(Vixis.MODID, "kiss_a_fox");
|
||||||
|
|
||||||
|
private VixisAdvancements() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void grant(EntityPlayerMP player, ResourceLocation id) {
|
||||||
|
Advancement advancement = player.getServerWorld().getAdvancementManager().getAdvancement(id);
|
||||||
|
if (advancement == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
AdvancementProgress progress = player.getAdvancements().getProgress(advancement);
|
||||||
|
if (progress.isDone()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String criterion : progress.getRemaningCriteria()) {
|
||||||
|
player.getAdvancements().grantCriterion(advancement, criterion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
56
src/main/java/com/vixis/event/FoxKissHandler.java
Normal file
56
src/main/java/com/vixis/event/FoxKissHandler.java
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
package com.vixis.event;
|
||||||
|
|
||||||
|
import com.vixis.Vixis;
|
||||||
|
import com.vixis.advancement.VixisAdvancements;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(modid = Vixis.MODID)
|
||||||
|
public final class FoxKissHandler {
|
||||||
|
private static final String FOX_NAME = "KenwoodFox";
|
||||||
|
|
||||||
|
private FoxKissHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||||
|
if (event.phase != TickEvent.Phase.END || event.player.world.isRemote) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(event.player instanceof EntityPlayerMP)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityPlayerMP player = (EntityPlayerMP) event.player;
|
||||||
|
for (EntityPlayer other : player.world.playerEntities) {
|
||||||
|
if (other == player || !isKenwoodFox(other)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (player.getEntityBoundingBox().intersects(other.getEntityBoundingBox())) {
|
||||||
|
VixisAdvancements.grant(player, VixisAdvancements.KISS_A_FOX);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Entity entity : player.world.loadedEntityList) {
|
||||||
|
if (entity == player || entity instanceof EntityPlayer || !isKenwoodFox(entity)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (player.getEntityBoundingBox().intersects(entity.getEntityBoundingBox())) {
|
||||||
|
VixisAdvancements.grant(player, VixisAdvancements.KISS_A_FOX);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isKenwoodFox(Entity entity) {
|
||||||
|
if (FOX_NAME.equals(entity.getName())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return entity.hasCustomName() && FOX_NAME.equals(entity.getCustomNameTag());
|
||||||
|
}
|
||||||
|
}
|
||||||
33
src/main/java/com/vixis/item/ModItems.java
Normal file
33
src/main/java/com/vixis/item/ModItems.java
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package com.vixis.item;
|
||||||
|
|
||||||
|
import com.vixis.Vixis;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(modid = Vixis.MODID)
|
||||||
|
public final class ModItems {
|
||||||
|
public static Item LOGO;
|
||||||
|
public static Item KISS_CHEEV;
|
||||||
|
|
||||||
|
private ModItems() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void registerItems(RegistryEvent.Register<Item> event) {
|
||||||
|
LOGO = new Item();
|
||||||
|
LOGO.setRegistryName(Vixis.MODID, "logo");
|
||||||
|
LOGO.setTranslationKey(Vixis.MODID + ".logo");
|
||||||
|
LOGO.setMaxStackSize(1);
|
||||||
|
|
||||||
|
KISS_CHEEV = new Item();
|
||||||
|
KISS_CHEEV.setRegistryName(Vixis.MODID, "kiss_cheev");
|
||||||
|
KISS_CHEEV.setTranslationKey(Vixis.MODID + ".kiss_cheev");
|
||||||
|
KISS_CHEEV.setCreativeTab(CreativeTabs.MISC);
|
||||||
|
KISS_CHEEV.setMaxStackSize(1);
|
||||||
|
|
||||||
|
event.getRegistry().registerAll(LOGO, KISS_CHEEV);
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/main/java/com/vixis/item/ModItemsClient.java
Normal file
30
src/main/java/com/vixis/item/ModItemsClient.java
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package com.vixis.item;
|
||||||
|
|
||||||
|
import com.vixis.Vixis;
|
||||||
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||||
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(modid = Vixis.MODID, value = Side.CLIENT)
|
||||||
|
public final class ModItemsClient {
|
||||||
|
private ModItemsClient() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void registerModels(ModelRegistryEvent event) {
|
||||||
|
register(ModItems.LOGO);
|
||||||
|
register(ModItems.KISS_CHEEV);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void register(Item item) {
|
||||||
|
ModelLoader.setCustomModelResourceLocation(
|
||||||
|
item,
|
||||||
|
0,
|
||||||
|
new ModelResourceLocation(item.getRegistryName(), "inventory")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/main/resources/assets/vixis/advancements/kiss_a_fox.json
Normal file
22
src/main/resources/assets/vixis/advancements/kiss_a_fox.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"parent": "vixis:root",
|
||||||
|
"display": {
|
||||||
|
"icon": {
|
||||||
|
"item": "vixis:kiss_cheev"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"translate": "advancements.vixis.kiss_a_fox.title"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"translate": "advancements.vixis.kiss_a_fox.description"
|
||||||
|
},
|
||||||
|
"frame": "task",
|
||||||
|
"show_toast": true,
|
||||||
|
"announce_to_chat": true
|
||||||
|
},
|
||||||
|
"criteria": {
|
||||||
|
"kissed_fox": {
|
||||||
|
"trigger": "minecraft:impossible"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/main/resources/assets/vixis/advancements/root.json
Normal file
21
src/main/resources/assets/vixis/advancements/root.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"display": {
|
||||||
|
"icon": {
|
||||||
|
"item": "vixis:logo"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"translate": "advancements.vixis.root.title"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"translate": "advancements.vixis.root.description"
|
||||||
|
},
|
||||||
|
"background": "minecraft:textures/gui/advancements/backgrounds/adventure.png",
|
||||||
|
"show_toast": false,
|
||||||
|
"announce_to_chat": false
|
||||||
|
},
|
||||||
|
"criteria": {
|
||||||
|
"tick": {
|
||||||
|
"trigger": "minecraft:tick"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
6
src/main/resources/assets/vixis/lang/en_us.lang
Normal file
6
src/main/resources/assets/vixis/lang/en_us.lang
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
item.vixis.logo.name=Vixis
|
||||||
|
item.vixis.kiss_cheev.name=Kiss Cheev
|
||||||
|
advancements.vixis.root.title=Vixi's Mod
|
||||||
|
advancements.vixis.root.description=My Mod!
|
||||||
|
advancements.vixis.kiss_a_fox.title=Kiss a fox!
|
||||||
|
advancements.vixis.kiss_a_fox.description=Smooch a fox good!
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "vixis:items/kiss_cheev"
|
||||||
|
}
|
||||||
|
}
|
||||||
6
src/main/resources/assets/vixis/models/item/logo.json
Normal file
6
src/main/resources/assets/vixis/models/item/logo.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "vixis:gui/logo"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
src/main/resources/assets/vixis/textures/gui/logo.png
Normal file
BIN
src/main/resources/assets/vixis/textures/gui/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
BIN
src/main/resources/assets/vixis/textures/gui/logo.png~
Normal file
BIN
src/main/resources/assets/vixis/textures/gui/logo.png~
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 959 B |
BIN
src/main/resources/assets/vixis/textures/items/kiss_cheev.png
Normal file
BIN
src/main/resources/assets/vixis/textures/items/kiss_cheev.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.1 KiB |
BIN
src/main/resources/assets/vixis/textures/items/kiss_cheev.png~
Normal file
BIN
src/main/resources/assets/vixis/textures/items/kiss_cheev.png~
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 941 B |
16
src/main/resources/mcmod.info
Normal file
16
src/main/resources/mcmod.info
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"modid": "vixis",
|
||||||
|
"name": "Vixis",
|
||||||
|
"description": "A simple Minecraft 1.12.2 Forge mod.",
|
||||||
|
"version": "${version}",
|
||||||
|
"mcversion": "${mcversion}",
|
||||||
|
"url": "",
|
||||||
|
"updateUrl": "",
|
||||||
|
"authorList": ["Vixi Argorrok"],
|
||||||
|
"credits": "",
|
||||||
|
"logoFile": "assets/vixis/textures/gui/logo.png",
|
||||||
|
"screenshots": [],
|
||||||
|
"dependencies": []
|
||||||
|
}
|
||||||
|
]
|
||||||
6
src/main/resources/pack.mcmeta
Normal file
6
src/main/resources/pack.mcmeta
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"pack": {
|
||||||
|
"description": "Vixis resources",
|
||||||
|
"pack_format": 3
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user