Init
This commit is contained in:
parent
74b76386b5
commit
19bd9cb0ec
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
build
|
||||||
|
out
|
||||||
|
run
|
||||||
|
*.iml
|
||||||
|
.idea
|
||||||
|
classes
|
BIN
.gradle/4.10.3/fileChanges/last-build.bin
Normal file
BIN
.gradle/4.10.3/fileChanges/last-build.bin
Normal file
Binary file not shown.
BIN
.gradle/4.10.3/fileHashes/fileHashes.bin
Normal file
BIN
.gradle/4.10.3/fileHashes/fileHashes.bin
Normal file
Binary file not shown.
BIN
.gradle/4.10.3/fileHashes/fileHashes.lock
Normal file
BIN
.gradle/4.10.3/fileHashes/fileHashes.lock
Normal file
Binary file not shown.
0
.gradle/4.10.3/gc.properties
Normal file
0
.gradle/4.10.3/gc.properties
Normal file
BIN
.gradle/4.4.1/fileChanges/last-build.bin
Normal file
BIN
.gradle/4.4.1/fileChanges/last-build.bin
Normal file
Binary file not shown.
BIN
.gradle/4.4.1/fileHashes/fileHashes.bin
Normal file
BIN
.gradle/4.4.1/fileHashes/fileHashes.bin
Normal file
Binary file not shown.
BIN
.gradle/4.4.1/fileHashes/fileHashes.lock
Normal file
BIN
.gradle/4.4.1/fileHashes/fileHashes.lock
Normal file
Binary file not shown.
BIN
.gradle/4.4.1/taskHistory/taskHistory.bin
Normal file
BIN
.gradle/4.4.1/taskHistory/taskHistory.bin
Normal file
Binary file not shown.
BIN
.gradle/4.4.1/taskHistory/taskHistory.lock
Normal file
BIN
.gradle/4.4.1/taskHistory/taskHistory.lock
Normal file
Binary file not shown.
BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock
Normal file
BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock
Normal file
Binary file not shown.
2
.gradle/buildOutputCleanup/cache.properties
Normal file
2
.gradle/buildOutputCleanup/cache.properties
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#Wed May 08 19:45:11 CEST 2019
|
||||||
|
gradle.version=4.4.1
|
BIN
.gradle/buildOutputCleanup/outputFiles.bin
Normal file
BIN
.gradle/buildOutputCleanup/outputFiles.bin
Normal file
Binary file not shown.
1
.gradle/gradle.log
Normal file
1
.gradle/gradle.log
Normal file
|
@ -0,0 +1 @@
|
||||||
|
This mapping 'stable_39' was designed for MC 1.12! Use at your own peril.
|
0
.gradle/vcs-1/gc.properties
Normal file
0
.gradle/vcs-1/gc.properties
Normal file
89
build.gradle
Normal file
89
build.gradle
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven {
|
||||||
|
name = "forge"
|
||||||
|
url = "https://files.minecraftforge.net/maven"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: "net.minecraftforge.gradle.forge"
|
||||||
|
|
||||||
|
version = modVersion
|
||||||
|
group = modGroup
|
||||||
|
archivesBaseName = modBaseName
|
||||||
|
|
||||||
|
minecraft {
|
||||||
|
version = project.forgeVersion
|
||||||
|
runDir = "run"
|
||||||
|
|
||||||
|
// the mappings can be changed at any time, and must be in the following format.
|
||||||
|
// snapshot_YYYYMMDD snapshot are built nightly.
|
||||||
|
// stable_# stables are built at the discretion of the MCP team.
|
||||||
|
// Use non-default mappings at your own risk. they may not always work.
|
||||||
|
// simply re-run your setup task after changing the mappings to update your workspace.
|
||||||
|
mappings = project.mcpVersion
|
||||||
|
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
name = "forge"
|
||||||
|
url = "http://files.minecraftforge.net/maven"
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = "DVS1 Maven FS"
|
||||||
|
url = "http://dvs1.progwml6.com/files/maven"
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = "CoFH Maven"
|
||||||
|
url = "http://maven.covers1624.net"
|
||||||
|
}
|
||||||
|
|
||||||
|
maven { url "https://jitpack.io" }
|
||||||
|
maven { url "https://maven.latmod.com/" }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
deobfCompile ("com.gitlab.lcoremodders:LucraftCore:${core_version}")
|
||||||
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
}
|
||||||
|
|
||||||
|
task deobfJar(type: Jar) {
|
||||||
|
from sourceSets.main.output
|
||||||
|
classifier = 'deobf'
|
||||||
|
manifest {
|
||||||
|
attributes 'FMLCorePlugin': 'lucraft.mods.lucraftcore.core.LucraftCoreCoreMod', 'FMLCorePluginContainsFMLMod': 'true'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
archives deobfJar
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
// this will ensure that this task is redone when the versions change.
|
||||||
|
inputs.property "version", project.version
|
||||||
|
inputs.property "mcversion", project.minecraft.version
|
||||||
|
|
||||||
|
// replace stuff in mcmod.info, nothing else
|
||||||
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
include "mcmod.info"
|
||||||
|
|
||||||
|
// replace version and mcversion
|
||||||
|
expand "version": project.version, "mcversion": project.minecraft.version
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy everything else, thats not the mcmod.info
|
||||||
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
exclude "mcmod.info"
|
||||||
|
}
|
||||||
|
}
|
6
gradle.properties
Normal file
6
gradle.properties
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
modGroup=anvil
|
||||||
|
modVersion=1.2
|
||||||
|
modBaseName=infinity
|
||||||
|
forgeVersion=1.12.2-14.23.5.2814
|
||||||
|
mcpVersion=stable_39
|
||||||
|
core_version=d406868225
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
|
172
gradlew
vendored
Executable file
172
gradlew
vendored
Executable file
|
@ -0,0 +1,172 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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
|
||||||
|
;;
|
||||||
|
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" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Escape application args
|
||||||
|
save () {
|
||||||
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
|
}
|
||||||
|
APP_ARGS=$(save "$@")
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
|
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||||
|
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
84
gradlew.bat
vendored
Normal file
84
gradlew.bat
vendored
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
@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=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@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=
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
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 init
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
: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 %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="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!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
BIN
libs/HeroesExpansion-1.12.2-1.3.3.jar
Normal file
BIN
libs/HeroesExpansion-1.12.2-1.3.3.jar
Normal file
Binary file not shown.
BIN
libs/SpeedsterHeroes-1.12.2-2.1.3.jar
Normal file
BIN
libs/SpeedsterHeroes-1.12.2-2.1.3.jar
Normal file
Binary file not shown.
114
src/main/java/anvil/infinity/Infinity.java
Normal file
114
src/main/java/anvil/infinity/Infinity.java
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
package anvil.infinity;
|
||||||
|
|
||||||
|
import anvil.infinity.compat.CompatHandler;
|
||||||
|
import anvil.infinity.config.ConfigHandler;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
|
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
|
//Test
|
||||||
|
|
||||||
|
@Mod(
|
||||||
|
modid = Infinity.MOD_ID,
|
||||||
|
name = Infinity.MOD_NAME,
|
||||||
|
version = Infinity.VERSION,
|
||||||
|
dependencies = Infinity.DEPENDENCIES
|
||||||
|
)
|
||||||
|
public class Infinity {
|
||||||
|
|
||||||
|
public static final String MOD_ID = "infinity";
|
||||||
|
public static final String MOD_NAME = "Infinityraft";
|
||||||
|
public static final String VERSION = "1.2";
|
||||||
|
public static final String DEPENDENCIES = "required-after:lucraftcore@[1.12.2-2.4.0,)";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the instance of your mod as created by Forge. It will never be null.
|
||||||
|
*/
|
||||||
|
@Mod.Instance(MOD_ID)
|
||||||
|
public static Infinity INSTANCE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the first initialization event. Register tile entities here.
|
||||||
|
* The registry events below will have fired prior to entry to this method.
|
||||||
|
*/
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void preinit(FMLPreInitializationEvent event) {
|
||||||
|
ConfigHandler.refreshConfig(event.getSuggestedConfigurationFile());
|
||||||
|
CompatHandler.check();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the second initialization event. Register custom recipes
|
||||||
|
*/
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the final initialization event. Register actions from other mods here
|
||||||
|
*/
|
||||||
|
@Mod.EventHandler
|
||||||
|
public void postinit(FMLPostInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forge will automatically look up and bind blocks to the fields in this class
|
||||||
|
* based on their registry name.
|
||||||
|
*/
|
||||||
|
@GameRegistry.ObjectHolder(MOD_ID)
|
||||||
|
public static class Blocks {
|
||||||
|
/*
|
||||||
|
public static final MySpecialBlock mySpecialBlock = null; // placeholder for special block below
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forge will automatically look up and bind items to the fields in this class
|
||||||
|
* based on their registry name.
|
||||||
|
*/
|
||||||
|
@GameRegistry.ObjectHolder(MOD_ID)
|
||||||
|
public static class Items {
|
||||||
|
/*
|
||||||
|
public static final ItemBlock mySpecialBlock = null; // itemblock for the block above
|
||||||
|
public static final MySpecialItem mySpecialItem = null; // placeholder for special item below
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a special class that listens to registry events, to allow creation of mod blocks and items at the proper time.
|
||||||
|
*/
|
||||||
|
@Mod.EventBusSubscriber
|
||||||
|
public static class ObjectRegistryHandler {
|
||||||
|
/**
|
||||||
|
* Listen for the register event for creating custom items
|
||||||
|
*/
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void addItems(RegistryEvent.Register<Item> event) {
|
||||||
|
/*
|
||||||
|
event.getRegistry().register(new ItemBlock(Blocks.myBlock).setRegistryName(MOD_ID, "myBlock"));
|
||||||
|
event.getRegistry().register(new MySpecialItem().setRegistryName(MOD_ID, "mySpecialItem"));
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Listen for the register event for creating custom blocks
|
||||||
|
*/
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void addBlocks(RegistryEvent.Register<Block> event) {
|
||||||
|
/*
|
||||||
|
event.getRegistry().register(new MySpecialBlock().setRegistryName(MOD_ID, "mySpecialBlock"));
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
12
src/main/java/anvil/infinity/SoundHelper.java
Normal file
12
src/main/java/anvil/infinity/SoundHelper.java
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package anvil.infinity;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.util.SoundEvent;
|
||||||
|
|
||||||
|
public class SoundHelper {
|
||||||
|
|
||||||
|
public static void playSoundAtEntity(EntityLivingBase entity, SoundEvent sound) {
|
||||||
|
entity.world.playSound(entity.getPosition().getX(), entity.getPosition().getY(), entity.getPosition().getZ(), sound, null, 5, 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
26
src/main/java/anvil/infinity/abilities/Abilities.java
Normal file
26
src/main/java/anvil/infinity/abilities/Abilities.java
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
import anvil.infinity.Infinity;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityEntry;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(modid = Infinity.MOD_ID)
|
||||||
|
public class Abilities {
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onRegisterAbilities(RegistryEvent.Register<AbilityEntry> e) {
|
||||||
|
e.getRegistry().register(new AbilityEntry(AbilitySnap.class, new ResourceLocation(Infinity.MOD_ID, "snap")));
|
||||||
|
e.getRegistry().register(new AbilityEntry(AbilityHasStone.class, new ResourceLocation(Infinity.MOD_ID, "stone")));
|
||||||
|
e.getRegistry().register(new AbilityEntry(AbilityHasPowerStone.class, new ResourceLocation(Infinity.MOD_ID, "power")));
|
||||||
|
e.getRegistry().register(new AbilityEntry(AbilityhasSpaceStone.class, new ResourceLocation(Infinity.MOD_ID, "space")));
|
||||||
|
e.getRegistry().register(new AbilityEntry(AbilityHasRealityStone.class, new ResourceLocation(Infinity.MOD_ID, "reality")));
|
||||||
|
e.getRegistry().register(new AbilityEntry(AbilityHasSoulStone.class, new ResourceLocation(Infinity.MOD_ID, "soul")));
|
||||||
|
e.getRegistry().register(new AbilityEntry(AbilityHasTimeStone.class, new ResourceLocation(Infinity.MOD_ID, "time")));
|
||||||
|
e.getRegistry().register(new AbilityEntry(AbilityHasMindStone.class, new ResourceLocation(Infinity.MOD_ID, "mind")));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class AbilityHasMindStone extends AbilityHasStone {
|
||||||
|
|
||||||
|
public AbilityHasMindStone(EntityLivingBase entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class AbilityHasPowerStone extends AbilityHasStone {
|
||||||
|
|
||||||
|
public AbilityHasPowerStone(EntityLivingBase entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class AbilityHasRealityStone extends AbilityHasStone {
|
||||||
|
|
||||||
|
public AbilityHasRealityStone(EntityLivingBase entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class AbilityHasSoulStone extends AbilityHasStone {
|
||||||
|
|
||||||
|
public AbilityHasSoulStone(EntityLivingBase entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
}
|
16
src/main/java/anvil/infinity/abilities/AbilityHasStone.java
Normal file
16
src/main/java/anvil/infinity/abilities/AbilityHasStone.java
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityConstant;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class AbilityHasStone extends AbilityConstant {
|
||||||
|
|
||||||
|
public AbilityHasStone(EntityLivingBase entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTick() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class AbilityHasTimeStone extends AbilityHasStone {
|
||||||
|
|
||||||
|
public AbilityHasTimeStone(EntityLivingBase entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
}
|
78
src/main/java/anvil/infinity/abilities/AbilitySnap.java
Normal file
78
src/main/java/anvil/infinity/abilities/AbilitySnap.java
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
import anvil.infinity.compat.CompatHandler;
|
||||||
|
import anvil.infinity.registry.Effects;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityAction;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.passive.EntityRabbit;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.server.management.PlayerList;
|
||||||
|
import net.minecraft.util.text.TextComponentString;
|
||||||
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class AbilitySnap extends AbilityAction {
|
||||||
|
|
||||||
|
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||||
|
|
||||||
|
|
||||||
|
public AbilitySnap(EntityLivingBase entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean action() {
|
||||||
|
if (CompatHandler.HeroesExpension.hasFullGauntlet(entity)) {
|
||||||
|
World w = entity.getEntityWorld();
|
||||||
|
List<Entity> entities = w.loadedEntityList;
|
||||||
|
boolean kill = false;
|
||||||
|
|
||||||
|
PlayerList players = server.getPlayerList();
|
||||||
|
|
||||||
|
TextComponentString msg = new TextComponentString(entity.getName() + ": ");
|
||||||
|
msg.appendSibling(new TextComponentTranslation("infinity.snap.text"));
|
||||||
|
msg.getStyle().setColor(TextFormatting.DARK_PURPLE);
|
||||||
|
msg.getStyle().setBold(true);
|
||||||
|
players.sendMessage(msg);
|
||||||
|
Random random = new Random();
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < entities.size(); i++) {
|
||||||
|
if (entities.get(i) != entity && entities.get(i) instanceof EntityLivingBase && kill && !(entities.get(i) instanceof EntityRabbit)) {
|
||||||
|
EntityLivingBase e = ((EntityLivingBase) entities.get(i));
|
||||||
|
e.addPotionEffect(new PotionEffect(Effects.snapEffect, random.nextInt((1200 - 10) + 1) - 10));
|
||||||
|
}
|
||||||
|
kill = !kill;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void drawIcon(Minecraft mc, Gui gui, int x, int y) {
|
||||||
|
float zLevel = Minecraft.getMinecraft().getRenderItem().zLevel;
|
||||||
|
mc.getRenderItem().zLevel = -100.5F;
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
GlStateManager.translate(x, y, 0);
|
||||||
|
mc.getRenderItem().renderItemIntoGUI(new ItemStack(ModuleInfinity.INFINITY_GAUNTLET), 0, 0);
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
mc.getRenderItem().zLevel = zLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package anvil.infinity.abilities;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class AbilityhasSpaceStone extends AbilityHasStone {
|
||||||
|
|
||||||
|
public AbilityhasSpaceStone(EntityLivingBase entity) {
|
||||||
|
super(entity);
|
||||||
|
}
|
||||||
|
}
|
29
src/main/java/anvil/infinity/compat/CompatHandler.java
Normal file
29
src/main/java/anvil/infinity/compat/CompatHandler.java
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
package anvil.infinity.compat;
|
||||||
|
|
||||||
|
import net.minecraftforge.fml.common.Loader;
|
||||||
|
|
||||||
|
public class CompatHandler {
|
||||||
|
public static boolean isHeroesExpansion;
|
||||||
|
public static boolean isSpeedsterHeroes;
|
||||||
|
|
||||||
|
public static HEProxy HeroesExpension;
|
||||||
|
public static SHProxy SpeedsterHeroes;
|
||||||
|
|
||||||
|
public static void check() {
|
||||||
|
isHeroesExpansion = Loader.isModLoaded("heroesexpansion");
|
||||||
|
isSpeedsterHeroes = Loader.isModLoaded("speedsterheroes");
|
||||||
|
|
||||||
|
if (isHeroesExpansion) {
|
||||||
|
HeroesExpension = new HELoadedProxy();
|
||||||
|
} else {
|
||||||
|
HeroesExpension = new HENotLoadedProxy();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isSpeedsterHeroes) {
|
||||||
|
SpeedsterHeroes = new SHLoadedProxy();
|
||||||
|
} else {
|
||||||
|
SpeedsterHeroes = new SHNotLoadedProxy();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
20
src/main/java/anvil/infinity/compat/HELoadedProxy.java
Normal file
20
src/main/java/anvil/infinity/compat/HELoadedProxy.java
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package anvil.infinity.compat;
|
||||||
|
|
||||||
|
import anvil.infinity.abilities.*;
|
||||||
|
import lucraft.mods.heroesexpansion.abilities.AbilityGrabEntity;
|
||||||
|
import lucraft.mods.heroesexpansion.abilities.AbilityPortal;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class HELoadedProxy implements HEProxy {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability getAbilityGrabEntity(EntityLivingBase entity) {
|
||||||
|
return new AbilityGrabEntity(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasFullGauntlet(EntityLivingBase entity) {
|
||||||
|
return Ability.hasAbility(entity, AbilityPortal.class) && Ability.hasAbility(entity, AbilityHasPowerStone.class) && Ability.hasAbility(entity, AbilityHasRealityStone.class) && Ability.hasAbility(entity, AbilityHasSoulStone.class) && Ability.hasAbility(entity, AbilityHasTimeStone.class) && Ability.hasAbility(entity, AbilityHasMindStone.class);
|
||||||
|
}
|
||||||
|
}
|
18
src/main/java/anvil/infinity/compat/HENotLoadedProxy.java
Normal file
18
src/main/java/anvil/infinity/compat/HENotLoadedProxy.java
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
package anvil.infinity.compat;
|
||||||
|
|
||||||
|
import anvil.infinity.abilities.*;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class HENotLoadedProxy implements HEProxy {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability getAbilityGrabEntity(EntityLivingBase entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasFullGauntlet(EntityLivingBase entity) {
|
||||||
|
return Ability.hasAbility(entity, AbilityHasPowerStone.class) && Ability.hasAbility(entity, AbilityHasRealityStone.class) && Ability.hasAbility(entity, AbilityHasSoulStone.class) && Ability.hasAbility(entity, AbilityHasTimeStone.class) && Ability.hasAbility(entity, AbilityHasMindStone.class);
|
||||||
|
}
|
||||||
|
}
|
12
src/main/java/anvil/infinity/compat/HEProxy.java
Normal file
12
src/main/java/anvil/infinity/compat/HEProxy.java
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
package anvil.infinity.compat;
|
||||||
|
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public interface HEProxy {
|
||||||
|
|
||||||
|
Ability getAbilityGrabEntity(EntityLivingBase entity);
|
||||||
|
|
||||||
|
boolean hasFullGauntlet(EntityLivingBase entity);
|
||||||
|
|
||||||
|
}
|
25
src/main/java/anvil/infinity/compat/SHLoadedProxy.java
Normal file
25
src/main/java/anvil/infinity/compat/SHLoadedProxy.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package anvil.infinity.compat;
|
||||||
|
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import lucraft.mods.speedsterheroes.abilities.AbilityChangeBlocks;
|
||||||
|
import lucraft.mods.speedsterheroes.abilities.AbilitySaveBlock;
|
||||||
|
import lucraft.mods.speedsterheroes.abilities.AbilityTurnIntoBubbles;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class SHLoadedProxy implements SHProxy {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability getAbilitySaveBlock(EntityLivingBase entity) {
|
||||||
|
return new AbilitySaveBlock(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability getAbilityChangeBlock(EntityLivingBase entity) {
|
||||||
|
return new AbilityChangeBlocks(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability getAbilityTurnIntoBubbles(EntityLivingBase entity) {
|
||||||
|
return new AbilityTurnIntoBubbles(entity);
|
||||||
|
}
|
||||||
|
}
|
22
src/main/java/anvil/infinity/compat/SHNotLoadedProxy.java
Normal file
22
src/main/java/anvil/infinity/compat/SHNotLoadedProxy.java
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
package anvil.infinity.compat;
|
||||||
|
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class SHNotLoadedProxy implements SHProxy {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability getAbilitySaveBlock(EntityLivingBase entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability getAbilityChangeBlock(EntityLivingBase entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability getAbilityTurnIntoBubbles(EntityLivingBase entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
14
src/main/java/anvil/infinity/compat/SHProxy.java
Normal file
14
src/main/java/anvil/infinity/compat/SHProxy.java
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package anvil.infinity.compat;
|
||||||
|
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public interface SHProxy {
|
||||||
|
|
||||||
|
Ability getAbilitySaveBlock(EntityLivingBase entity);
|
||||||
|
|
||||||
|
Ability getAbilityChangeBlock(EntityLivingBase entity);
|
||||||
|
|
||||||
|
Ability getAbilityTurnIntoBubbles(EntityLivingBase entity);
|
||||||
|
|
||||||
|
}
|
32
src/main/java/anvil/infinity/config/ConfigHandler.java
Normal file
32
src/main/java/anvil/infinity/config/ConfigHandler.java
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
package anvil.infinity.config;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class ConfigHandler {
|
||||||
|
|
||||||
|
public static Configuration config;
|
||||||
|
public static boolean soulHealthBoost;
|
||||||
|
public static boolean useSHRealityAbilities;
|
||||||
|
public static boolean sizeChanging;
|
||||||
|
public static float size;
|
||||||
|
|
||||||
|
public static void refreshConfig(File file) {
|
||||||
|
config = new Configuration(file);
|
||||||
|
config.load();
|
||||||
|
syncConfig();
|
||||||
|
if (config.hasChanged()) {
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void syncConfig() {
|
||||||
|
String category = Configuration.CATEGORY_GENERAL;
|
||||||
|
soulHealthBoost = config.getBoolean("Soul Stone health boost", category, true, "Should the Soul Stone have a health boost");
|
||||||
|
useSHRealityAbilities = config.getBoolean("SH Reality Stone abilities", category, false, "Should the Reality Stone have the abilities of the Speedster Heroes Reality Stone if it is installed");
|
||||||
|
sizeChanging = config.getBoolean("Size changing", category, true, "Should the Reality Stone be able to change the size");
|
||||||
|
size = config.getFloat("Size", category, 0.1f, 0.1f,10, "Which size should the Reality Stone change it's user to");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
50
src/main/java/anvil/infinity/effects/EffectSnap.java
Normal file
50
src/main/java/anvil/infinity/effects/EffectSnap.java
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
package anvil.infinity.effects;
|
||||||
|
|
||||||
|
import anvil.infinity.Infinity;
|
||||||
|
import anvil.infinity.SoundHelper;
|
||||||
|
import anvil.infinity.registry.Effects;
|
||||||
|
import anvil.infinity.registry.Sounds;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(modid = Infinity.MOD_ID)
|
||||||
|
public class EffectSnap extends Potion {
|
||||||
|
|
||||||
|
public EffectSnap(boolean p_i46815_1_, int p_i46815_2_) {
|
||||||
|
super(p_i46815_1_, p_i46815_2_);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onTick(LivingEvent.LivingUpdateEvent e) {
|
||||||
|
if (e.getEntityLiving().getActivePotionEffect(Effects.snapEffect) != null) {
|
||||||
|
if (e.getEntityLiving().getActivePotionEffect(Effects.snapEffect).getDuration() == 1) {
|
||||||
|
e.getEntityLiving().playSound(Sounds.snap, 5, 0);
|
||||||
|
e.getEntityLiving().setHealth(0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getCurativeItems() {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
20
src/main/java/anvil/infinity/helpers/SnapMessageHelper.java
Normal file
20
src/main/java/anvil/infinity/helpers/SnapMessageHelper.java
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package anvil.infinity.helpers;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.util.text.TextComponentString;
|
||||||
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
|
|
||||||
|
public class SnapMessageHelper {
|
||||||
|
|
||||||
|
public static MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||||
|
|
||||||
|
public static void deathMessage(EntityLivingBase entity) {
|
||||||
|
TextComponentString msg = new TextComponentString(entity.getName());
|
||||||
|
msg.appendSibling(new TextComponentTranslation("infinity.snap.death"));
|
||||||
|
server.getPlayerList().sendMessage(msg);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
44
src/main/java/anvil/infinity/items/ItemMindStone.java
Normal file
44
src/main/java/anvil/infinity/items/ItemMindStone.java
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
package anvil.infinity.items;
|
||||||
|
|
||||||
|
import anvil.infinity.abilities.AbilityHasMindStone;
|
||||||
|
import anvil.infinity.compat.CompatHandler;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.EnumInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.items.ItemInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityFlight;
|
||||||
|
import lucraft.mods.lucraftcore.util.helper.StringHelper;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
|
||||||
|
public class ItemMindStone extends ItemInfinityStone {
|
||||||
|
|
||||||
|
public ItemMindStone(String name) {
|
||||||
|
this.setTranslationKey(name);
|
||||||
|
this.setRegistryName(StringHelper.unlocalizedToResourceName(name));
|
||||||
|
this.setCreativeTab(ModuleInfinity.TAB);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumInfinityStone getType() {
|
||||||
|
return EnumInfinityStone.MIND;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isContainer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability.AbilityMap addStoneAbilities(EntityLivingBase entity, Ability.AbilityMap abilities, Ability.EnumAbilityContext context) {
|
||||||
|
abilities.put("flight", new AbilityFlight(entity).setDataValue(AbilityFlight.SPEED, 1f));
|
||||||
|
abilities.put("mind", new AbilityHasMindStone(entity));
|
||||||
|
if (CompatHandler.isHeroesExpansion) {
|
||||||
|
abilities.put("telekinesis", CompatHandler.HeroesExpension.getAbilityGrabEntity(entity));
|
||||||
|
}
|
||||||
|
return super.addStoneAbilities(entity, abilities, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
51
src/main/java/anvil/infinity/items/ItemPowerStone.java
Normal file
51
src/main/java/anvil/infinity/items/ItemPowerStone.java
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
package anvil.infinity.items;
|
||||||
|
|
||||||
|
import anvil.infinity.abilities.AbilityHasPowerStone;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.EnumInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.items.ItemInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.*;
|
||||||
|
import lucraft.mods.lucraftcore.util.helper.StringHelper;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class ItemPowerStone extends ItemInfinityStone {
|
||||||
|
|
||||||
|
public ItemPowerStone(String name) {
|
||||||
|
this.setTranslationKey(name);
|
||||||
|
this.setRegistryName(StringHelper.unlocalizedToResourceName(name));
|
||||||
|
this.setCreativeTab(ModuleInfinity.TAB);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumInfinityStone getType() {
|
||||||
|
return EnumInfinityStone.POWER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isContainer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability.AbilityMap addStoneAbilities(EntityLivingBase entity, Ability.AbilityMap abilities, Ability.EnumAbilityContext context) {
|
||||||
|
abilities.put("power", new AbilityHasPowerStone(entity));
|
||||||
|
abilities.put("blast", new AbilityEnergyBlast(entity).setDataValue(AbilityEnergyBlast.DAMAGE, Float.MAX_VALUE).setDataValue(AbilityEnergyBlast.COLOR, Color.MAGENTA));
|
||||||
|
abilities.put("strength", new AbilityStrength(entity).setDataValue(AbilityAttributeModifier.AMOUNT, Float.MAX_VALUE));
|
||||||
|
abilities.put("damage", new AbilityPunch(entity).setDataValue(AbilityPunch.AMOUNT, Float.MAX_VALUE));
|
||||||
|
abilities.put("resistance", new AbilityDamageResistance(entity).setDataValue(AbilityAttributeModifier.AMOUNT, Float.MAX_VALUE));
|
||||||
|
return super.addStoneAbilities(entity, abilities, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getEnergyPerTick(ItemStack stack) {
|
||||||
|
return Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
50
src/main/java/anvil/infinity/items/ItemRealityStone.java
Normal file
50
src/main/java/anvil/infinity/items/ItemRealityStone.java
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
package anvil.infinity.items;
|
||||||
|
|
||||||
|
import anvil.infinity.abilities.AbilityHasRealityStone;
|
||||||
|
import anvil.infinity.compat.CompatHandler;
|
||||||
|
import anvil.infinity.config.ConfigHandler;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.EnumInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.items.ItemInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityInvisibility;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilitySizeChange;
|
||||||
|
import lucraft.mods.lucraftcore.util.helper.StringHelper;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class ItemRealityStone extends ItemInfinityStone {
|
||||||
|
|
||||||
|
public ItemRealityStone(String name) {
|
||||||
|
this.setTranslationKey(name);
|
||||||
|
this.setRegistryName(StringHelper.unlocalizedToResourceName(name));
|
||||||
|
this.setCreativeTab(ModuleInfinity.TAB);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumInfinityStone getType() {
|
||||||
|
return EnumInfinityStone.REALITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isContainer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability.AbilityMap addStoneAbilities(EntityLivingBase entity, Ability.AbilityMap abilities, Ability.EnumAbilityContext context) {
|
||||||
|
if (ConfigHandler.sizeChanging) {
|
||||||
|
abilities.put("size", new AbilitySizeChange(entity).setDataValue(AbilitySizeChange.SIZE, ConfigHandler.size));
|
||||||
|
}
|
||||||
|
abilities.put("invisibility", new AbilityInvisibility(entity));
|
||||||
|
abilities.put("reality", new AbilityHasRealityStone(entity));
|
||||||
|
if (CompatHandler.isSpeedsterHeroes && ConfigHandler.useSHRealityAbilities) {
|
||||||
|
abilities.put("save_block", CompatHandler.SpeedsterHeroes.getAbilitySaveBlock(entity));
|
||||||
|
abilities.put("change_block", CompatHandler.SpeedsterHeroes.getAbilityChangeBlock(entity));
|
||||||
|
abilities.put("turn_into_bubbles", CompatHandler.SpeedsterHeroes.getAbilityTurnIntoBubbles(entity));
|
||||||
|
}
|
||||||
|
return super.addStoneAbilities(entity, abilities, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
47
src/main/java/anvil/infinity/items/ItemSoulStone.java
Normal file
47
src/main/java/anvil/infinity/items/ItemSoulStone.java
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
package anvil.infinity.items;
|
||||||
|
|
||||||
|
import anvil.infinity.abilities.AbilityHasSoulStone;
|
||||||
|
import anvil.infinity.abilities.AbilitySnap;
|
||||||
|
import anvil.infinity.config.ConfigHandler;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.EnumInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.items.ItemInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityAttributeModifier;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityHealing;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.AbilityHealth;
|
||||||
|
import lucraft.mods.lucraftcore.util.helper.StringHelper;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class ItemSoulStone extends ItemInfinityStone {
|
||||||
|
|
||||||
|
public ItemSoulStone(String name) {
|
||||||
|
this.setTranslationKey(name);
|
||||||
|
this.setRegistryName(StringHelper.unlocalizedToResourceName(name));
|
||||||
|
this.setCreativeTab(ModuleInfinity.TAB);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumInfinityStone getType() {
|
||||||
|
return EnumInfinityStone.SOUL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isContainer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability.AbilityMap addStoneAbilities(EntityLivingBase entity, Ability.AbilityMap abilities, Ability.EnumAbilityContext context) {
|
||||||
|
if (ConfigHandler.soulHealthBoost) {
|
||||||
|
abilities.put("immortality", new AbilityHealth(entity).setDataValue(AbilityAttributeModifier.AMOUNT, Float.MAX_VALUE));
|
||||||
|
}
|
||||||
|
abilities.put("healing", new AbilityHealing(entity).setDataValue(AbilityHealing.FREQUENCY, 1));
|
||||||
|
abilities.put("soul", new AbilityHasSoulStone(entity));
|
||||||
|
abilities.put("snap", new AbilitySnap(entity));
|
||||||
|
return super.addStoneAbilities(entity, abilities, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
37
src/main/java/anvil/infinity/items/ItemTimeStone.java
Normal file
37
src/main/java/anvil/infinity/items/ItemTimeStone.java
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
package anvil.infinity.items;
|
||||||
|
|
||||||
|
import anvil.infinity.abilities.AbilityHasTimeStone;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.EnumInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.ModuleInfinity;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.items.ItemInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.superpowers.abilities.Ability;
|
||||||
|
import lucraft.mods.lucraftcore.util.helper.StringHelper;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class ItemTimeStone extends ItemInfinityStone {
|
||||||
|
|
||||||
|
public ItemTimeStone(String name) {
|
||||||
|
this.setTranslationKey(name);
|
||||||
|
this.setRegistryName(StringHelper.unlocalizedToResourceName(name));
|
||||||
|
this.setCreativeTab(ModuleInfinity.TAB);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumInfinityStone getType() {
|
||||||
|
return EnumInfinityStone.TIME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isContainer() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ability.AbilityMap addStoneAbilities(EntityLivingBase entity, Ability.AbilityMap abilities, Ability.EnumAbilityContext context) {
|
||||||
|
abilities.put("time", new AbilityHasTimeStone(entity));
|
||||||
|
return super.addStoneAbilities(entity, abilities, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
60
src/main/java/anvil/infinity/items/Items.java
Normal file
60
src/main/java/anvil/infinity/items/Items.java
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
package anvil.infinity.items;
|
||||||
|
|
||||||
|
import anvil.infinity.Infinity;
|
||||||
|
import java.awt.*;
|
||||||
|
import lucraft.mods.lucraftcore.infinity.render.ItemRendererInfinityStone;
|
||||||
|
import lucraft.mods.lucraftcore.util.helper.ItemHelper;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||||
|
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||||
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(modid = Infinity.MOD_ID)
|
||||||
|
public class Items {
|
||||||
|
|
||||||
|
public static Item POWER_STONE = new ItemPowerStone("power_stone");
|
||||||
|
public static Item MIND_STONE = new ItemMindStone("mind_stone");
|
||||||
|
public static Item REALITY_STONE = new ItemRealityStone("reality_stone");
|
||||||
|
public static Item SOUL_STONE = new ItemSoulStone("soul_stone");
|
||||||
|
public static Item TIME_STONE = new ItemTimeStone("time_stone");
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onRegisterItems(RegistryEvent.Register<Item> e) {
|
||||||
|
|
||||||
|
e.getRegistry().register(POWER_STONE);
|
||||||
|
e.getRegistry().register(MIND_STONE);
|
||||||
|
e.getRegistry().register(REALITY_STONE);
|
||||||
|
e.getRegistry().register(SOUL_STONE);
|
||||||
|
e.getRegistry().register(TIME_STONE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onRegisterModels(ModelRegistryEvent e) {
|
||||||
|
OBJLoader.INSTANCE.addDomain(Infinity.MOD_ID);
|
||||||
|
|
||||||
|
POWER_STONE.setTileEntityItemStackRenderer(new ItemRendererInfinityStone(Color.MAGENTA, Color.WHITE));
|
||||||
|
MIND_STONE.setTileEntityItemStackRenderer(new ItemRendererInfinityStone(Color.YELLOW, Color.WHITE));
|
||||||
|
REALITY_STONE.setTileEntityItemStackRenderer(new ItemRendererInfinityStone(Color.RED, Color.WHITE));
|
||||||
|
SOUL_STONE.setTileEntityItemStackRenderer(new ItemRendererInfinityStone(Color.ORANGE, Color.WHITE));
|
||||||
|
TIME_STONE.setTileEntityItemStackRenderer(new ItemRendererInfinityStone(Color.GREEN, Color.WHITE));
|
||||||
|
|
||||||
|
ItemHelper.registerItemModel(POWER_STONE, Infinity.MOD_ID, "power_stone");
|
||||||
|
ItemHelper.registerItemModel(MIND_STONE, Infinity.MOD_ID, "mind_stone");
|
||||||
|
ItemHelper.registerItemModel(REALITY_STONE, Infinity.MOD_ID, "reality_stone");
|
||||||
|
ItemHelper.registerItemModel(SOUL_STONE, Infinity.MOD_ID, "soul_stone");
|
||||||
|
ItemHelper.registerItemModel(TIME_STONE, Infinity.MOD_ID, "time_stone");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onMissingRegistries(RegistryEvent.MissingMappings<Item> e) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
25
src/main/java/anvil/infinity/networking/SnapPackage.java
Normal file
25
src/main/java/anvil/infinity/networking/SnapPackage.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package anvil.infinity.networking;
|
||||||
|
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||||
|
|
||||||
|
public class SnapPackage implements IMessage {
|
||||||
|
|
||||||
|
int entityID;
|
||||||
|
|
||||||
|
public SnapPackage(int entityID) {
|
||||||
|
this.entityID = entityID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fromBytes(ByteBuf byteBuf) {
|
||||||
|
entityID = byteBuf.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toBytes(ByteBuf byteBuf) {
|
||||||
|
byteBuf.writeInt(entityID);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package anvil.infinity.networking;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
|
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||||
|
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
|
||||||
|
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||||
|
|
||||||
|
public class SnapPackageHandler implements IMessageHandler<SnapPackage, IMessage> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IMessage onMessage(SnapPackage snapPackage, MessageContext messageContext) {
|
||||||
|
World w = FMLCommonHandler.instance().getMinecraftServerInstance().getWorld(0);
|
||||||
|
|
||||||
|
EntityLivingBase snapEntity = (EntityLivingBase) w.getEntityByID(snapPackage.entityID);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
27
src/main/java/anvil/infinity/registry/Effects.java
Normal file
27
src/main/java/anvil/infinity/registry/Effects.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package anvil.infinity.registry;
|
||||||
|
|
||||||
|
import anvil.infinity.Infinity;
|
||||||
|
import anvil.infinity.effects.EffectSnap;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(modid = Infinity.MOD_ID)
|
||||||
|
public class Effects {
|
||||||
|
|
||||||
|
public static Potion snapEffect = new EffectSnap(true, 0x000000);
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onRegisterPotions(RegistryEvent.Register<Potion> e) {
|
||||||
|
|
||||||
|
snapEffect.setRegistryName("effectSnap");
|
||||||
|
|
||||||
|
e.getRegistry().register(snapEffect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
23
src/main/java/anvil/infinity/registry/Sounds.java
Normal file
23
src/main/java/anvil/infinity/registry/Sounds.java
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package anvil.infinity.registry;
|
||||||
|
|
||||||
|
import anvil.infinity.Infinity;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.SoundEvent;
|
||||||
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(modid = Infinity.MOD_ID)
|
||||||
|
public class Sounds {
|
||||||
|
|
||||||
|
public static SoundEvent snap = new SoundEvent(new ResourceLocation(Infinity.MOD_ID, "snap"));
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onRegisterSoundEvents(RegistryEvent.Register<SoundEvent> e) {
|
||||||
|
|
||||||
|
snap.setRegistryName("soundSnap");
|
||||||
|
|
||||||
|
e.getRegistry().register(snap);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
6
src/main/resources/assets/infinity/lang/de_DE.lang
Normal file
6
src/main/resources/assets/infinity/lang/de_DE.lang
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
item.power_stone.name=Stein der Macht
|
||||||
|
item.reality_stone.name=Realitätsstein
|
||||||
|
item.soul_stone.name=Seelenstein
|
||||||
|
item.time_stone.name=Zeitstein
|
||||||
|
item.mind_stone.name=Gedankenstein
|
||||||
|
infinity.snap.text=Du hättest auf den Kopf zielen sollen.
|
7
src/main/resources/assets/infinity/lang/en_US.lang
Normal file
7
src/main/resources/assets/infinity/lang/en_US.lang
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
item.power_stone.name=Power Stone
|
||||||
|
item.reality_stone.name=Reality Stone
|
||||||
|
item.soul_stone.name=Soul Stone
|
||||||
|
item.time_stone.name=Time Stone
|
||||||
|
item.mind_stone.name=Mind Stone
|
||||||
|
infinity.snap.text=You should have gone for the head.
|
||||||
|
infinity.snap.death= died by the Snap
|
8
src/main/resources/assets/infinity/lang/tr_TR.lang
Normal file
8
src/main/resources/assets/infinity/lang/tr_TR.lang
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
item.power_stone.name=Güç Taţý
|
||||||
|
|
||||||
|
item.reality_stone.name=Gerçeklik Taţý
|
||||||
|
|
||||||
|
item.soul_stone.name=Ruh Taţý
|
||||||
|
|
||||||
|
item.time_stone.name=Zaman Taţý
|
||||||
|
item.mind_stone.name=Zihin Taţý
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/entity",
|
||||||
|
"display": {
|
||||||
|
"gui": {
|
||||||
|
"rotation": [ 30, 45, 0 ],
|
||||||
|
"translation": [ 0, 3, 0],
|
||||||
|
"scale":[ 3, 3, 3 ]
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 2, 0],
|
||||||
|
"scale":[ 2, 2, 2 ]
|
||||||
|
},
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_lefthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/entity",
|
||||||
|
"display": {
|
||||||
|
"gui": {
|
||||||
|
"rotation": [ 30, 45, 0 ],
|
||||||
|
"translation": [ 0, 3, 0],
|
||||||
|
"scale":[ 3, 3, 3 ]
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 2, 0],
|
||||||
|
"scale":[ 2, 2, 2 ]
|
||||||
|
},
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_lefthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/entity",
|
||||||
|
"display": {
|
||||||
|
"gui": {
|
||||||
|
"rotation": [ 30, 45, 0 ],
|
||||||
|
"translation": [ 0, 3, 0],
|
||||||
|
"scale":[ 3, 3, 3 ]
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 2, 0],
|
||||||
|
"scale":[ 2, 2, 2 ]
|
||||||
|
},
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_lefthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/entity",
|
||||||
|
"display": {
|
||||||
|
"gui": {
|
||||||
|
"rotation": [ 30, 45, 0 ],
|
||||||
|
"translation": [ 0, 3, 0],
|
||||||
|
"scale":[ 3, 3, 3 ]
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 2, 0],
|
||||||
|
"scale":[ 2, 2, 2 ]
|
||||||
|
},
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_lefthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"parent": "builtin/entity",
|
||||||
|
"display": {
|
||||||
|
"gui": {
|
||||||
|
"rotation": [ 30, 45, 0 ],
|
||||||
|
"translation": [ 0, 3, 0],
|
||||||
|
"scale":[ 3, 3, 3 ]
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 2, 0],
|
||||||
|
"scale":[ 2, 2, 2 ]
|
||||||
|
},
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [ 45, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
},
|
||||||
|
"firstperson_lefthand": {
|
||||||
|
"rotation": [ 0, 0, 0 ],
|
||||||
|
"translation": [ 0, 5, 0],
|
||||||
|
"scale":[ 1, 1, 1 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
5
src/main/resources/assets/infinity/sounds.json
Normal file
5
src/main/resources/assets/infinity/sounds.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"snap": {
|
||||||
|
"sounds": [ "infinity:snap1", "infinity:snap2", "infinity:snap3", "infinity:snap4", "infinity:snap5", "infinity:snap6" ]
|
||||||
|
}
|
||||||
|
}
|
BIN
src/main/resources/assets/infinity/sounds/snap1.ogg
Normal file
BIN
src/main/resources/assets/infinity/sounds/snap1.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/infinity/sounds/snap2.ogg
Normal file
BIN
src/main/resources/assets/infinity/sounds/snap2.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/infinity/sounds/snap3.ogg
Normal file
BIN
src/main/resources/assets/infinity/sounds/snap3.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/infinity/sounds/snap4.ogg
Normal file
BIN
src/main/resources/assets/infinity/sounds/snap4.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/infinity/sounds/snap5.ogg
Normal file
BIN
src/main/resources/assets/infinity/sounds/snap5.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/infinity/sounds/snap6.ogg
Normal file
BIN
src/main/resources/assets/infinity/sounds/snap6.ogg
Normal file
Binary file not shown.
18
src/main/resources/mcmod.info
Normal file
18
src/main/resources/mcmod.info
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"modid": "infinity",
|
||||||
|
"name": "Infinityraft",
|
||||||
|
"description": "Infinity Stones in Minecraft!",
|
||||||
|
"version": "${version}",
|
||||||
|
"mcversion": "${mcversion}",
|
||||||
|
"url": "",
|
||||||
|
"updateUrl": "",
|
||||||
|
"authorList": [
|
||||||
|
"tilera"
|
||||||
|
],
|
||||||
|
"credits": "",
|
||||||
|
"logoFile": "",
|
||||||
|
"screenshots": [],
|
||||||
|
"dependencies": []
|
||||||
|
}
|
||||||
|
]
|
Loading…
Reference in a new issue