diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c934d58 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +build +out +run +*.iml +.idea +classes \ No newline at end of file diff --git a/.gradle/4.10.3/fileChanges/last-build.bin b/.gradle/4.10.3/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/4.10.3/fileChanges/last-build.bin differ diff --git a/.gradle/4.10.3/fileHashes/fileHashes.bin b/.gradle/4.10.3/fileHashes/fileHashes.bin new file mode 100644 index 0000000..d797eec Binary files /dev/null and b/.gradle/4.10.3/fileHashes/fileHashes.bin differ diff --git a/.gradle/4.10.3/fileHashes/fileHashes.lock b/.gradle/4.10.3/fileHashes/fileHashes.lock new file mode 100644 index 0000000..95ad6ae Binary files /dev/null and b/.gradle/4.10.3/fileHashes/fileHashes.lock differ diff --git a/.gradle/4.10.3/gc.properties b/.gradle/4.10.3/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/4.4.1/fileChanges/last-build.bin b/.gradle/4.4.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/4.4.1/fileChanges/last-build.bin differ diff --git a/.gradle/4.4.1/fileHashes/fileHashes.bin b/.gradle/4.4.1/fileHashes/fileHashes.bin new file mode 100644 index 0000000..3cc6151 Binary files /dev/null and b/.gradle/4.4.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/4.4.1/fileHashes/fileHashes.lock b/.gradle/4.4.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..5e690ee Binary files /dev/null and b/.gradle/4.4.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/4.4.1/taskHistory/taskHistory.bin b/.gradle/4.4.1/taskHistory/taskHistory.bin new file mode 100644 index 0000000..ac60802 Binary files /dev/null and b/.gradle/4.4.1/taskHistory/taskHistory.bin differ diff --git a/.gradle/4.4.1/taskHistory/taskHistory.lock b/.gradle/4.4.1/taskHistory/taskHistory.lock new file mode 100644 index 0000000..1692981 Binary files /dev/null and b/.gradle/4.4.1/taskHistory/taskHistory.lock differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..1a4f4fd Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..ba23999 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed May 08 19:45:11 CEST 2019 +gradle.version=4.4.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..6fb541b Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/gradle.log b/.gradle/gradle.log new file mode 100644 index 0000000..58b0249 --- /dev/null +++ b/.gradle/gradle.log @@ -0,0 +1 @@ +This mapping 'stable_39' was designed for MC 1.12! Use at your own peril. diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..c1ded94 --- /dev/null +++ b/build.gradle @@ -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" + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..2bc3b03 --- /dev/null +++ b/gradle.properties @@ -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 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..99340b4 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..2c2bbe5 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -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" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/gradlew.bat @@ -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 diff --git a/libs/HeroesExpansion-1.12.2-1.3.3.jar b/libs/HeroesExpansion-1.12.2-1.3.3.jar new file mode 100644 index 0000000..1d56e87 Binary files /dev/null and b/libs/HeroesExpansion-1.12.2-1.3.3.jar differ diff --git a/libs/SpeedsterHeroes-1.12.2-2.1.3.jar b/libs/SpeedsterHeroes-1.12.2-2.1.3.jar new file mode 100644 index 0000000..9c9cb92 Binary files /dev/null and b/libs/SpeedsterHeroes-1.12.2-2.1.3.jar differ diff --git a/src/main/java/anvil/infinity/Infinity.java b/src/main/java/anvil/infinity/Infinity.java new file mode 100644 index 0000000..51ff0d7 --- /dev/null +++ b/src/main/java/anvil/infinity/Infinity.java @@ -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 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 event) { + /* + event.getRegistry().register(new MySpecialBlock().setRegistryName(MOD_ID, "mySpecialBlock")); + */ + } + } + +} diff --git a/src/main/java/anvil/infinity/SoundHelper.java b/src/main/java/anvil/infinity/SoundHelper.java new file mode 100644 index 0000000..6130855 --- /dev/null +++ b/src/main/java/anvil/infinity/SoundHelper.java @@ -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); + } + +} diff --git a/src/main/java/anvil/infinity/abilities/Abilities.java b/src/main/java/anvil/infinity/abilities/Abilities.java new file mode 100644 index 0000000..05b26a4 --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/Abilities.java @@ -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 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"))); + } + + +} diff --git a/src/main/java/anvil/infinity/abilities/AbilityHasMindStone.java b/src/main/java/anvil/infinity/abilities/AbilityHasMindStone.java new file mode 100644 index 0000000..b9b96de --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/AbilityHasMindStone.java @@ -0,0 +1,10 @@ +package anvil.infinity.abilities; + +import net.minecraft.entity.EntityLivingBase; + +public class AbilityHasMindStone extends AbilityHasStone { + + public AbilityHasMindStone(EntityLivingBase entity) { + super(entity); + } +} diff --git a/src/main/java/anvil/infinity/abilities/AbilityHasPowerStone.java b/src/main/java/anvil/infinity/abilities/AbilityHasPowerStone.java new file mode 100644 index 0000000..e91d313 --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/AbilityHasPowerStone.java @@ -0,0 +1,11 @@ +package anvil.infinity.abilities; + + +import net.minecraft.entity.EntityLivingBase; + +public class AbilityHasPowerStone extends AbilityHasStone { + + public AbilityHasPowerStone(EntityLivingBase entity) { + super(entity); + } +} diff --git a/src/main/java/anvil/infinity/abilities/AbilityHasRealityStone.java b/src/main/java/anvil/infinity/abilities/AbilityHasRealityStone.java new file mode 100644 index 0000000..c3b0c38 --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/AbilityHasRealityStone.java @@ -0,0 +1,10 @@ +package anvil.infinity.abilities; + +import net.minecraft.entity.EntityLivingBase; + +public class AbilityHasRealityStone extends AbilityHasStone { + + public AbilityHasRealityStone(EntityLivingBase entity) { + super(entity); + } +} diff --git a/src/main/java/anvil/infinity/abilities/AbilityHasSoulStone.java b/src/main/java/anvil/infinity/abilities/AbilityHasSoulStone.java new file mode 100644 index 0000000..13fbdd2 --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/AbilityHasSoulStone.java @@ -0,0 +1,10 @@ +package anvil.infinity.abilities; + +import net.minecraft.entity.EntityLivingBase; + +public class AbilityHasSoulStone extends AbilityHasStone { + + public AbilityHasSoulStone(EntityLivingBase entity) { + super(entity); + } +} diff --git a/src/main/java/anvil/infinity/abilities/AbilityHasStone.java b/src/main/java/anvil/infinity/abilities/AbilityHasStone.java new file mode 100644 index 0000000..afaec26 --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/AbilityHasStone.java @@ -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() { + + } +} diff --git a/src/main/java/anvil/infinity/abilities/AbilityHasTimeStone.java b/src/main/java/anvil/infinity/abilities/AbilityHasTimeStone.java new file mode 100644 index 0000000..0cdce69 --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/AbilityHasTimeStone.java @@ -0,0 +1,10 @@ +package anvil.infinity.abilities; + +import net.minecraft.entity.EntityLivingBase; + +public class AbilityHasTimeStone extends AbilityHasStone { + + public AbilityHasTimeStone(EntityLivingBase entity) { + super(entity); + } +} diff --git a/src/main/java/anvil/infinity/abilities/AbilitySnap.java b/src/main/java/anvil/infinity/abilities/AbilitySnap.java new file mode 100644 index 0000000..b64f39e --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/AbilitySnap.java @@ -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 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; + } + +} diff --git a/src/main/java/anvil/infinity/abilities/AbilityhasSpaceStone.java b/src/main/java/anvil/infinity/abilities/AbilityhasSpaceStone.java new file mode 100644 index 0000000..129a7f5 --- /dev/null +++ b/src/main/java/anvil/infinity/abilities/AbilityhasSpaceStone.java @@ -0,0 +1,10 @@ +package anvil.infinity.abilities; + +import net.minecraft.entity.EntityLivingBase; + +public class AbilityhasSpaceStone extends AbilityHasStone { + + public AbilityhasSpaceStone(EntityLivingBase entity) { + super(entity); + } +} diff --git a/src/main/java/anvil/infinity/compat/CompatHandler.java b/src/main/java/anvil/infinity/compat/CompatHandler.java new file mode 100644 index 0000000..c39da5c --- /dev/null +++ b/src/main/java/anvil/infinity/compat/CompatHandler.java @@ -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(); + } + + } +} diff --git a/src/main/java/anvil/infinity/compat/HELoadedProxy.java b/src/main/java/anvil/infinity/compat/HELoadedProxy.java new file mode 100644 index 0000000..a7ae860 --- /dev/null +++ b/src/main/java/anvil/infinity/compat/HELoadedProxy.java @@ -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); + } +} diff --git a/src/main/java/anvil/infinity/compat/HENotLoadedProxy.java b/src/main/java/anvil/infinity/compat/HENotLoadedProxy.java new file mode 100644 index 0000000..8ce3573 --- /dev/null +++ b/src/main/java/anvil/infinity/compat/HENotLoadedProxy.java @@ -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); + } +} diff --git a/src/main/java/anvil/infinity/compat/HEProxy.java b/src/main/java/anvil/infinity/compat/HEProxy.java new file mode 100644 index 0000000..12f7e5b --- /dev/null +++ b/src/main/java/anvil/infinity/compat/HEProxy.java @@ -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); + +} diff --git a/src/main/java/anvil/infinity/compat/SHLoadedProxy.java b/src/main/java/anvil/infinity/compat/SHLoadedProxy.java new file mode 100644 index 0000000..b833c6e --- /dev/null +++ b/src/main/java/anvil/infinity/compat/SHLoadedProxy.java @@ -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); + } +} diff --git a/src/main/java/anvil/infinity/compat/SHNotLoadedProxy.java b/src/main/java/anvil/infinity/compat/SHNotLoadedProxy.java new file mode 100644 index 0000000..6d7c7e9 --- /dev/null +++ b/src/main/java/anvil/infinity/compat/SHNotLoadedProxy.java @@ -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; + } +} diff --git a/src/main/java/anvil/infinity/compat/SHProxy.java b/src/main/java/anvil/infinity/compat/SHProxy.java new file mode 100644 index 0000000..9fca504 --- /dev/null +++ b/src/main/java/anvil/infinity/compat/SHProxy.java @@ -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); + +} diff --git a/src/main/java/anvil/infinity/config/ConfigHandler.java b/src/main/java/anvil/infinity/config/ConfigHandler.java new file mode 100644 index 0000000..4da337c --- /dev/null +++ b/src/main/java/anvil/infinity/config/ConfigHandler.java @@ -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"); + } + +} diff --git a/src/main/java/anvil/infinity/effects/EffectSnap.java b/src/main/java/anvil/infinity/effects/EffectSnap.java new file mode 100644 index 0000000..7125ab4 --- /dev/null +++ b/src/main/java/anvil/infinity/effects/EffectSnap.java @@ -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 getCurativeItems() { + return new ArrayList<>(); + } + + + + + + + +} diff --git a/src/main/java/anvil/infinity/helpers/SnapMessageHelper.java b/src/main/java/anvil/infinity/helpers/SnapMessageHelper.java new file mode 100644 index 0000000..12e6c6b --- /dev/null +++ b/src/main/java/anvil/infinity/helpers/SnapMessageHelper.java @@ -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); + + } + +} diff --git a/src/main/java/anvil/infinity/items/ItemMindStone.java b/src/main/java/anvil/infinity/items/ItemMindStone.java new file mode 100644 index 0000000..64dd131 --- /dev/null +++ b/src/main/java/anvil/infinity/items/ItemMindStone.java @@ -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); + } + +} diff --git a/src/main/java/anvil/infinity/items/ItemPowerStone.java b/src/main/java/anvil/infinity/items/ItemPowerStone.java new file mode 100644 index 0000000..b363290 --- /dev/null +++ b/src/main/java/anvil/infinity/items/ItemPowerStone.java @@ -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; + } + + +} diff --git a/src/main/java/anvil/infinity/items/ItemRealityStone.java b/src/main/java/anvil/infinity/items/ItemRealityStone.java new file mode 100644 index 0000000..ff1316b --- /dev/null +++ b/src/main/java/anvil/infinity/items/ItemRealityStone.java @@ -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); + } + +} diff --git a/src/main/java/anvil/infinity/items/ItemSoulStone.java b/src/main/java/anvil/infinity/items/ItemSoulStone.java new file mode 100644 index 0000000..f0dd13e --- /dev/null +++ b/src/main/java/anvil/infinity/items/ItemSoulStone.java @@ -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); + } + +} diff --git a/src/main/java/anvil/infinity/items/ItemTimeStone.java b/src/main/java/anvil/infinity/items/ItemTimeStone.java new file mode 100644 index 0000000..1f5202a --- /dev/null +++ b/src/main/java/anvil/infinity/items/ItemTimeStone.java @@ -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); + } + +} diff --git a/src/main/java/anvil/infinity/items/Items.java b/src/main/java/anvil/infinity/items/Items.java new file mode 100644 index 0000000..67db5ac --- /dev/null +++ b/src/main/java/anvil/infinity/items/Items.java @@ -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 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 e) { + + + } +} \ No newline at end of file diff --git a/src/main/java/anvil/infinity/networking/SnapPackage.java b/src/main/java/anvil/infinity/networking/SnapPackage.java new file mode 100644 index 0000000..903da58 --- /dev/null +++ b/src/main/java/anvil/infinity/networking/SnapPackage.java @@ -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); + } +} diff --git a/src/main/java/anvil/infinity/networking/SnapPackageHandler.java b/src/main/java/anvil/infinity/networking/SnapPackageHandler.java new file mode 100644 index 0000000..c1f8c83 --- /dev/null +++ b/src/main/java/anvil/infinity/networking/SnapPackageHandler.java @@ -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 { + + @Override + public IMessage onMessage(SnapPackage snapPackage, MessageContext messageContext) { + World w = FMLCommonHandler.instance().getMinecraftServerInstance().getWorld(0); + + EntityLivingBase snapEntity = (EntityLivingBase) w.getEntityByID(snapPackage.entityID); + + + + return null; + } + +} diff --git a/src/main/java/anvil/infinity/registry/Effects.java b/src/main/java/anvil/infinity/registry/Effects.java new file mode 100644 index 0000000..b431eb6 --- /dev/null +++ b/src/main/java/anvil/infinity/registry/Effects.java @@ -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 e) { + + snapEffect.setRegistryName("effectSnap"); + + e.getRegistry().register(snapEffect); + } + + + + +} diff --git a/src/main/java/anvil/infinity/registry/Sounds.java b/src/main/java/anvil/infinity/registry/Sounds.java new file mode 100644 index 0000000..77a1acd --- /dev/null +++ b/src/main/java/anvil/infinity/registry/Sounds.java @@ -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 e) { + + snap.setRegistryName("soundSnap"); + + e.getRegistry().register(snap); + } + +} diff --git a/src/main/resources/assets/infinity/lang/de_DE.lang b/src/main/resources/assets/infinity/lang/de_DE.lang new file mode 100644 index 0000000..317bc5a --- /dev/null +++ b/src/main/resources/assets/infinity/lang/de_DE.lang @@ -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. \ No newline at end of file diff --git a/src/main/resources/assets/infinity/lang/en_US.lang b/src/main/resources/assets/infinity/lang/en_US.lang new file mode 100644 index 0000000..31056e1 --- /dev/null +++ b/src/main/resources/assets/infinity/lang/en_US.lang @@ -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 \ No newline at end of file diff --git a/src/main/resources/assets/infinity/lang/tr_TR.lang b/src/main/resources/assets/infinity/lang/tr_TR.lang new file mode 100644 index 0000000..921a019 --- /dev/null +++ b/src/main/resources/assets/infinity/lang/tr_TR.lang @@ -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þý \ No newline at end of file diff --git a/src/main/resources/assets/infinity/models/item/mind_stone.json b/src/main/resources/assets/infinity/models/item/mind_stone.json new file mode 100644 index 0000000..1d58fd7 --- /dev/null +++ b/src/main/resources/assets/infinity/models/item/mind_stone.json @@ -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 ] + } + } +} + diff --git a/src/main/resources/assets/infinity/models/item/power_stone.json b/src/main/resources/assets/infinity/models/item/power_stone.json new file mode 100644 index 0000000..1d58fd7 --- /dev/null +++ b/src/main/resources/assets/infinity/models/item/power_stone.json @@ -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 ] + } + } +} + diff --git a/src/main/resources/assets/infinity/models/item/reality_stone.json b/src/main/resources/assets/infinity/models/item/reality_stone.json new file mode 100644 index 0000000..1d58fd7 --- /dev/null +++ b/src/main/resources/assets/infinity/models/item/reality_stone.json @@ -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 ] + } + } +} + diff --git a/src/main/resources/assets/infinity/models/item/soul_stone.json b/src/main/resources/assets/infinity/models/item/soul_stone.json new file mode 100644 index 0000000..1d58fd7 --- /dev/null +++ b/src/main/resources/assets/infinity/models/item/soul_stone.json @@ -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 ] + } + } +} + diff --git a/src/main/resources/assets/infinity/models/item/time_stone.json b/src/main/resources/assets/infinity/models/item/time_stone.json new file mode 100644 index 0000000..1d58fd7 --- /dev/null +++ b/src/main/resources/assets/infinity/models/item/time_stone.json @@ -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 ] + } + } +} + diff --git a/src/main/resources/assets/infinity/sounds.json b/src/main/resources/assets/infinity/sounds.json new file mode 100644 index 0000000..52eab34 --- /dev/null +++ b/src/main/resources/assets/infinity/sounds.json @@ -0,0 +1,5 @@ +{ + "snap": { + "sounds": [ "infinity:snap1", "infinity:snap2", "infinity:snap3", "infinity:snap4", "infinity:snap5", "infinity:snap6" ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/infinity/sounds/snap1.ogg b/src/main/resources/assets/infinity/sounds/snap1.ogg new file mode 100644 index 0000000..5d93fab Binary files /dev/null and b/src/main/resources/assets/infinity/sounds/snap1.ogg differ diff --git a/src/main/resources/assets/infinity/sounds/snap2.ogg b/src/main/resources/assets/infinity/sounds/snap2.ogg new file mode 100644 index 0000000..29c1b0c Binary files /dev/null and b/src/main/resources/assets/infinity/sounds/snap2.ogg differ diff --git a/src/main/resources/assets/infinity/sounds/snap3.ogg b/src/main/resources/assets/infinity/sounds/snap3.ogg new file mode 100644 index 0000000..8492af4 Binary files /dev/null and b/src/main/resources/assets/infinity/sounds/snap3.ogg differ diff --git a/src/main/resources/assets/infinity/sounds/snap4.ogg b/src/main/resources/assets/infinity/sounds/snap4.ogg new file mode 100644 index 0000000..21cabe2 Binary files /dev/null and b/src/main/resources/assets/infinity/sounds/snap4.ogg differ diff --git a/src/main/resources/assets/infinity/sounds/snap5.ogg b/src/main/resources/assets/infinity/sounds/snap5.ogg new file mode 100644 index 0000000..19b2dc9 Binary files /dev/null and b/src/main/resources/assets/infinity/sounds/snap5.ogg differ diff --git a/src/main/resources/assets/infinity/sounds/snap6.ogg b/src/main/resources/assets/infinity/sounds/snap6.ogg new file mode 100644 index 0000000..bec1568 Binary files /dev/null and b/src/main/resources/assets/infinity/sounds/snap6.ogg differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 0000000..9a23e10 --- /dev/null +++ b/src/main/resources/mcmod.info @@ -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": [] + } +]