forked from TAIGA/TAIGA
Compare commits
6 Commits
idlegandal
...
1.2-stable
Author | SHA1 | Date | |
---|---|---|---|
43123ea3d6 | |||
6d3c6daa87 | |||
79c2e3a579 | |||
9e54f0e62a | |||
a8c066ed1b | |||
e2d3ead5ad |
21
README.md
21
README.md
@@ -1,12 +1,8 @@
|
|||||||
> This project needs new maintainers, see #15.
|

|
||||||
|
|
||||||
|
Tinkers Alloying Addon(TAIGA)
|
||||||

|
|
||||||
|
|
||||||
Tinkers Alloying Addon (TAIGA)
|
|
||||||
===============
|
===============
|
||||||
|
TAIGA is an addon for Tinkers Construct. It aims to find new minable ores, new alloys and a bunch of new tinker traits for them.
|
||||||
TAIGA is an addon for Tinkers Construct. It adds new minable ores, new alloys and a bunch of new tinker traits for them.
|
|
||||||
|
|
||||||
Included:
|
Included:
|
||||||
* 16 new meltable Ores with 4 new hardness levels (5,6,7,8)
|
* 16 new meltable Ores with 4 new hardness levels (5,6,7,8)
|
||||||
@@ -24,9 +20,13 @@ Download
|
|||||||
Dependencies
|
Dependencies
|
||||||
===============
|
===============
|
||||||
Necessary:
|
Necessary:
|
||||||
* Tinkers Construct for 1.12.2 + associated version of mantle
|
* Tinkers Construct for 1.10.2 + associated version of mantle
|
||||||
* Minecraft Forge 1.12.2
|
* Minecraft Forge 1.10.2
|
||||||
|
|
||||||
|
Latest tests done with:
|
||||||
|
|
||||||
|
* [Tinkers Construct 2.5.5](http://minecraft.curseforge.com/projects/tinkers-construct/files)
|
||||||
|
* [Minecraft Forge 12.18.2.2107](http://files.minecraftforge.net/)
|
||||||
|
|
||||||
What's going on?
|
What's going on?
|
||||||
===
|
===
|
||||||
@@ -60,6 +60,3 @@ Where to request or report issues:
|
|||||||
|
|
||||||
More? Join our community on mumble (ofsg.eu) for questions or to have a nice chat with us!
|
More? Join our community on mumble (ofsg.eu) for questions or to have a nice chat with us!
|
||||||
|
|
||||||
#### License
|
|
||||||
|
|
||||||
This project is licensed under the conditions of the GNU GPL 3.0.
|
|
25
build.gradle
25
build.gradle
@@ -10,8 +10,8 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||||
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.1.0'
|
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.0.8'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ repositories {
|
|||||||
group = "com.sosnitzka" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group = "com.sosnitzka" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = "taiga"
|
archivesBaseName = "taiga"
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_7
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
|
|
||||||
@@ -50,6 +50,7 @@ task buildInfo {
|
|||||||
ext.buildNum = System.getenv().BUILD_NUMBER
|
ext.buildNum = System.getenv().BUILD_NUMBER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def cmd = "git log \$(git tag --sort=-refname | sed -n '2p')..\$(git tag --sort=-refname | sed -n '1p') --oneline"
|
def cmd = "git log \$(git tag --sort=-refname | sed -n '2p')..\$(git tag --sort=-refname | sed -n '1p') --oneline"
|
||||||
def proc = cmd.execute()
|
def proc = cmd.execute()
|
||||||
proc.waitFor()
|
proc.waitFor()
|
||||||
@@ -63,9 +64,9 @@ task buildInfo {
|
|||||||
version = project.buildInfo.revision
|
version = project.buildInfo.revision
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.12.2-14.23.5.2768"
|
version = "1.10.2-12.18.2.2147"
|
||||||
runDir = "run"
|
runDir = "run"
|
||||||
mappings = "snapshot_20170801"
|
mappings = "snapshot_20161101"
|
||||||
replace '@VERSION@', project.version
|
replace '@VERSION@', project.version
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,9 +75,15 @@ ext.mc_version = project.minecraft.version.split('-')[0]
|
|||||||
version = "${mc_version}-${project.buildInfo.revision}"
|
version = "${mc_version}-${project.buildInfo.revision}"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
deobfCompile "slimeknights.mantle:Mantle:1.12-1.3.+:deobf"
|
//deobfCompile "codechicken:CodeChickenLib:1.9.4-2.0.2.39:deobf"
|
||||||
deobfCompile "mezz.jei:jei_1.12.2:4.+"
|
//deobfCompile "codechicken:CodeChickenCore:1.9.4-2.0.3.65:deobf"
|
||||||
deobfCompile "slimeknights:TConstruct:1.12.2-2.10.+:deobf"
|
//deobfCompile "codechicken:NotEnoughItems:1.9-${nei_version}:dev"
|
||||||
|
deobfCompile "slimeknights.mantle:Mantle:1.10.2-1.1.+:deobf"
|
||||||
|
//Old: deobfCompile "slimeknights.mantle:Mantle:1.9-0.10.0.jenkins132:deobf"
|
||||||
|
deobfCompile "mezz.jei:jei_1.10.2:3.+"
|
||||||
|
deobfCompile "slimeknights:TConstruct:1.10.2-2.6.+:deobf"
|
||||||
|
//compile files('libs/TConstruct-1.9-2.3.1.DEV.1d4c1de-deobf.jar')
|
||||||
|
//compile group: 'com.google.guava', name: 'guava', version: '20.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -133,7 +140,7 @@ curseforge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
relations {
|
relations {
|
||||||
requiredDependency 'tinkers-construct'
|
requiredLibrary 'tinkers-construct'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,6 @@
|
|||||||
|
#Wed Jul 20 03:42:23 CEST 2016
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
|
||||||
|
26
gradlew
vendored
26
gradlew
vendored
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
##
|
||||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
|||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD="maximum"
|
||||||
|
|
||||||
warn () {
|
warn ( ) {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
die () {
|
die ( ) {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
@@ -154,19 +154,11 @@ if $cygwin ; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
save () {
|
function splitJvmOpts() {
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
JVM_OPTS=("$@")
|
||||||
echo " "
|
|
||||||
}
|
}
|
||||||
APP_ARGS=$(save "$@")
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||||
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" "$@"
|
|
||||||
|
6
gradlew.bat
vendored
6
gradlew.bat
vendored
@@ -49,6 +49,7 @@ goto fail
|
|||||||
@rem Get command-line arguments, handling Windows variants
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
:win9xME_args
|
:win9xME_args
|
||||||
@rem Slurp the command line arguments.
|
@rem Slurp the command line arguments.
|
||||||
@@ -59,6 +60,11 @@ set _SKIP=2
|
|||||||
if "x%~1" == "x" goto execute
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
@@ -13,63 +13,33 @@ public class Alloys {
|
|||||||
* Registers alloying in the smeltery
|
* Registers alloying in the smeltery
|
||||||
*/
|
*/
|
||||||
public static void register() {
|
public static void register() {
|
||||||
registerTinkerAlloy(new FluidStack(terraxFluid, 2), new FluidStack(karmesineFluid, 1), new FluidStack
|
registerTinkerAlloy(new FluidStack(terraxFluid, 2), new FluidStack(karmesineFluid, 1), new FluidStack(oviumFluid, 1), new FluidStack(jauxumFluid, 1));
|
||||||
(oviumFluid, 1), new FluidStack(jauxumFluid, 1));
|
registerTinkerAlloy(new FluidStack(triberiumFluid, 1), new FluidStack(tiberiumFluid, 5), new FluidStack(basaltFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(triberiumFluid, 1), new FluidStack(tiberiumFluid, 5), new FluidStack
|
registerTinkerAlloy(new FluidStack(fractumFluid, 2), new FluidStack(triberiumFluid, 3), new FluidStack(TinkerFluids.obsidian, 3), new FluidStack(abyssumFluid, 1));
|
||||||
(basaltFluid, 1));
|
registerTinkerAlloy(new FluidStack(violiumFluid, 2), new FluidStack(auroriumFluid, 3), new FluidStack(TinkerFluids.ardite, 2));
|
||||||
registerTinkerAlloy(new FluidStack(triberiumFluid, 1), new FluidStack(tiberiumFluid, 5), new FluidStack
|
registerTinkerAlloy(new FluidStack(proxiiFluid, 3), new FluidStack(prometheumFluid, 3), new FluidStack(palladiumFluid, 3), new FluidStack(eezoFluid, 1));
|
||||||
(dilithiumFluid, 2));
|
registerTinkerAlloy(new FluidStack(tritoniteFluid, 2), new FluidStack(TinkerFluids.cobalt, 3), new FluidStack(terraxFluid, 2));
|
||||||
registerTinkerAlloy(new FluidStack(fractumFluid, 2), new FluidStack(triberiumFluid, 3), new FluidStack
|
registerTinkerAlloy(new FluidStack(ignitzFluid, 2), new FluidStack(TinkerFluids.ardite, 2), new FluidStack(terraxFluid, 2), new FluidStack(osramFluid, 1));
|
||||||
(TinkerFluids.obsidian, 3), new FluidStack(abyssumFluid, 1));
|
registerTinkerAlloy(new FluidStack(imperomiteFluid, 2), new FluidStack(duraniteFluid, 3), new FluidStack(prometheumFluid, 1), new FluidStack(abyssumFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(violiumFluid, 2), new FluidStack(auroriumFluid, 3), new FluidStack
|
registerTinkerAlloy(new FluidStack(solariumFluid, 2), new FluidStack(valyriumFluid, 2), new FluidStack(uruFluid, 2), new FluidStack(nucleumFluid, 1));
|
||||||
(TinkerFluids.ardite, 2));
|
registerTinkerAlloy(new FluidStack(adamantFluid, 3), new FluidStack(vibraniumFluid, 1), new FluidStack(solariumFluid, 1), new FluidStack(ioxFluid, 3));
|
||||||
registerTinkerAlloy(new FluidStack(proxiiFluid, 3), new FluidStack(prometheumFluid, 3), new FluidStack
|
registerTinkerAlloy(new FluidStack(nihiliteFluid, 1), new FluidStack(vibraniumFluid, 1), new FluidStack(solariumFluid, 1));
|
||||||
(palladiumFluid, 3), new FluidStack(eezoFluid, 1));
|
registerTinkerAlloy(new FluidStack(seismumFluid, 4), new FluidStack(TinkerFluids.obsidian, 4), new FluidStack(triberiumFluid, 2), new FluidStack(eezoFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(tritoniteFluid, 2), new FluidStack(TinkerFluids.cobalt, 3), new FluidStack
|
registerTinkerAlloy(new FluidStack(astriumFluid, 2), new FluidStack(terraxFluid, 3), new FluidStack(auroriumFluid, 2));
|
||||||
(terraxFluid, 2));
|
registerTinkerAlloy(new FluidStack(niobFluid, 3), new FluidStack(palladiumFluid, 3), new FluidStack(duraniteFluid, 1), new FluidStack(osramFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(ignitzFluid, 2), new FluidStack(TinkerFluids.ardite, 2), new FluidStack
|
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack(valyriumFluid, 3), new FluidStack(osramFluid, 1));
|
||||||
(terraxFluid, 2), new FluidStack(osramFluid, 1));
|
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack(valyriumFluid, 3), new FluidStack(eezoFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(imperomiteFluid, 2), new FluidStack(duraniteFluid, 3), new FluidStack
|
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack(valyriumFluid, 3), new FluidStack(abyssumFluid, 1));
|
||||||
(prometheumFluid, 1), new FluidStack(abyssumFluid, 1));
|
registerTinkerAlloy(new FluidStack(ioxFluid, 1), new FluidStack(eezoFluid, 2), new FluidStack(abyssumFluid, 2), new FluidStack(osramFluid, 2), new FluidStack(obsidioriteFluid, 9));
|
||||||
registerTinkerAlloy(new FluidStack(solariumFluid, 2), new FluidStack(valyriumFluid, 2), new FluidStack
|
registerTinkerAlloy(new FluidStack(ioxFluid, 1), new FluidStack(eezoFluid, 2), new FluidStack(abyssumFluid, 2), new FluidStack(osramFluid, 2), new FluidStack(meteoriteFluid, 9), new FluidStack(TinkerFluids.obsidian, 9));
|
||||||
(uruFluid, 2), new FluidStack(nucleumFluid, 1));
|
registerTinkerAlloy(new FluidStack(lumixFluid, 1), new FluidStack(palladiumFluid, 1), new FluidStack(terraxFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(adamantFluid, 3), new FluidStack(vibraniumFluid, 1), new FluidStack
|
registerTinkerAlloy(new FluidStack(obsidioriteFluid, 1), new FluidStack(meteoriteFluid, 1), new FluidStack(TinkerFluids.obsidian, 1));
|
||||||
(solariumFluid, 1), new FluidStack(ioxFluid, 3));
|
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(proxiiFluid, 3), new FluidStack(abyssumFluid, 1), new FluidStack(osramFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(nihiliteFluid, 1), new FluidStack(vibraniumFluid, 1), new FluidStack
|
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(imperomiteFluid, 3), new FluidStack(osramFluid, 1), new FluidStack(eezoFluid, 1));
|
||||||
(solariumFluid, 1));
|
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(niobFluid, 3), new FluidStack(eezoFluid, 1), new FluidStack(abyssumFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(seismumFluid, 4), new FluidStack(TinkerFluids.obsidian, 4), new FluidStack
|
registerTinkerAlloy(new FluidStack(dyoniteFluid, 3), new FluidStack(triberiumFluid, 3), new FluidStack(fractumFluid, 1), new FluidStack(seismumFluid, 1), new FluidStack(osramFluid, 1));
|
||||||
(triberiumFluid, 2), new FluidStack(eezoFluid, 1));
|
registerTinkerAlloy(new FluidStack(dyoniteFluid, 3), new FluidStack(tiberiumFluid, 12), new FluidStack(fractumFluid, 1), new FluidStack(seismumFluid, 1), new FluidStack(osramFluid, 1));
|
||||||
registerTinkerAlloy(new FluidStack(astriumFluid, 2), new FluidStack(terraxFluid, 3), new FluidStack
|
registerTinkerAlloy(new FluidStack(nitroniteFluid, 6), new FluidStack(magmaFluid, 6), new FluidStack(osramFluid, 1));
|
||||||
(auroriumFluid, 2));
|
|
||||||
registerTinkerAlloy(new FluidStack(niobFluid, 3), new FluidStack(palladiumFluid, 3), new FluidStack
|
|
||||||
(duraniteFluid, 1), new FluidStack(osramFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack
|
|
||||||
(valyriumFluid, 3), new FluidStack(osramFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack
|
|
||||||
(valyriumFluid, 3), new FluidStack(eezoFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack
|
|
||||||
(valyriumFluid, 3), new FluidStack(abyssumFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(ioxFluid, 1), new FluidStack(eezoFluid, 2), new FluidStack(abyssumFluid,
|
|
||||||
2), new FluidStack(osramFluid, 2), new FluidStack(obsidioriteFluid, 9));
|
|
||||||
registerTinkerAlloy(new FluidStack(ioxFluid, 1), new FluidStack(eezoFluid, 2), new FluidStack(abyssumFluid,
|
|
||||||
2), new FluidStack(osramFluid, 2), new FluidStack(meteoriteFluid, 9), new FluidStack(TinkerFluids
|
|
||||||
.obsidian, 9));
|
|
||||||
registerTinkerAlloy(new FluidStack(lumixFluid, 1), new FluidStack(palladiumFluid, 1), new FluidStack
|
|
||||||
(terraxFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(obsidioriteFluid, 1), new FluidStack(meteoriteFluid, 1), new FluidStack
|
|
||||||
(TinkerFluids.obsidian, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(proxiiFluid, 3), new FluidStack
|
|
||||||
(abyssumFluid, 1), new FluidStack(osramFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(imperomiteFluid, 3), new FluidStack
|
|
||||||
(osramFluid, 1), new FluidStack(eezoFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(niobFluid, 3), new FluidStack(eezoFluid,
|
|
||||||
1), new FluidStack(abyssumFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(dyoniteFluid, 3), new FluidStack(triberiumFluid, 3), new FluidStack
|
|
||||||
(fractumFluid, 1), new FluidStack(seismumFluid, 1), new FluidStack(osramFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(dyoniteFluid, 3), new FluidStack(tiberiumFluid, 12), new FluidStack
|
|
||||||
(fractumFluid, 1), new FluidStack(seismumFluid, 1), new FluidStack(osramFluid, 1));
|
|
||||||
registerTinkerAlloy(new FluidStack(nitroniteFluid, 6), new FluidStack(magmaFluid, 6), new FluidStack
|
|
||||||
(osramFluid, 1));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,12 +5,9 @@ import com.sosnitzka.taiga.blocks.BlockCobble;
|
|||||||
import com.sosnitzka.taiga.blocks.BlockMeteoriteRock;
|
import com.sosnitzka.taiga.blocks.BlockMeteoriteRock;
|
||||||
import com.sosnitzka.taiga.blocks.BlockTiberium;
|
import com.sosnitzka.taiga.blocks.BlockTiberium;
|
||||||
import com.sosnitzka.taiga.generic.BasicBlock;
|
import com.sosnitzka.taiga.generic.BasicBlock;
|
||||||
import com.sosnitzka.taiga.generic.BlockOre;
|
import com.sosnitzka.taiga.util.Utils;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.item.ItemBlock;
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@@ -24,72 +21,53 @@ import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
|
|||||||
|
|
||||||
public class Blocks {
|
public class Blocks {
|
||||||
|
|
||||||
|
|
||||||
// blocks and ores spawned via worldgen
|
// blocks and ores spawned via worldgen
|
||||||
public static Block basaltBlock = new BasicBlock("basalt_block", Material.ROCK, 20.0f, 35.0f, IRON, PREFIX_BLOCK);
|
public static Block basaltBlock = new BasicBlock("basalt_block", Material.ROCK, 20.0f, 35.0f, DIAMOND, PREFIX_BLOCK);
|
||||||
public static Block tiberiumOre = new BlockTiberium();
|
public static Block tiberiumOre = new BlockTiberium();
|
||||||
public static Block auroriumOre = new BasicBlock("aurorium_ore", Material.ROCK, 15.0f, 12f, COBALT, 0.2f,
|
public static Block auroriumOre = new BasicBlock("aurorium_ore", Material.ROCK, 15.0f, 12f, COBALT, 0.2f, PREFIX_ORE);
|
||||||
PREFIX_ORE);
|
public static Block prometheumOre = new BasicBlock("prometheum_ore", Material.ROCK, 20.0f, 12f, DURANITE, 0.4f, PREFIX_ORE);
|
||||||
public static Block prometheumOre = new BasicBlock("prometheum_ore", Material.ROCK, 20.0f, 12f, DURANITE, 0.4f,
|
|
||||||
PREFIX_ORE);
|
|
||||||
public static Block duraniteOre = new BasicBlock("duranite_ore", Material.ROCK, 25.0f, 1000f, DURANITE, PREFIX_ORE);
|
public static Block duraniteOre = new BasicBlock("duranite_ore", Material.ROCK, 25.0f, 1000f, DURANITE, PREFIX_ORE);
|
||||||
public static Block valyriumOre = new BasicBlock("valyrium_ore", Material.ROCK, 35.0f, 2000f, VALYRIUM, PREFIX_ORE);
|
public static Block valyriumOre = new BasicBlock("valyrium_ore", Material.ROCK, 35.0f, 2000f, VALYRIUM, PREFIX_ORE);
|
||||||
public static Block vibraniumOre = new BasicBlock("vibranium_ore", Material.ROCK, 40.0f, 3000f, VIBRANIUM,
|
public static Block vibraniumOre = new BasicBlock("vibranium_ore", Material.ROCK, 40.0f, 3000f, VIBRANIUM, PREFIX_ORE);
|
||||||
PREFIX_ORE);
|
|
||||||
public static Block karmesineOre = new BasicBlock("karmesine_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
|
public static Block karmesineOre = new BasicBlock("karmesine_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
|
||||||
public static Block oviumOre = new BasicBlock("ovium_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
|
public static Block oviumOre = new BasicBlock("ovium_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
|
||||||
public static Block jauxumOre = new BasicBlock("jauxum_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
|
public static Block jauxumOre = new BasicBlock("jauxum_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
|
||||||
public static Block palladiumOre = new BasicBlock("palladium_ore", Material.ROCK, 25.0f, 150f, DURANITE, 0.4f,
|
public static Block palladiumOre = new BasicBlock("palladium_ore", Material.ROCK, 25.0f, 150f, DURANITE, 0.4f, PREFIX_ORE);
|
||||||
PREFIX_ORE);
|
|
||||||
public static Block uruOre = new BasicBlock("uru_ore", Material.ROCK, 35.0f, 500f, VALYRIUM, PREFIX_ORE);
|
public static Block uruOre = new BasicBlock("uru_ore", Material.ROCK, 35.0f, 500f, VALYRIUM, PREFIX_ORE);
|
||||||
public static Block osramOre = new BasicBlock("osram_ore", Material.ROCK, 15.0f, 35.0f, COBALT, PREFIX_ORE);
|
public static Block osramOre = new BasicBlock("osram_ore", Material.ROCK, 15.0f, 35.0f, COBALT, PREFIX_ORE);
|
||||||
public static Block eezoOre = new BasicBlock("eezo_ore", Material.ROCK, 50.0f, 50000.0f, COBALT, PREFIX_ORE);
|
public static Block eezoOre = new BasicBlock("eezo_ore", Material.ROCK, 50.0f, 50000.0f, COBALT, PREFIX_ORE);
|
||||||
public static Block abyssumOre = new BasicBlock("abyssum_ore", Material.ROCK, 15.0f, 35.0f, COBALT, PREFIX_ORE);
|
public static Block abyssumOre = new BasicBlock("abyssum_ore", Material.ROCK, 15.0f, 35.0f, COBALT, PREFIX_ORE);
|
||||||
|
|
||||||
// Ore Castsee
|
// Ore Castsee
|
||||||
public static Block tiberiumBlock = new BasicBlock("tiberium_block", Material.GLASS, 10.0f, 15f, STONE, 1f,
|
public static Block tiberiumBlock = new BasicBlock("tiberium_block", Material.ROCK, 10.0f, 15f, STONE, 1f, PREFIX_BLOCK);
|
||||||
PREFIX_BLOCK);
|
public static Block auroriumBlock = new BasicBlock("aurorium_block", Material.ROCK, 15.0f, 15f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block auroriumBlock = new BasicBlock("aurorium_block", Material.ROCK, 15.0f, 15f, COBALT,
|
public static Block prometheumBlock = new BasicBlock("prometheum_block", Material.ROCK, 20.0f, 15f, DURANITE, 0.5f, PREFIX_BLOCK);
|
||||||
PREFIX_BLOCK);
|
public static Block duraniteBlock = new BasicBlock("duranite_block", Material.ROCK, 20.0f, 800f, DURANITE, PREFIX_BLOCK);
|
||||||
public static Block prometheumBlock = new BasicBlock("prometheum_block", Material.ROCK, 20.0f, 15f, DURANITE,
|
public static Block valyriumBlock = new BasicBlock("valyrium_block", Material.ROCK, 20.0f, 1500f, VALYRIUM, PREFIX_BLOCK);
|
||||||
0.5f, PREFIX_BLOCK);
|
public static Block vibraniumBlock = new BasicBlock("vibranium_block", Material.ROCK, 20.0f, 3000f, VIBRANIUM, PREFIX_BLOCK);
|
||||||
public static Block duraniteBlock = new BasicBlock("duranite_block", Material.ROCK, 20.0f, 800f, DURANITE,
|
public static Block karmesineBlock = new BasicBlock("karmesine_block", Material.ROCK, 10.0f, 12f, COBALT, PREFIX_BLOCK);
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block valyriumBlock = new BasicBlock("valyrium_block", Material.ROCK, 20.0f, 1500f, VALYRIUM,
|
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block vibraniumBlock = new BasicBlock("vibranium_block", Material.ROCK, 20.0f, 3000f, VIBRANIUM,
|
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block karmesineBlock = new BasicBlock("karmesine_block", Material.ROCK, 10.0f, 12f, COBALT,
|
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block oviumBlock = new BasicBlock("ovium_block", Material.ROCK, 10.0f, 12f, COBALT, PREFIX_BLOCK);
|
public static Block oviumBlock = new BasicBlock("ovium_block", Material.ROCK, 10.0f, 12f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block jauxumBlock = new BasicBlock("jauxum_block", Material.ROCK, 10.0f, 12f, COBALT, PREFIX_BLOCK);
|
public static Block jauxumBlock = new BasicBlock("jauxum_block", Material.ROCK, 10.0f, 12f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block palladiumBlock = new BasicBlock("palladium_block", Material.ROCK, 25.0f, 150f, DURANITE,
|
public static Block palladiumBlock = new BasicBlock("palladium_block", Material.ROCK, 25.0f, 150f, DURANITE, 0.5f, PREFIX_BLOCK);
|
||||||
0.5f, PREFIX_BLOCK);
|
|
||||||
public static Block uruBlock = new BasicBlock("uru_block", Material.ROCK, 30.0f, 500f, VALYRIUM, PREFIX_BLOCK);
|
public static Block uruBlock = new BasicBlock("uru_block", Material.ROCK, 30.0f, 500f, VALYRIUM, PREFIX_BLOCK);
|
||||||
public static Block osramBlock = new BasicBlock("osram_block", Material.ROCK, 15.0f, 12f, COBALT, PREFIX_BLOCK);
|
public static Block osramBlock = new BasicBlock("osram_block", Material.ROCK, 15.0f, 12f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block abyssumBlock = new BasicBlock("abyssum_block", Material.ROCK, 15.0f, 35f, COBALT, PREFIX_BLOCK);
|
public static Block abyssumBlock = new BasicBlock("abyssum_block", Material.ROCK, 15.0f, 35f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block eezoBlock = new BasicBlock("eezo_block", Material.ROCK, 20.0f, 1000f, COBALT, PREFIX_BLOCK);
|
public static Block eezoBlock = new BasicBlock("eezo_block", Material.ROCK, 20.0f, 1000f, COBALT, PREFIX_BLOCK);
|
||||||
|
|
||||||
public static Block terraxBlock = new BasicBlock("terrax_block", Material.ROCK, 10.0f, 15f, COBALT, PREFIX_BLOCK);
|
public static Block terraxBlock = new BasicBlock("terrax_block", Material.ROCK, 10.0f, 15f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block triberiumBlock = new BasicBlock("triberium_block", Material.ROCK, 15.0f, 15f, OBSIDIAN, 1f,
|
public static Block triberiumBlock = new BasicBlock("triberium_block", Material.ROCK, 15.0f, 15f, OBSIDIAN, 1f, PREFIX_BLOCK);
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block fractumBlock = new BasicBlock("fractum_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
public static Block fractumBlock = new BasicBlock("fractum_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block violiumBlock = new BasicBlock("violium_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
public static Block violiumBlock = new BasicBlock("violium_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block proxiiBlock = new BasicBlock("proxii_block", Material.ROCK, 15.0f, 25f, DURANITE, PREFIX_BLOCK);
|
public static Block proxiiBlock = new BasicBlock("proxii_block", Material.ROCK, 15.0f, 25f, DURANITE, PREFIX_BLOCK);
|
||||||
public static Block tritoniteBlock = new BasicBlock("tritonite_block", Material.ROCK, 15.0f, 25f, COBALT,
|
public static Block tritoniteBlock = new BasicBlock("tritonite_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block ignitzBlock = new BasicBlock("ignitz_block", Material.ROCK, 20.0f, 20f, COBALT, PREFIX_BLOCK);
|
public static Block ignitzBlock = new BasicBlock("ignitz_block", Material.ROCK, 20.0f, 20f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block imperomiteBlock = new BasicBlock("imperomite_block", Material.ROCK, 20.0f, 25f, DURANITE,
|
public static Block imperomiteBlock = new BasicBlock("imperomite_block", Material.ROCK, 20.0f, 25f, DURANITE, PREFIX_BLOCK);
|
||||||
PREFIX_BLOCK);
|
public static Block solariumBlock = new BasicBlock("solarium_block", Material.ROCK, 25.0f, 25f, VIBRANIUM, PREFIX_BLOCK);
|
||||||
public static Block solariumBlock = new BasicBlock("solarium_block", Material.ROCK, 25.0f, 25f, VIBRANIUM,
|
public static Block nihiliteBlock = new BasicBlock("nihilite_block", Material.ROCK, 10.0f, 25f, VALYRIUM, PREFIX_BLOCK);
|
||||||
PREFIX_BLOCK);
|
public static Block adamantBlock = new BasicBlock("adamant_block", Material.ROCK, 25.0f, 25f, VIBRANIUM, PREFIX_BLOCK);
|
||||||
public static Block nihiliteBlock = new BasicBlock("nihilite_block", Material.ROCK, 10.0f, 25f, VALYRIUM,
|
public static Block dyoniteBlock = new BasicBlock("dyonite_block", Material.ROCK, 10.0f, 25f, DURANITE, PREFIX_BLOCK);
|
||||||
PREFIX_BLOCK);
|
public static Block nucleumBlock = new BasicBlock("nucleum_block", Material.ROCK, 10.0f, 25f, VALYRIUM, PREFIX_BLOCK);
|
||||||
public static Block adamantBlock = new BasicBlock("adamant_block", Material.ROCK, 25.0f, 25f, VIBRANIUM,
|
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block dyoniteBlock = new BasicBlock("dyonite_block", Material.ROCK, 10.0f, 25f, DURANITE,
|
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block nucleumBlock = new BasicBlock("nucleum_block", Material.ROCK, 10.0f, 25f, VALYRIUM,
|
|
||||||
PREFIX_BLOCK);
|
|
||||||
public static Block lumixBlock = new BasicBlock("lumix_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
public static Block lumixBlock = new BasicBlock("lumix_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block seismumBlock = new BasicBlock("seismum_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
public static Block seismumBlock = new BasicBlock("seismum_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
||||||
public static Block astriumBlock = new BasicBlock("astrium_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
public static Block astriumBlock = new BasicBlock("astrium_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
|
||||||
@@ -98,18 +76,11 @@ public class Blocks {
|
|||||||
public static Block ioxBlock = new BasicBlock("iox_block", Material.ROCK, 20.0f, 25f, DURANITE, PREFIX_BLOCK);
|
public static Block ioxBlock = new BasicBlock("iox_block", Material.ROCK, 20.0f, 25f, DURANITE, PREFIX_BLOCK);
|
||||||
|
|
||||||
|
|
||||||
public static Block blockMeteoriteCobble = new BlockCobble("meteoritecobble_block", Material.ROCK, 20f, 10f,
|
public static Block blockMeteoriteCobble = new BlockCobble("meteoritecobble_block", Material.ROCK, 20f, 10f, COBALT, 0.075f, PREFIX_BLOCK);
|
||||||
COBALT, 0.075f, PREFIX_BLOCK);
|
public static Block blockObsidioriteCobble = new BlockCobble("obsidioritecobble_block", Material.ROCK, 25f, 20f, DURANITE, 0.035f, PREFIX_BLOCK);
|
||||||
public static Block blockObsidioriteCobble = new BlockCobble("obsidioritecobble_block", Material.ROCK, 25f, 20f,
|
public static Block blockMeteorite = new BlockMeteoriteRock("meteorite_block", Material.ROCK, 40f, 2000f, COBALT, 0.15f, PREFIX_BLOCK, blockMeteoriteCobble.getDefaultState());
|
||||||
DURANITE, 0.035f, PREFIX_BLOCK);
|
public static Block blockObsidiorite = new BlockMeteoriteRock("obsidiorite_block", Material.ROCK, 50f, 4000f, DURANITE, 0.2f, PREFIX_BLOCK, blockObsidioriteCobble.getDefaultState());
|
||||||
public static Block blockMeteorite = new BlockMeteoriteRock("meteorite_block", Material.ROCK, 40f, 2000f, COBALT,
|
|
||||||
0.15f, PREFIX_BLOCK, blockMeteoriteCobble.getDefaultState());
|
|
||||||
public static Block blockObsidiorite = new BlockMeteoriteRock("obsidiorite_block", Material.ROCK, 50f, 4000f,
|
|
||||||
DURANITE, 0.2f, PREFIX_BLOCK, blockObsidioriteCobble.getDefaultState());
|
|
||||||
|
|
||||||
// Community
|
|
||||||
public static Block dilithiumOre = new BlockOre("dilithium_ore", Material.GLASS, 18f, 18f, DIAMOND, 0.73f, Items.dilithiumCrystal, 3, 10);
|
|
||||||
public static Block dilithiumBlock = new BasicBlock("dilithium_block", Material.GLASS, 18f, 18f, DIAMOND, 0.73f, PREFIX_BLOCK);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers all materials' ingots and nuggets <br>
|
* Registers all materials' ingots and nuggets <br>
|
||||||
@@ -117,32 +88,26 @@ public class Blocks {
|
|||||||
* Gets the ingots declared in the class (fields and reflection) and iterates through them: <br>
|
* Gets the ingots declared in the class (fields and reflection) and iterates through them: <br>
|
||||||
* Checks that the field is static, registers the field (item), and adds an oreDict entry if needed
|
* Checks that the field is static, registers the field (item), and adds an oreDict entry if needed
|
||||||
*/
|
*/
|
||||||
@SubscribeEvent
|
public static void register() {
|
||||||
public static void register(boolean oreDict) {
|
|
||||||
Field[] declaredFields = Blocks.class.getDeclaredFields(); // Gets the fields (ingots) declared above
|
Field[] declaredFields = Blocks.class.getDeclaredFields(); // Gets the fields (ingots) declared above
|
||||||
for (Field field : declaredFields) { // Iterates through the fields declared above
|
for (Field field : declaredFields) { // Iterates through the fields declared above
|
||||||
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
|
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
|
||||||
Class<?> targetType = field.getType();
|
Class<?> targetType = field.getType();
|
||||||
try {
|
try {
|
||||||
Block block = (Block) field.get(targetType);
|
Block block = (Block) field.get(targetType); // Gets the field as a BasicBlock which is then casted to an Block
|
||||||
if (!oreDict) {
|
block.setCreativeTab(CreativeTab.tabTaigaBlock);
|
||||||
block.setCreativeTab(CreativeTab.tabTaigaBlock);
|
Utils.registerBlockWithItem(block); // Registers block and its item
|
||||||
ForgeRegistries.BLOCKS.register(block); // Registers block and its item
|
if (block instanceof BasicBlock) { // Checks that the block is a BasicBlock
|
||||||
} else {
|
if (((BasicBlock) block).isOreDict()) { // Checks that the block has an oreDict entry
|
||||||
if (block instanceof BasicBlock) { // Checks that the block is a BasicBlock
|
String oreDictName;
|
||||||
if (((BasicBlock) block).isOreDict()) { // Checks that the block has an oreDict entry
|
String[] nameParts = block.getUnlocalizedName().replace("tile.", "").split("_");
|
||||||
String oreDictName;
|
|
||||||
String[] nameParts = block.getUnlocalizedName().replace("tile.", "").split("_");
|
|
||||||
|
|
||||||
if (nameParts.length > 2) {
|
if (nameParts.length > 2) {
|
||||||
oreDictName = Joiner.on("_").join(Arrays.copyOfRange(nameParts, 0, nameParts
|
oreDictName = Joiner.on("_").join(Arrays.copyOfRange(nameParts, 0, nameParts.length - 1));
|
||||||
.length - 1));
|
} else {
|
||||||
} else {
|
oreDictName = nameParts[0];
|
||||||
oreDictName = nameParts[0];
|
|
||||||
}
|
|
||||||
OreDictionary.registerOre(((BasicBlock) block).getOreDictPrefix() + StringUtils
|
|
||||||
.capitalize(oreDictName), block); // Registers the block's oreDict
|
|
||||||
}
|
}
|
||||||
|
OreDictionary.registerOre(((BasicBlock) block).getOreDictPrefix() + StringUtils.capitalize(oreDictName), block); // Registers the block's oreDict
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
@@ -151,21 +116,4 @@ public class Blocks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public static void registerItems() {
|
|
||||||
Field[] declaredFields = Blocks.class.getDeclaredFields(); // Gets the fields (ingots) declared above
|
|
||||||
for (Field field : declaredFields) { // Iterates through the fields declared above
|
|
||||||
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
|
|
||||||
Class<?> targetType = field.getType();
|
|
||||||
try {
|
|
||||||
Block block = (Block) field.get(targetType); // Gets the field as a BasicBlock which is then
|
|
||||||
// casted to an Block
|
|
||||||
ForgeRegistries.ITEMS.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,6 @@ package com.sosnitzka.taiga;
|
|||||||
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import static com.sosnitzka.taiga.Blocks.adamantBlock;
|
import static com.sosnitzka.taiga.Blocks.adamantBlock;
|
||||||
import static com.sosnitzka.taiga.Items.solariumIngot;
|
import static com.sosnitzka.taiga.Items.solariumIngot;
|
||||||
@@ -13,15 +12,15 @@ public class CreativeTab {
|
|||||||
|
|
||||||
public static final CreativeTabs tabTaigaBlock = new CreativeTabs("taiga_block") {
|
public static final CreativeTabs tabTaigaBlock = new CreativeTabs("taiga_block") {
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getTabIconItem() {
|
public Item getTabIconItem() {
|
||||||
return new ItemStack(Item.getItemFromBlock(adamantBlock));
|
return Item.getItemFromBlock(adamantBlock);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final CreativeTabs tabTaigaItem = new CreativeTabs("taiga_item") {
|
public static final CreativeTabs tabTaigaItem = new CreativeTabs("taiga_item") {
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getTabIconItem() {
|
public Item getTabIconItem() {
|
||||||
return new ItemStack(solariumIngot);
|
return solariumIngot;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,8 @@ package com.sosnitzka.taiga;
|
|||||||
|
|
||||||
|
|
||||||
import com.sosnitzka.taiga.generic.BasicTinkerFluid;
|
import com.sosnitzka.taiga.generic.BasicTinkerFluid;
|
||||||
import net.minecraft.item.ItemBlock;
|
import com.sosnitzka.taiga.util.Utils;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
|
||||||
import slimeknights.tconstruct.library.TinkerRegistry;
|
import slimeknights.tconstruct.library.TinkerRegistry;
|
||||||
import slimeknights.tconstruct.smeltery.block.BlockMolten;
|
import slimeknights.tconstruct.smeltery.block.BlockMolten;
|
||||||
|
|
||||||
@@ -15,14 +14,12 @@ import static com.sosnitzka.taiga.util.Utils.registerFluid;
|
|||||||
public class Fluids {
|
public class Fluids {
|
||||||
|
|
||||||
public static BasicTinkerFluid basaltFluid = new BasicTinkerFluid("basalt_fluid", 0xFFe4ddc3, 550, 10, 6000);
|
public static BasicTinkerFluid basaltFluid = new BasicTinkerFluid("basalt_fluid", 0xFFe4ddc3, 550, 10, 6000);
|
||||||
public static BasicTinkerFluid tiberiumFluid = new BasicTinkerFluid("tiberium_fluid", 0xFFd4ff00, 400, 10, 8000);
|
public static BasicTinkerFluid tiberiumFluid = new BasicTinkerFluid("tiberium_fluid", 0xFF66f136, 400, 10, 8000);
|
||||||
public static BasicTinkerFluid auroriumFluid = new BasicTinkerFluid("aurorium_fluid", 0xFFefae94, 750, 10, 10000);
|
public static BasicTinkerFluid auroriumFluid = new BasicTinkerFluid("aurorium_fluid", 0xFFefae94, 750, 10, 10000);
|
||||||
public static BasicTinkerFluid prometheumFluid = new BasicTinkerFluid("prometheum_fluid", 0xFF372c49, 850, 10,
|
public static BasicTinkerFluid prometheumFluid = new BasicTinkerFluid("prometheum_fluid", 0xFF372c49, 850, 10, 10000);
|
||||||
10000);
|
|
||||||
public static BasicTinkerFluid duraniteFluid = new BasicTinkerFluid("duranite_fluid", 0xFFacddeb, 1400, 10, 10000);
|
public static BasicTinkerFluid duraniteFluid = new BasicTinkerFluid("duranite_fluid", 0xFFacddeb, 1400, 10, 10000);
|
||||||
public static BasicTinkerFluid valyriumFluid = new BasicTinkerFluid("valyrium_fluid", 0xFFe85c31, 1915, 10, 10000);
|
public static BasicTinkerFluid valyriumFluid = new BasicTinkerFluid("valyrium_fluid", 0xFFe85c31, 1915, 10, 10000);
|
||||||
public static BasicTinkerFluid vibraniumFluid = new BasicTinkerFluid("vibranium_fluid", 0xFFbad2d9, 3050, 10,
|
public static BasicTinkerFluid vibraniumFluid = new BasicTinkerFluid("vibranium_fluid", 0xFFbad2d9, 3050, 10, 10000);
|
||||||
10000);
|
|
||||||
public static BasicTinkerFluid karmesineFluid = new BasicTinkerFluid("karmesine_fluid", 0xFFeb484a, 750, 10, 9000);
|
public static BasicTinkerFluid karmesineFluid = new BasicTinkerFluid("karmesine_fluid", 0xFFeb484a, 750, 10, 9000);
|
||||||
public static BasicTinkerFluid jauxumFluid = new BasicTinkerFluid("jauxum_fluid", 0xFF68c663, 750, 10, 9000);
|
public static BasicTinkerFluid jauxumFluid = new BasicTinkerFluid("jauxum_fluid", 0xFF68c663, 750, 10, 9000);
|
||||||
public static BasicTinkerFluid oviumFluid = new BasicTinkerFluid("ovium_fluid", 0xFF7d77c3, 750, 10, 9000);
|
public static BasicTinkerFluid oviumFluid = new BasicTinkerFluid("ovium_fluid", 0xFF7d77c3, 750, 10, 9000);
|
||||||
@@ -32,14 +29,13 @@ public class Fluids {
|
|||||||
public static BasicTinkerFluid osramFluid = new BasicTinkerFluid("osram_fluid", 0xFFffbc90, 800, 10, 4000);
|
public static BasicTinkerFluid osramFluid = new BasicTinkerFluid("osram_fluid", 0xFFffbc90, 800, 10, 4000);
|
||||||
public static BasicTinkerFluid abyssumFluid = new BasicTinkerFluid("abyssum_fluid", 0xFF21bcc2, 700, 10, 10000);
|
public static BasicTinkerFluid abyssumFluid = new BasicTinkerFluid("abyssum_fluid", 0xFF21bcc2, 700, 10, 10000);
|
||||||
public static BasicTinkerFluid eezoFluid = new BasicTinkerFluid("eezo_fluid", 0xFF58798a, 450, 0, 1000);
|
public static BasicTinkerFluid eezoFluid = new BasicTinkerFluid("eezo_fluid", 0xFF58798a, 450, 0, 1000);
|
||||||
public static BasicTinkerFluid triberiumFluid = new BasicTinkerFluid("triberium_fluid", 0xFF66f136, 550, 10, 9000);
|
public static BasicTinkerFluid triberiumFluid = new BasicTinkerFluid("triberium_fluid", 0xFFe4ff00, 550, 10, 9000);
|
||||||
public static BasicTinkerFluid fractumFluid = new BasicTinkerFluid("fractum_fluid", 0xFFd2c583, 750, 10, 10000);
|
public static BasicTinkerFluid fractumFluid = new BasicTinkerFluid("fractum_fluid", 0xFFd2c583, 750, 10, 10000);
|
||||||
public static BasicTinkerFluid violiumFluid = new BasicTinkerFluid("violium_fluid", 0xFFbfb0e2, 850, 10, 10000);
|
public static BasicTinkerFluid violiumFluid = new BasicTinkerFluid("violium_fluid", 0xFFbfb0e2, 850, 10, 10000);
|
||||||
public static BasicTinkerFluid proxiiFluid = new BasicTinkerFluid("proxii_fluid", 0xFFcefde1, 750, 10, 10000);
|
public static BasicTinkerFluid proxiiFluid = new BasicTinkerFluid("proxii_fluid", 0xFFcefde1, 750, 10, 10000);
|
||||||
public static BasicTinkerFluid tritoniteFluid = new BasicTinkerFluid("tritonite_fluid", 0xFF8edeff, 550, 10, 10000);
|
public static BasicTinkerFluid tritoniteFluid = new BasicTinkerFluid("tritonite_fluid", 0xFF8edeff, 550, 10, 10000);
|
||||||
public static BasicTinkerFluid ignitzFluid = new BasicTinkerFluid("ignitz_fluid", 0xFFff284b, 950, 10, 6000);
|
public static BasicTinkerFluid ignitzFluid = new BasicTinkerFluid("ignitz_fluid", 0xFFff284b, 950, 10, 6000);
|
||||||
public static BasicTinkerFluid imperomiteFluid = new BasicTinkerFluid("imperomite_fluid", 0xFF7fefa0, 900, 10,
|
public static BasicTinkerFluid imperomiteFluid = new BasicTinkerFluid("imperomite_fluid", 0xFF7fefa0, 900, 10, 10000);
|
||||||
10000);
|
|
||||||
public static BasicTinkerFluid solariumFluid = new BasicTinkerFluid("solarium_fluid", 0xFFfef864, 1500, 10, 2000);
|
public static BasicTinkerFluid solariumFluid = new BasicTinkerFluid("solarium_fluid", 0xFFfef864, 1500, 10, 2000);
|
||||||
public static BasicTinkerFluid nihiliteFluid = new BasicTinkerFluid("nihilite_fluid", 0xFF6645ba, 580, 10, 10000);
|
public static BasicTinkerFluid nihiliteFluid = new BasicTinkerFluid("nihilite_fluid", 0xFF6645ba, 580, 10, 10000);
|
||||||
public static BasicTinkerFluid adamantFluid = new BasicTinkerFluid("adamant_fluid", 0xFFff8efe, 1650, 10, 10000);
|
public static BasicTinkerFluid adamantFluid = new BasicTinkerFluid("adamant_fluid", 0xFFff8efe, 1650, 10, 10000);
|
||||||
@@ -52,14 +48,10 @@ public class Fluids {
|
|||||||
public static BasicTinkerFluid yrdeenFluid = new BasicTinkerFluid("yrdeen_fluid", 0xFF8f385f, 710, 10, 10000);
|
public static BasicTinkerFluid yrdeenFluid = new BasicTinkerFluid("yrdeen_fluid", 0xFF8f385f, 710, 10, 10000);
|
||||||
public static BasicTinkerFluid ioxFluid = new BasicTinkerFluid("iox_fluid", 0xFF99323c, 900, 10, 10000);
|
public static BasicTinkerFluid ioxFluid = new BasicTinkerFluid("iox_fluid", 0xFF99323c, 900, 10, 10000);
|
||||||
public static BasicTinkerFluid meteoriteFluid = new BasicTinkerFluid("meteorite_fluid", 0xFF374f3d, 950, 10, 7000);
|
public static BasicTinkerFluid meteoriteFluid = new BasicTinkerFluid("meteorite_fluid", 0xFF374f3d, 950, 10, 7000);
|
||||||
public static BasicTinkerFluid obsidioriteFluid = new BasicTinkerFluid("obsidiorite_fluid", 0xFF224853, 1050, 10,
|
public static BasicTinkerFluid obsidioriteFluid = new BasicTinkerFluid("obsidiorite_fluid", 0xFF224853, 1050, 10, 7000);
|
||||||
7000);
|
|
||||||
public static BasicTinkerFluid magmaFluid = new BasicTinkerFluid("magma_fluid", 0xFFffc000, 2000, 10, 5000);
|
public static BasicTinkerFluid magmaFluid = new BasicTinkerFluid("magma_fluid", 0xFFffc000, 2000, 10, 5000);
|
||||||
public static BasicTinkerFluid nitroniteFluid = new BasicTinkerFluid("nitronite_fluid", 0xFFCCFF00, 3100, 10, 5000);
|
public static BasicTinkerFluid nitroniteFluid = new BasicTinkerFluid("nitronite_fluid", 0xFFCCFF00, 3100, 10, 5000);
|
||||||
|
|
||||||
// Community
|
|
||||||
public static BasicTinkerFluid dilithiumFluid = new BasicTinkerFluid("dilithium_fluid", 0xFF79aea6, 1500, 10, 5000);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers all materials' fluids <br>
|
* Registers all materials' fluids <br>
|
||||||
* Detailed summary: <br>
|
* Detailed summary: <br>
|
||||||
@@ -72,18 +64,16 @@ public class Fluids {
|
|||||||
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
|
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
|
||||||
Class<?> targetType = field.getType();
|
Class<?> targetType = field.getType();
|
||||||
try {
|
try {
|
||||||
BasicTinkerFluid fluid = (BasicTinkerFluid) field.get(targetType); // Gets the field as a
|
BasicTinkerFluid fluid = (BasicTinkerFluid) field.get(targetType); // Gets the field as a BasicTinkerFluid
|
||||||
// BasicTinkerFluid
|
|
||||||
registerFluid(fluid); // Registers the fluid into the game along wit its bucket
|
registerFluid(fluid); // Registers the fluid into the game along wit its bucket
|
||||||
|
|
||||||
BlockMolten block = new BlockMolten(fluid);
|
BlockMolten block = new BlockMolten(fluid);
|
||||||
// Sets names
|
// Sets names
|
||||||
block.setUnlocalizedName("molten_" + fluid.getName());
|
block.setUnlocalizedName("molten_" + fluid.getName());
|
||||||
block.setRegistryName(TAIGA.MODID, "molten_" + fluid.getName());
|
block.setRegistryName(TAIGA.MODID, "molten_" + fluid.getName());
|
||||||
// Registers the fluid in its block form and its corresponding item (block/fluid as item in
|
// Registers the fluid in its block form and its corresponding item (block/fluid as item in inventory)
|
||||||
// inventory)
|
Utils.registerBlockWithItem(block);
|
||||||
ForgeRegistries.BLOCKS.register(block);
|
// Registers the fluid's model but only on the client side
|
||||||
ForgeRegistries.ITEMS.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
|
|
||||||
TAIGA.proxy.registerFluidModels(fluid);
|
TAIGA.proxy.registerFluidModels(fluid);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -99,12 +89,9 @@ public class Fluids {
|
|||||||
TinkerRegistry.registerMelting(Blocks.blockMeteoriteCobble, meteoriteFluid, 288);
|
TinkerRegistry.registerMelting(Blocks.blockMeteoriteCobble, meteoriteFluid, 288);
|
||||||
TinkerRegistry.registerMelting(Blocks.blockObsidiorite, meteoriteFluid, 288);
|
TinkerRegistry.registerMelting(Blocks.blockObsidiorite, meteoriteFluid, 288);
|
||||||
TinkerRegistry.registerMelting(net.minecraft.init.Blocks.MAGMA, magmaFluid, 288);
|
TinkerRegistry.registerMelting(net.minecraft.init.Blocks.MAGMA, magmaFluid, 288);
|
||||||
TinkerRegistry.registerMelting(Items.dilithiumCrystal, dilithiumFluid, 72);
|
|
||||||
TinkerRegistry.registerMelting(Items.tiberiumCrystal, tiberiumFluid, 72);
|
|
||||||
|
|
||||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(magmaFluid, 50), 100);
|
TinkerRegistry.registerSmelteryFuel(new FluidStack(magmaFluid, 50), 100);
|
||||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(nitroniteFluid, 100), 500);
|
TinkerRegistry.registerSmelteryFuel(new FluidStack(nitroniteFluid, 100), 500);
|
||||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(dilithiumFluid, 50), 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -4,8 +4,7 @@ package com.sosnitzka.taiga;
|
|||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.sosnitzka.taiga.generic.BasicItem;
|
import com.sosnitzka.taiga.generic.BasicItem;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@@ -162,48 +161,38 @@ public class Items {
|
|||||||
public static Item obsidioriteDust = new BasicItem("obsidiorite_dust", PREFIX_DUST);
|
public static Item obsidioriteDust = new BasicItem("obsidiorite_dust", PREFIX_DUST);
|
||||||
public static Item obsidioriteNugget = new BasicItem("obsidiorite_nugget", PREFIX_NUGGET);
|
public static Item obsidioriteNugget = new BasicItem("obsidiorite_nugget", PREFIX_NUGGET);
|
||||||
|
|
||||||
public static Item dilithiumIngot = new BasicItem("dilithium_ingot", PREFIX_INGOT);
|
|
||||||
public static Item dilithiumDust = new BasicItem("dilithium_dust", PREFIX_DUST);
|
|
||||||
public static Item dilithiumCrystal = new BasicItem("dilithium_crystal", PREFIX_CRYSTAL);
|
|
||||||
public static Item tiberiumCrystal = new BasicItem("tiberium_crystal", PREFIX_CRYSTAL);
|
|
||||||
public static Item dilithiumNugget = new BasicItem("dilithium_nugget", PREFIX_NUGGET);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers all materials' ingots and nuggets <br>
|
* Registers all materials' ingots and nuggets <br>
|
||||||
* Detailed summary: <br>
|
* Detailed summary: <br>
|
||||||
* Gets the ingots declared in the class (fields and reflection) and iterates through them: <br>
|
* Gets the ingots declared in the class (fields and reflection) and iterates through them: <br>
|
||||||
* Checks that the field is static, registers the field (item), and adds an oreDict entry if needed
|
* Checks that the field is static, registers the field (item), and adds an oreDict entry if needed
|
||||||
*/
|
*/
|
||||||
@SubscribeEvent
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
Field[] declaredFields = Items.class.getDeclaredFields(); // Gets the fields (ingots) declared above
|
Field[] declaredFields = Items.class.getDeclaredFields(); // Gets the fields (ingots) declared above
|
||||||
for (Field field : declaredFields) { // Iterates through the fields declared above
|
for (Field field : declaredFields) { // Iterates through the fields declared above
|
||||||
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
|
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
|
||||||
Class<?> targetType = field.getType();
|
Class<?> targetType = field.getType();
|
||||||
try {
|
try {
|
||||||
Item item = (Item) field.get(targetType); // Gets the field as a BasicItem which is then casted
|
Item item = (Item) field.get(targetType); // Gets the field as a BasicItem which is then casted to an Item
|
||||||
// to an Item
|
|
||||||
if (item.equals(ironNugget) && OreDictionary.doesOreNameExist("nuggetIron")) {
|
if (item.equals(ironNugget) && OreDictionary.doesOreNameExist("nuggetIron")) {
|
||||||
System.out.println("TAIGA: Skipped registration of nuggetIron which already exists.");
|
System.out.println("TAIGA: Skipped registration of nuggetIron which already exists.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
item.setCreativeTab(CreativeTab.tabTaigaItem);
|
item.setCreativeTab(CreativeTab.tabTaigaItem);
|
||||||
ForgeRegistries.ITEMS.register(item); // Registers the item into the game
|
GameRegistry.register(item); // Registers the item into the game
|
||||||
if (item instanceof BasicItem) { // Checks that the item is a BasicItem
|
if (item instanceof BasicItem) { // Checks that the item is a BasicItem
|
||||||
if (((BasicItem) item).isOreDict()) { // Checks if this item should be registered into the
|
if (((BasicItem) item).isOreDict()) { // Checks if this item should be registered into the oreDict and registers it
|
||||||
// oreDict and registers it
|
|
||||||
String oreDictName;
|
String oreDictName;
|
||||||
String[] nameParts = item.getUnlocalizedName().replace("item.", "").split("_");
|
String[] nameParts = item.getUnlocalizedName().replace("item.", "").split("_");
|
||||||
|
|
||||||
if (nameParts.length > 2) {
|
if (nameParts.length > 2) {
|
||||||
oreDictName = Joiner.on("_").join(Arrays.copyOfRange(nameParts, 0, nameParts.length -
|
oreDictName = Joiner.on("_").join(Arrays.copyOfRange(nameParts, 0, nameParts.length - 1));
|
||||||
1));
|
|
||||||
} else {
|
} else {
|
||||||
oreDictName = nameParts[0];
|
oreDictName = nameParts[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
OreDictionary.registerOre(((BasicItem) item).getOreDictPrefix() + StringUtils.capitalize
|
OreDictionary.registerOre(((BasicItem) item).getOreDictPrefix() + StringUtils.capitalize(oreDictName), item); // Registers into oreDict
|
||||||
(oreDictName), item); // Registers into oreDict
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
|
@@ -1,8 +0,0 @@
|
|||||||
package com.sosnitzka.taiga;
|
|
||||||
|
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
|
||||||
import org.lwjgl.input.Keyboard;
|
|
||||||
|
|
||||||
public class Keybindings {
|
|
||||||
public static KeyBinding altKey = new KeyBinding("key.taiga.alt_action", Keyboard.KEY_LCONTROL, "TAIGA");
|
|
||||||
}
|
|
@@ -8,8 +8,7 @@ import slimeknights.tconstruct.library.materials.MaterialTypes;
|
|||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
import static com.sosnitzka.taiga.Fluids.obsidioriteFluid;
|
import static com.sosnitzka.taiga.Fluids.obsidioriteFluid;
|
||||||
import static slimeknights.tconstruct.tools.TinkerTraits.alien;
|
import static slimeknights.tconstruct.tools.TinkerTraits.*;
|
||||||
import static slimeknights.tconstruct.tools.TinkerTraits.crumbling;
|
|
||||||
|
|
||||||
public class MaterialTraits {
|
public class MaterialTraits {
|
||||||
|
|
||||||
@@ -19,8 +18,9 @@ public class MaterialTraits {
|
|||||||
public static final int VIBRANIUM = 7;
|
public static final int VIBRANIUM = 7;
|
||||||
|
|
||||||
// Init of new traits
|
// Init of new traits
|
||||||
public static final AbstractTrait instable = new TraitUnstable();
|
public static final AbstractTrait instable = new TraitInstable();
|
||||||
public static final AbstractTrait naturebound = new TraitNatureBound();
|
public static final AbstractTrait naturebound = new TraitNatureBound();
|
||||||
|
public static final AbstractTrait uncertain = new TraitUncertain();
|
||||||
public static final AbstractTrait softy = new TraitSofty();
|
public static final AbstractTrait softy = new TraitSofty();
|
||||||
public static final AbstractTrait curvature = new TraitCurvature();
|
public static final AbstractTrait curvature = new TraitCurvature();
|
||||||
public static final AbstractTrait resonance = new TraitResonance();
|
public static final AbstractTrait resonance = new TraitResonance();
|
||||||
@@ -42,6 +42,7 @@ public class MaterialTraits {
|
|||||||
public static final AbstractTrait diffuse = new TraitDiffuse();
|
public static final AbstractTrait diffuse = new TraitDiffuse();
|
||||||
public static final AbstractTrait reviving = new TraitReviving();
|
public static final AbstractTrait reviving = new TraitReviving();
|
||||||
public static final AbstractTrait melting = new TraitMelting();
|
public static final AbstractTrait melting = new TraitMelting();
|
||||||
|
public static final AbstractTrait traditional = new TraitTraditional();
|
||||||
public static final AbstractTrait tantrum = new TraitTantrum();
|
public static final AbstractTrait tantrum = new TraitTantrum();
|
||||||
public static final AbstractTrait catcher = new TraitCatcher();
|
public static final AbstractTrait catcher = new TraitCatcher();
|
||||||
public static final AbstractTrait congenial = new TraitCongenial();
|
public static final AbstractTrait congenial = new TraitCongenial();
|
||||||
@@ -51,12 +52,12 @@ public class MaterialTraits {
|
|||||||
public static final AbstractTrait decay = new TraitDecay();
|
public static final AbstractTrait decay = new TraitDecay();
|
||||||
public static final AbstractTrait whirl = new TraitWhirl();
|
public static final AbstractTrait whirl = new TraitWhirl();
|
||||||
public static final AbstractTrait superheavy = new TraitSuperHeavy();
|
public static final AbstractTrait superheavy = new TraitSuperHeavy();
|
||||||
public static final AbstractTrait berserk = new TraitBerserk();
|
public static final AbstractTrait dev = new TraitDevelopement();
|
||||||
public static final AbstractTrait crushing = new TraitCrushing();
|
public static final AbstractTrait carousel = new TraitCarousel();
|
||||||
public static final AbstractTrait mutate = new TraitMutate();
|
public static final AbstractTrait beserk = new TraitBeserk();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Assign traits to related materials. <br>
|
* Assign traits to related materials. <br>
|
||||||
* <p>
|
* <p>
|
||||||
* <p> Example:
|
* <p> Example:
|
||||||
@@ -82,24 +83,27 @@ public class MaterialTraits {
|
|||||||
public static Material tritonite = new Material("tritonite", TextFormatting.GOLD).addTrait(whirl);
|
public static Material tritonite = new Material("tritonite", TextFormatting.GOLD).addTrait(whirl);
|
||||||
public static Material ignitz = new Material("ignitz", TextFormatting.RED).addTrait(melting).addTrait(garishly, MaterialTypes.HANDLE);
|
public static Material ignitz = new Material("ignitz", TextFormatting.RED).addTrait(melting).addTrait(garishly, MaterialTypes.HANDLE);
|
||||||
public static Material imperomite = new Material("imperomite", TextFormatting.DARK_RED).addTrait(hollow);
|
public static Material imperomite = new Material("imperomite", TextFormatting.DARK_RED).addTrait(hollow);
|
||||||
public static Material solarium = new Material("solarium", TextFormatting.YELLOW).addTrait(superheavy).addTrait(crushing);
|
public static Material solarium = new Material("solarium", TextFormatting.YELLOW).addTrait(pulverizing).addTrait(superheavy);
|
||||||
public static Material nihilite = new Material("nihilite", TextFormatting.DARK_GRAY).addTrait(souleater);
|
public static Material nihilite = new Material("nihilite", TextFormatting.DARK_GRAY).addTrait(souleater);
|
||||||
public static Material adamant = new Material("adamant", TextFormatting.GOLD).addTrait(berserk);
|
/**
|
||||||
|
* With Dev
|
||||||
|
**/
|
||||||
|
public static Material adamant = new Material("adamant", TextFormatting.GOLD).addTrait(beserk); //.addTrait(dev);
|
||||||
public static Material dyonite = new Material("dyonite", TextFormatting.GREEN).addTrait(tantrum);
|
public static Material dyonite = new Material("dyonite", TextFormatting.GREEN).addTrait(tantrum);
|
||||||
public static Material nucleum = new Material("nucleum", TextFormatting.YELLOW).addTrait(decay).addTrait(mutate);
|
public static Material nucleum = new Material("nucleum", TextFormatting.YELLOW).addTrait(decay);
|
||||||
public static Material lumix = new Material("lumix", TextFormatting.YELLOW).addTrait(bright, MaterialTypes.HANDLE).addTrait(glimmer, MaterialTypes.HEAD);
|
public static Material lumix = new Material("lumix", TextFormatting.YELLOW).addTrait(bright, MaterialTypes.HANDLE).addTrait(glimmer, MaterialTypes.HEAD);
|
||||||
public static Material seismum = new Material("seismum", TextFormatting.GREEN).addTrait(cascade);
|
public static Material seismum = new Material("seismum", TextFormatting.GREEN).addTrait(cascade);
|
||||||
public static Material astrium = new Material("astrium", TextFormatting.DARK_PURPLE).addTrait(ported);
|
public static Material astrium = new Material("astrium", TextFormatting.DARK_PURPLE).addTrait(ported);
|
||||||
public static Material niob = new Material("niob", TextFormatting.RED).addTrait(reviving);
|
public static Material niob = new Material("niob", TextFormatting.RED).addTrait(reviving);
|
||||||
public static Material yrdeen = new Material("yrdeen", TextFormatting.RED).addTrait(naturebound);
|
public static Material yrdeen = new Material("yrdeen", TextFormatting.RED).addTrait(naturebound);
|
||||||
public static Material meteorite = new Material("meteorite", TextFormatting.DARK_GREEN).addTrait(crumbling, MaterialTypes.HEAD).addTrait(pulverizing);
|
public static Material meteorite = new Material("meteorite", TextFormatting.DARK_GREEN).addTrait(crumbling, MaterialTypes.HEAD).addTrait(cheap);
|
||||||
public static Material obsidiorite = new Material("obsidiorite", obsidioriteFluid.getColor()).addTrait(alien);
|
public static Material obsidiorite = new Material("obsidiorite", obsidioriteFluid.getColor()).addTrait(alien);
|
||||||
|
|
||||||
public static Material osram = new Material("osram", TextFormatting.GOLD);
|
public static Material osram = new Material("osram", TextFormatting.GOLD);
|
||||||
public static Material abyssum = new Material("abyssum", TextFormatting.GOLD);
|
public static Material abyssum = new Material("abyssum", TextFormatting.GOLD);
|
||||||
|
public static Material iox = new Material("iox", TextFormatting.RED);
|
||||||
public static Material ovium = new Material("ovium", TextFormatting.BLUE);
|
public static Material ovium = new Material("ovium", TextFormatting.BLUE);
|
||||||
public static Material jauxum = new Material("jauxum", TextFormatting.YELLOW);
|
public static Material jauxum = new Material("jauxum", TextFormatting.YELLOW);
|
||||||
public static Material karmesine = new Material("karmesine", TextFormatting.RED);
|
public static Material karmesine = new Material("karmesine", TextFormatting.RED);
|
||||||
public static Material dilithium = new Material("dilithium", TextFormatting.BLUE);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@ import com.sosnitzka.taiga.proxy.CommonProxy;
|
|||||||
import com.sosnitzka.taiga.recipes.CraftingRegistry;
|
import com.sosnitzka.taiga.recipes.CraftingRegistry;
|
||||||
import com.sosnitzka.taiga.recipes.SmeltingRegistry;
|
import com.sosnitzka.taiga.recipes.SmeltingRegistry;
|
||||||
import com.sosnitzka.taiga.world.WorldGen;
|
import com.sosnitzka.taiga.world.WorldGen;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||||
import net.minecraftforge.fml.common.SidedProxy;
|
import net.minecraftforge.fml.common.SidedProxy;
|
||||||
@@ -13,7 +14,6 @@ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
|||||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
import slimeknights.tconstruct.library.MaterialIntegration;
|
import slimeknights.tconstruct.library.MaterialIntegration;
|
||||||
import slimeknights.tconstruct.library.materials.BowMaterialStats;
|
import slimeknights.tconstruct.library.materials.BowMaterialStats;
|
||||||
|
|
||||||
@@ -25,63 +25,51 @@ import static com.sosnitzka.taiga.util.Utils.integrateMaterial;
|
|||||||
import static com.sosnitzka.taiga.util.Utils.integrateOre;
|
import static com.sosnitzka.taiga.util.Utils.integrateOre;
|
||||||
import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
|
import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
|
||||||
|
|
||||||
@Mod(modid = TAIGA.MODID, version = TAIGA.VERSION, guiFactory = TAIGA.GUIFACTORY, dependencies =
|
@Mod(modid = TAIGA.MODID, version = TAIGA.VERSION, guiFactory = TAIGA.GUIFACTORY, dependencies = "required-after:tconstruct@[1.10.2-2.5.0,);" + "required-after:mantle@[1.10.2-1.0.0,)")
|
||||||
"required-after:tconstruct@[1.10.2-2.5.0,);" + "required-after:mantle@[1.10.2-1.0.0,)")
|
|
||||||
public class TAIGA {
|
public class TAIGA {
|
||||||
|
|
||||||
public static final String MODID = "taiga";
|
public static final String MODID = "taiga";
|
||||||
public static final String VERSION = "1.12.2-1.3.3";
|
public static final String VERSION = "@VERSION@";
|
||||||
public static final String GUIFACTORY = "com.sosnitzka.taiga.TAIGAGuiFactory";
|
public static final String GUIFACTORY = "com.sosnitzka.taiga.TAIGAGuiFactory";
|
||||||
public static Logger logger;
|
|
||||||
|
|
||||||
@SidedProxy(clientSide = "com.sosnitzka.taiga.proxy.ClientProxy", serverSide = "com.sosnitzka.taiga.proxy" +
|
@SidedProxy(clientSide = "com.sosnitzka.taiga.proxy.ClientProxy", serverSide = "com.sosnitzka.taiga.proxy.CommonProxy")
|
||||||
".CommonProxy")
|
|
||||||
public static CommonProxy proxy;
|
public static CommonProxy proxy;
|
||||||
|
|
||||||
public static List<MaterialIntegration> integrateList = Lists.newArrayList(); // List of materials needed to be integrated
|
public static List<MaterialIntegration> integrateList = Lists.newArrayList(); // List of materials needed to be integrated
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent e) {
|
public void preInit(FMLPreInitializationEvent e) {
|
||||||
logger = e.getModLog();
|
|
||||||
|
|
||||||
Fluids.register();
|
|
||||||
Blocks.register(false);
|
|
||||||
Blocks.registerItems();
|
|
||||||
Items.register();
|
|
||||||
|
|
||||||
proxy.initConfig();
|
proxy.initConfig();
|
||||||
|
|
||||||
registerTinkerMaterials();
|
Items.register(); // Registers items and its oreDict
|
||||||
|
Blocks.register(); // Registers blocks and its items form a long with its oreDict
|
||||||
|
Fluids.register(); // Registers all fluids and its buckets
|
||||||
|
Fluids.registerfromItem(); // Registers some special smeltery recipes (not alloying)
|
||||||
|
Alloys.register(); // Registers alloying recipes
|
||||||
|
registerTinkerMaterials(); // Registers materials and associated fluids and stats into tconstruct
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void init(FMLInitializationEvent e) {
|
public void init(FMLInitializationEvent e) {
|
||||||
proxy.registerModels(); // Registers models on the client side
|
proxy.registerModels(); // Registers models on the client side
|
||||||
proxy.regsiterKeyBindings();
|
GameRegistry.registerWorldGenerator(new WorldGen(), 100); // Generates ores
|
||||||
|
|
||||||
Fluids.registerfromItem(); // Registers some special smeltery recipes (not alloying)
|
|
||||||
GameRegistry.registerWorldGenerator(WorldGen.getInstance(), 100); // Generates ores
|
|
||||||
// GameRegistry.registerFuelHandler(new FuelHandler()); Registeres fuels' burn times
|
// GameRegistry.registerFuelHandler(new FuelHandler()); Registeres fuels' burn times
|
||||||
|
|
||||||
// Adds new harvest levels' names
|
|
||||||
proxy.registerHarvestLevels();
|
|
||||||
|
|
||||||
Blocks.register(true);
|
|
||||||
|
|
||||||
Alloys.register(); // Registers alloying recipes
|
|
||||||
registerTinkerMaterials(); // Registers materials and associated fluids and stats into tconstruct
|
|
||||||
|
|
||||||
SmeltingRegistry.register(); // Registers smelting recipes
|
SmeltingRegistry.register(); // Registers smelting recipes
|
||||||
CraftingRegistry.register(); // Registers crafting recipes
|
CraftingRegistry.register(); // Registers crafting recipes
|
||||||
|
|
||||||
|
// Adds new harvest levels' names
|
||||||
|
harvestLevelNames.put(DURANITE, TextFormatting.DARK_GREEN + "Duranite");
|
||||||
|
harvestLevelNames.put(VALYRIUM, TextFormatting.GOLD + "Valyrium");
|
||||||
|
harvestLevelNames.put(VIBRANIUM, TextFormatting.DARK_PURPLE + "Vibranium");
|
||||||
|
|
||||||
|
|
||||||
for (MaterialIntegration m : integrateList) {
|
for (MaterialIntegration m : integrateList) {
|
||||||
m.integrate();
|
m.integrateRecipes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void postInit(FMLPostInitializationEvent e) {
|
public void postInit(FMLPostInitializationEvent e) {
|
||||||
proxy.registerBookPages();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -95,7 +83,7 @@ public class TAIGA {
|
|||||||
*/
|
*/
|
||||||
private void registerTinkerMaterials() {
|
private void registerTinkerMaterials() {
|
||||||
BowMaterialStats shitty = new BowMaterialStats(0.2f, 0.4f, -1f);
|
BowMaterialStats shitty = new BowMaterialStats(0.2f, 0.4f, -1f);
|
||||||
//
|
|
||||||
integrateMaterial("Tiberium", tiberium, tiberiumFluid, 80, 3.3f, 4f, 0.7f, -25, 50, DIAMOND, shitty, true, false);
|
integrateMaterial("Tiberium", tiberium, tiberiumFluid, 80, 3.3f, 4f, 0.7f, -25, 50, DIAMOND, shitty, true, false);
|
||||||
integrateMaterial("Aurorium", aurorium, auroriumFluid, 750, 3.6f, 3.78f, 0.77f, 25, 130, COBALT, 0.45f, 1f, 1);
|
integrateMaterial("Aurorium", aurorium, auroriumFluid, 750, 3.6f, 3.78f, 0.77f, 25, 130, COBALT, 0.45f, 1f, 1);
|
||||||
integrateMaterial("Prometheum", prometheum, prometheumFluid, 844, 4.75f, 6.6f, 1.2f, 25, 50, DURANITE, 0.2f, 0.6f, 3);
|
integrateMaterial("Prometheum", prometheum, prometheumFluid, 844, 4.75f, 6.6f, 1.2f, 25, 50, DURANITE, 0.2f, 0.6f, 3);
|
||||||
@@ -126,14 +114,17 @@ public class TAIGA {
|
|||||||
integrateMaterial("Yrdeen", yrdeen, yrdeenFluid, 999, 9.1f, 3f, 1.35f, 150, 250, COBALT, shitty);
|
integrateMaterial("Yrdeen", yrdeen, yrdeenFluid, 999, 9.1f, 3f, 1.35f, 150, 250, COBALT, shitty);
|
||||||
integrateMaterial("Meteorite", meteorite, meteoriteFluid, 1500, 1.5f, 1.5f, .5f, 0, 0, OBSIDIAN, shitty);
|
integrateMaterial("Meteorite", meteorite, meteoriteFluid, 1500, 1.5f, 1.5f, .5f, 0, 0, OBSIDIAN, shitty);
|
||||||
integrateMaterial("Obsidiorite", obsidiorite, obsidioriteFluid, 1500, .5f, .5f, 1, -100, 100, COBALT, shitty);
|
integrateMaterial("Obsidiorite", obsidiorite, obsidioriteFluid, 1500, .5f, .5f, 1, -100, 100, COBALT, shitty);
|
||||||
|
// when more traits / ideas are available
|
||||||
|
// integrateMaterial("Uru", uru, uruFluid, (552), 8.75f, 2.87f, 0.98f, -100, 200, DIAMOND);
|
||||||
|
// integrateMaterial("Osram", osram, osramFluid, 500, 5f, 3f, 0.8f, -50, 50, DIAMOND);
|
||||||
|
// integrateMaterial("Abyssum", abyssum, abyssumFluid, 100, 1f, 1f, 1f, 300, 300, DIAMOND);
|
||||||
integrateOre("Osram", osramFluid);
|
integrateOre("Osram", osramFluid);
|
||||||
integrateOre("Abyssum", abyssumFluid);
|
integrateOre("Abyssum", abyssumFluid);
|
||||||
integrateOre("Iox", ioxFluid);
|
integrateOre("Iox", ioxFluid);
|
||||||
integrateOre("Karmesine", karmesineFluid);
|
integrateOre("Karmesine", karmesineFluid);
|
||||||
integrateOre("Ovium", oviumFluid);
|
integrateOre("Ovium", oviumFluid);
|
||||||
integrateOre("Jauxum", jauxumFluid);
|
integrateOre("Jauxum", jauxumFluid);
|
||||||
// Community Wishlist
|
|
||||||
integrateOre("Dilithium", dilithiumFluid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -49,7 +49,6 @@ public class TAIGAConfiguration {
|
|||||||
public static int OVIUM_VAL;
|
public static int OVIUM_VAL;
|
||||||
public static int JAUXUM_VAL;
|
public static int JAUXUM_VAL;
|
||||||
public static int VIBRANIUM_VAL;
|
public static int VIBRANIUM_VAL;
|
||||||
public static int DILITHIUM_VAL;
|
|
||||||
public static int URU_VAL;
|
public static int URU_VAL;
|
||||||
public static int AURORIUM_VAL;
|
public static int AURORIUM_VAL;
|
||||||
public static int PALLADIUM_VAL;
|
public static int PALLADIUM_VAL;
|
||||||
@@ -80,6 +79,10 @@ public class TAIGAConfiguration {
|
|||||||
syncConfig(false, true);
|
syncConfig(false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void syncFromFields() {
|
||||||
|
syncConfig(false, false);
|
||||||
|
}
|
||||||
|
|
||||||
private static void syncConfig(boolean loadConfigFromFile, boolean readFieldsFromConfig) {
|
private static void syncConfig(boolean loadConfigFromFile, boolean readFieldsFromConfig) {
|
||||||
if (loadConfigFromFile) {
|
if (loadConfigFromFile) {
|
||||||
config.load();
|
config.load();
|
||||||
@@ -90,17 +93,16 @@ public class TAIGAConfiguration {
|
|||||||
|
|
||||||
final int IRON_DEFAULT = 20;
|
final int IRON_DEFAULT = 20;
|
||||||
final int TIBERIUM_DEFAULT = 15;
|
final int TIBERIUM_DEFAULT = 15;
|
||||||
final int PROMETHEUM_DEFAULT = 18;
|
final int PROMETHEUM_DEFAULT = 25;
|
||||||
final int VALYRIUM_DEFAULT = 10;
|
final int VALYRIUM_DEFAULT = 10;
|
||||||
final int DILITHIUM_DEFAULT = 12;
|
|
||||||
final int OSRAM_DEFAULT = 1;
|
final int OSRAM_DEFAULT = 1;
|
||||||
final int DURANITE_DEFAULT = 1;
|
final int DURANITE_DEFAULT = 1;
|
||||||
final int BASALT_DEFAULT = 12;
|
final int BASALT_DEFAULT = 10;
|
||||||
final int EEZO_DEFAULT = 3;
|
final int EEZO_DEFAULT = 3;
|
||||||
final int KARMESINE_DEFAULT = 8;
|
final int KARMESINE_DEFAULT = 8;
|
||||||
final int JAUXUM_DEFAULT = 8;
|
final int JAUXUM_DEFAULT = 8;
|
||||||
final int OVIUM_DEFAULT = 8;
|
final int OVIUM_DEFAULT = 8;
|
||||||
final int VIBRANIUM_DEFAULT = 8;
|
final int VIBRANIUM_DEFAULT = 10;
|
||||||
final int URU_DEFAULT = 1;
|
final int URU_DEFAULT = 1;
|
||||||
final int AURORIUM_DEFAULT = 10;
|
final int AURORIUM_DEFAULT = 10;
|
||||||
final int PALLADIUM_DEFAULT = 10;
|
final int PALLADIUM_DEFAULT = 10;
|
||||||
@@ -118,8 +120,7 @@ public class TAIGAConfiguration {
|
|||||||
/*
|
/*
|
||||||
Stuff which probably gonna come back
|
Stuff which probably gonna come back
|
||||||
|
|
||||||
Property durabilityFactorGeneralProp = config.get(CATEGORY_NAME_GENERAL, "Durability factor",
|
Property durabilityFactorGeneralProp = config.get(CATEGORY_NAME_GENERAL, "Durability factor", RESFAC_DEFAULT_VALUE,
|
||||||
RESFAC_DEFAULT_VALUE,
|
|
||||||
"General multiplier for all TAIGA materials", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
"General multiplier for all TAIGA materials", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
durabilityFactorGeneralProp.setLanguageKey("gui.taiga_configuration.durability_multiplier");
|
durabilityFactorGeneralProp.setLanguageKey("gui.taiga_configuration.durability_multiplier");
|
||||||
durabilityFactorGeneralProp.setRequiresMcRestart(true);
|
durabilityFactorGeneralProp.setRequiresMcRestart(true);
|
||||||
@@ -138,56 +139,37 @@ public class TAIGAConfiguration {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
Property ironValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Iron", IRON_DEFAULT, "generation count per " +
|
Property ironValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Iron", IRON_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
ironValueProp.setLanguageKey("gui.taiga_configuration.iron_multiplier");
|
ironValueProp.setLanguageKey("gui.taiga_configuration.iron_multiplier");
|
||||||
Property basaltValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Basalt", BASALT_DEFAULT, "generation count per " +
|
Property basaltValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Basalt", BASALT_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
basaltValueProp.setLanguageKey("gui.taiga_configuration.basalt_multiplier");
|
basaltValueProp.setLanguageKey("gui.taiga_configuration.basalt_multiplier");
|
||||||
Property tiberiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Tiberium", TIBERIUM_DEFAULT, "generation " +
|
Property tiberiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Tiberium", TIBERIUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
tiberiumValueProp.setLanguageKey("gui.taiga_configuration.tiberium_multiplier");
|
tiberiumValueProp.setLanguageKey("gui.taiga_configuration.tiberium_multiplier");
|
||||||
Property auroriumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Aurorium", AURORIUM_DEFAULT, "generation " +
|
Property auroriumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Aurorium", AURORIUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
auroriumValueProp.setLanguageKey("gui.taiga_configuration.aurorium_multiplier");
|
auroriumValueProp.setLanguageKey("gui.taiga_configuration.aurorium_multiplier");
|
||||||
Property prometheumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Prometheum", PROMETHEUM_DEFAULT,
|
Property prometheumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Prometheum", PROMETHEUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
prometheumValueProp.setLanguageKey("gui.taiga_configuration.prometheum_multiplier");
|
prometheumValueProp.setLanguageKey("gui.taiga_configuration.prometheum_multiplier");
|
||||||
Property duraniteValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Duranite", DURANITE_DEFAULT, "generation " +
|
Property duraniteValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Duranite", DURANITE_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
duraniteValueProp.setLanguageKey("gui.taiga_configuration.duranite_multiplier");
|
duraniteValueProp.setLanguageKey("gui.taiga_configuration.duranite_multiplier");
|
||||||
Property valyriumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Valyrium", VALYRIUM_DEFAULT, "generation " +
|
Property valyriumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Valyrium", VALYRIUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
valyriumValueProp.setLanguageKey("gui.taiga_configuration.valyrium_multiplier");
|
valyriumValueProp.setLanguageKey("gui.taiga_configuration.valyrium_multiplier");
|
||||||
Property vibraniumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Vibranium", VIBRANIUM_DEFAULT, "generation " +
|
Property vibraniumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Vibranium", VIBRANIUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
vibraniumValueProp.setLanguageKey("gui.taiga_configuration.vibranium_multiplier");
|
vibraniumValueProp.setLanguageKey("gui.taiga_configuration.vibranium_multiplier");
|
||||||
Property dilithiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Dilithium", DILITHIUM_DEFAULT, "generation " +
|
Property karmesineValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Karmesine", KARMESINE_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
dilithiumValueProp.setLanguageKey("gui.taiga_configuration.dilithium_multiplier");
|
|
||||||
Property karmesineValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Karmesine", KARMESINE_DEFAULT, "generation " +
|
|
||||||
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
karmesineValueProp.setLanguageKey("gui.taiga_configuration.karmesine_multiplier");
|
karmesineValueProp.setLanguageKey("gui.taiga_configuration.karmesine_multiplier");
|
||||||
Property oviumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Ovium", OVIUM_DEFAULT, "generation count per " +
|
Property oviumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Ovium", OVIUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
oviumValueProp.setLanguageKey("gui.taiga_configuration.ovium_multiplier");
|
oviumValueProp.setLanguageKey("gui.taiga_configuration.ovium_multiplier");
|
||||||
Property jauxumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Jauxum", JAUXUM_DEFAULT, "generation count per " +
|
Property jauxumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Jauxum", JAUXUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
jauxumValueProp.setLanguageKey("gui.taiga_configuration.jauxum_multiplier");
|
jauxumValueProp.setLanguageKey("gui.taiga_configuration.jauxum_multiplier");
|
||||||
Property palladiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Palladium", PALLADIUM_DEFAULT, "generation " +
|
Property palladiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Palladium", PALLADIUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
palladiumValueProp.setLanguageKey("gui.taiga_configuration.palladium_multiplier");
|
palladiumValueProp.setLanguageKey("gui.taiga_configuration.palladium_multiplier");
|
||||||
Property uruValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Uru", URU_DEFAULT, "generation count per chunk",
|
Property uruValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Uru", URU_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
uruValueProp.setLanguageKey("gui.taiga_configuration.uru_multiplier");
|
uruValueProp.setLanguageKey("gui.taiga_configuration.uru_multiplier");
|
||||||
Property osramValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Osram", OSRAM_DEFAULT, "generation count per " +
|
Property osramValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Osram", OSRAM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
osramValueProp.setLanguageKey("gui.taiga_configuration.osram_multiplier");
|
osramValueProp.setLanguageKey("gui.taiga_configuration.osram_multiplier");
|
||||||
Property abyssumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Abyssum", ABYSSUM_DEFAULT, "generation count " +
|
Property abyssumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Abyssum", ABYSSUM_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
abyssumValueProp.setLanguageKey("gui.taiga_configuration.abyssum_multiplier");
|
abyssumValueProp.setLanguageKey("gui.taiga_configuration.abyssum_multiplier");
|
||||||
Property eezoValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Eezo", EEZO_DEFAULT, "generation count per " +
|
Property eezoValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Eezo", EEZO_DEFAULT, "value for generation", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
||||||
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
|
|
||||||
eezoValueProp.setLanguageKey("gui.taiga_configuration.eezo_multiplier");
|
eezoValueProp.setLanguageKey("gui.taiga_configuration.eezo_multiplier");
|
||||||
|
|
||||||
|
|
||||||
@@ -200,7 +182,6 @@ public class TAIGAConfiguration {
|
|||||||
propOrderOreGen.add(duraniteValueProp.getName());
|
propOrderOreGen.add(duraniteValueProp.getName());
|
||||||
propOrderOreGen.add(valyriumValueProp.getName());
|
propOrderOreGen.add(valyriumValueProp.getName());
|
||||||
propOrderOreGen.add(vibraniumValueProp.getName());
|
propOrderOreGen.add(vibraniumValueProp.getName());
|
||||||
propOrderOreGen.add(dilithiumValueProp.getName());
|
|
||||||
propOrderOreGen.add(karmesineValueProp.getName());
|
propOrderOreGen.add(karmesineValueProp.getName());
|
||||||
propOrderOreGen.add(oviumValueProp.getName());
|
propOrderOreGen.add(oviumValueProp.getName());
|
||||||
propOrderOreGen.add(jauxumValueProp.getName());
|
propOrderOreGen.add(jauxumValueProp.getName());
|
||||||
@@ -263,10 +244,6 @@ public class TAIGAConfiguration {
|
|||||||
if (VIBRANIUM_VAL > RESFAC_MAX_VALUE || VIBRANIUM_VAL < RESFAC_MIN_VALUE) {
|
if (VIBRANIUM_VAL > RESFAC_MAX_VALUE || VIBRANIUM_VAL < RESFAC_MIN_VALUE) {
|
||||||
VIBRANIUM_VAL = VIBRANIUM_DEFAULT;
|
VIBRANIUM_VAL = VIBRANIUM_DEFAULT;
|
||||||
}
|
}
|
||||||
DILITHIUM_VAL = dilithiumValueProp.getInt(DILITHIUM_DEFAULT);
|
|
||||||
if (DILITHIUM_VAL > RESFAC_MAX_VALUE || DILITHIUM_VAL < RESFAC_MIN_VALUE) {
|
|
||||||
DILITHIUM_VAL = DILITHIUM_DEFAULT;
|
|
||||||
}
|
|
||||||
URU_VAL = uruValueProp.getInt(URU_DEFAULT);
|
URU_VAL = uruValueProp.getInt(URU_DEFAULT);
|
||||||
if (URU_VAL > RESFAC_MAX_VALUE || URU_VAL < RESFAC_MIN_VALUE) {
|
if (URU_VAL > RESFAC_MAX_VALUE || URU_VAL < RESFAC_MIN_VALUE) {
|
||||||
URU_VAL = URU_DEFAULT;
|
URU_VAL = URU_DEFAULT;
|
||||||
@@ -299,7 +276,6 @@ public class TAIGAConfiguration {
|
|||||||
oviumValueProp.set(OVIUM_VAL);
|
oviumValueProp.set(OVIUM_VAL);
|
||||||
jauxumValueProp.set(JAUXUM_VAL);
|
jauxumValueProp.set(JAUXUM_VAL);
|
||||||
vibraniumValueProp.set(VIBRANIUM_VAL);
|
vibraniumValueProp.set(VIBRANIUM_VAL);
|
||||||
dilithiumValueProp.set(DILITHIUM_VAL);
|
|
||||||
uruValueProp.set(URU_VAL);
|
uruValueProp.set(URU_VAL);
|
||||||
auroriumValueProp.set(AURORIUM_VAL);
|
auroriumValueProp.set(AURORIUM_VAL);
|
||||||
palladiumValueProp.set(PALLADIUM_VAL);
|
palladiumValueProp.set(PALLADIUM_VAL);
|
||||||
@@ -315,8 +291,7 @@ public class TAIGAConfiguration {
|
|||||||
@SubscribeEvent(priority = EventPriority.NORMAL)
|
@SubscribeEvent(priority = EventPriority.NORMAL)
|
||||||
public void onEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
|
public void onEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
|
||||||
if (TAIGA.MODID.equals(event.getModID()) && !event.isWorldRunning()) {
|
if (TAIGA.MODID.equals(event.getModID()) && !event.isWorldRunning()) {
|
||||||
if (event.getConfigID().equals(CATEGORY_NAME_GENERAL) || event.getConfigID().equals
|
if (event.getConfigID().equals(CATEGORY_NAME_GENERAL) || event.getConfigID().equals(CATEGORY_NAME_ORE_GEN)) {
|
||||||
(CATEGORY_NAME_ORE_GEN)) {
|
|
||||||
syncFromGUI();
|
syncFromGUI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,13 +21,8 @@ public class TAIGAGuiFactory implements IModGuiFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasConfigGui() {
|
public Class<? extends GuiScreen> mainConfigGuiClass() {
|
||||||
return true;
|
return TAIGAConfigGui.class;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GuiScreen createConfigGui(GuiScreen parentScreen) {
|
|
||||||
return new TAIGAConfigGui(parentScreen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -35,19 +30,21 @@ public class TAIGAGuiFactory implements IModGuiFactory {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static class TAIGAConfigGui extends GuiConfig {
|
public static class TAIGAConfigGui extends GuiConfig {
|
||||||
|
|
||||||
public TAIGAConfigGui(GuiScreen parentScreen) {
|
public TAIGAConfigGui(GuiScreen parentScreen) {
|
||||||
super(parentScreen, getConfigElements(), TAIGA.MODID, false, false, I18n.format("gui.taiga_configuration" +
|
super(parentScreen, getConfigElements(), TAIGA.MODID, false, false, I18n.format("gui.taiga_configuration.mainTitle"));
|
||||||
".mainTitle"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<IConfigElement> getConfigElements() {
|
private static List<IConfigElement> getConfigElements() {
|
||||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||||
list.add(new DummyConfigElement.DummyCategoryElement("Basic configuration", "gui.taiga_configuration.ctgy" +
|
list.add(new DummyConfigElement.DummyCategoryElement("Basic configuration", "gui.taiga_configuration.ctgy.general", CategoryEntryGeneral.class));
|
||||||
".general", CategoryEntryGeneral.class));
|
list.add(new DummyConfigElement.DummyCategoryElement("Ore specific settings", "gui.taiga_configuration.ctgy.oregen", CategoryEntryOreGen.class));
|
||||||
list.add(new DummyConfigElement.DummyCategoryElement("Ore specific settings", "gui.taiga_configuration" +
|
|
||||||
".ctgy.oregen", CategoryEntryOreGen.class));
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,15 +56,11 @@ public class TAIGAGuiFactory implements IModGuiFactory {
|
|||||||
@Override
|
@Override
|
||||||
protected GuiScreen buildChildScreen() {
|
protected GuiScreen buildChildScreen() {
|
||||||
Configuration configuration = TAIGAConfiguration.getConfig();
|
Configuration configuration = TAIGAConfiguration.getConfig();
|
||||||
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration
|
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration.CATEGORY_NAME_GENERAL));
|
||||||
.CATEGORY_NAME_GENERAL));
|
|
||||||
List<IConfigElement> propertiesOnThisScreen = cat_general.getChildElements();
|
List<IConfigElement> propertiesOnThisScreen = cat_general.getChildElements();
|
||||||
String windowTitle = configuration.toString();
|
String windowTitle = configuration.toString();
|
||||||
|
|
||||||
return new GuiConfig(this.owningScreen, propertiesOnThisScreen, this.owningScreen.modID,
|
return new GuiConfig(this.owningScreen, propertiesOnThisScreen, this.owningScreen.modID, TAIGAConfiguration.CATEGORY_NAME_GENERAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, windowTitle);
|
||||||
TAIGAConfiguration.CATEGORY_NAME_GENERAL, this.configElement.requiresWorldRestart() || this
|
|
||||||
.owningScreen.allRequireWorldRestart, this.configElement.requiresMcRestart() || this
|
|
||||||
.owningScreen.allRequireMcRestart, windowTitle);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,15 +72,11 @@ public class TAIGAGuiFactory implements IModGuiFactory {
|
|||||||
@Override
|
@Override
|
||||||
protected GuiScreen buildChildScreen() {
|
protected GuiScreen buildChildScreen() {
|
||||||
Configuration configuration = TAIGAConfiguration.getConfig();
|
Configuration configuration = TAIGAConfiguration.getConfig();
|
||||||
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration
|
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration.CATEGORY_NAME_ORE_GEN));
|
||||||
.CATEGORY_NAME_ORE_GEN));
|
|
||||||
List<IConfigElement> propertiesOnThisScreen = cat_general.getChildElements();
|
List<IConfigElement> propertiesOnThisScreen = cat_general.getChildElements();
|
||||||
String windowTitle = configuration.toString();
|
String windowTitle = configuration.toString();
|
||||||
|
|
||||||
return new GuiConfig(this.owningScreen, propertiesOnThisScreen, this.owningScreen.modID,
|
return new GuiConfig(this.owningScreen, propertiesOnThisScreen, this.owningScreen.modID, TAIGAConfiguration.CATEGORY_NAME_ORE_GEN, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, windowTitle);
|
||||||
TAIGAConfiguration.CATEGORY_NAME_ORE_GEN, this.configElement.requiresWorldRestart() || this
|
|
||||||
.owningScreen.allRequireWorldRestart, this.configElement.requiresMcRestart() || this
|
|
||||||
.owningScreen.allRequireMcRestart, windowTitle);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,8 +11,7 @@ import static slimeknights.tconstruct.TConstruct.random;
|
|||||||
|
|
||||||
public class BlockCobble extends BasicBlock {
|
public class BlockCobble extends BasicBlock {
|
||||||
|
|
||||||
public BlockCobble(String name, Material material, float hardness, float resistance, int harvestlevel, float
|
public BlockCobble(String name, Material material, float hardness, float resistance, int harvestlevel, float light, String oreDictPrefix) {
|
||||||
light, String oreDictPrefix) {
|
|
||||||
super(name, material, hardness, resistance, harvestlevel, light, oreDictPrefix);
|
super(name, material, hardness, resistance, harvestlevel, light, oreDictPrefix);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
@@ -25,8 +24,7 @@ public class BlockCobble extends BasicBlock {
|
|||||||
if (random.nextBoolean()) {
|
if (random.nextBoolean()) {
|
||||||
e.getWorld().setBlockState(e.getPos(), Blocks.LAVA.getDefaultState());
|
e.getWorld().setBlockState(e.getPos(), Blocks.LAVA.getDefaultState());
|
||||||
} else {
|
} else {
|
||||||
e.getWorld().newExplosion(null, e.getPos().getX(), e.getPos().getY() + 1 / 16f, e.getPos().getZ()
|
e.getWorld().newExplosion(null, e.getPos().getX(), e.getPos().getY() + 1 / 16f, e.getPos().getZ(), 0.5f + random.nextFloat() * 1.5f, false, true);
|
||||||
, 0.5f + random.nextFloat() * 1.5f, false, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
34
src/main/java/com/sosnitzka/taiga/blocks/BlockLignite.java
Normal file
34
src/main/java/com/sosnitzka/taiga/blocks/BlockLignite.java
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
package com.sosnitzka.taiga.blocks;
|
||||||
|
|
||||||
|
import com.sosnitzka.taiga.generic.BasicBlock;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BlockLignite extends BasicBlock {
|
||||||
|
|
||||||
|
public BlockLignite() {
|
||||||
|
super("lignite_ore", Material.ROCK, 4.0f, 5.0f, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) {
|
||||||
|
Random rand = world instanceof World ? ((World) world).rand : new Random();
|
||||||
|
int r = RANDOM.nextInt(11);
|
||||||
|
if (r > 7) {
|
||||||
|
return MathHelper.getRandomIntegerInRange(rand, 0, 10) + fortune;
|
||||||
|
} else return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@ParametersAreNonnullByDefault
|
||||||
|
public int quantityDropped(IBlockState state, int fortune, Random random) {
|
||||||
|
return random.nextInt(3) + 1 + fortune;
|
||||||
|
}
|
||||||
|
}
|
70
src/main/java/com/sosnitzka/taiga/blocks/BlockMetal.java
Normal file
70
src/main/java/com/sosnitzka/taiga/blocks/BlockMetal.java
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
package com.sosnitzka.taiga.blocks;
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
import slimeknights.mantle.block.EnumBlock;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class BlockMetal extends EnumBlock<BlockMetal.MetalTypes> {
|
||||||
|
|
||||||
|
public static final PropertyEnum<MetalTypes> TYPE = PropertyEnum.create("type", MetalTypes.class);
|
||||||
|
|
||||||
|
public BlockMetal() {
|
||||||
|
super(Material.IRON, TYPE, MetalTypes.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(@Nonnull Item itemIn, CreativeTabs tab, List<ItemStack> list) {
|
||||||
|
for (MetalTypes type : MetalTypes.values()) {
|
||||||
|
list.add(new ItemStack(this, 1, type.getMeta()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum MetalTypes implements IStringSerializable, EnumBlock.IEnumMeta {
|
||||||
|
TIBERIUM,
|
||||||
|
AURODIUM,
|
||||||
|
PROMETHEUM,
|
||||||
|
ARCANITE,
|
||||||
|
TITANITE,
|
||||||
|
MYTHRIL,
|
||||||
|
URU,
|
||||||
|
VIBRANIUM,
|
||||||
|
ETERNITE,
|
||||||
|
FRACTORYTE,
|
||||||
|
PALLADIUM,
|
||||||
|
IGNITITE,
|
||||||
|
BISMUTH,
|
||||||
|
JAUXITE,
|
||||||
|
VIOLIUM,
|
||||||
|
KARMESINE;
|
||||||
|
|
||||||
|
public final int meta;
|
||||||
|
|
||||||
|
MetalTypes() {
|
||||||
|
meta = ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.toString().toLowerCase(Locale.US);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMeta() {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -13,8 +13,7 @@ public class BlockMeteoriteRock extends BasicBlock {
|
|||||||
|
|
||||||
private IBlockState cobbblestate;
|
private IBlockState cobbblestate;
|
||||||
|
|
||||||
public BlockMeteoriteRock(String name, Material material, float hardness, float resistance, int harvestlevel,
|
public BlockMeteoriteRock(String name, Material material, float hardness, float resistance, int harvestlevel, float light, String oreDictPrefix, IBlockState cobble) {
|
||||||
float light, String oreDictPrefix, IBlockState cobble) {
|
|
||||||
super(name, material, hardness, resistance, harvestlevel, light, oreDictPrefix);
|
super(name, material, hardness, resistance, harvestlevel, light, oreDictPrefix);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
this.cobbblestate = cobble;
|
this.cobbblestate = cobble;
|
||||||
|
68
src/main/java/com/sosnitzka/taiga/blocks/BlockOre.java
Normal file
68
src/main/java/com/sosnitzka/taiga/blocks/BlockOre.java
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
package com.sosnitzka.taiga.blocks;
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
import slimeknights.mantle.block.EnumBlock;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class BlockOre extends EnumBlock<BlockOre.OreTypes> {
|
||||||
|
|
||||||
|
public static final PropertyEnum<OreTypes> TYPE = PropertyEnum.create("type", OreTypes.class);
|
||||||
|
|
||||||
|
public BlockOre() {
|
||||||
|
this(Material.ROCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockOre(Material material) {
|
||||||
|
super(material, TYPE, OreTypes.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public BlockRenderLayer getBlockLayer() {
|
||||||
|
return BlockRenderLayer.CUTOUT_MIPPED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum OreTypes implements IStringSerializable, EnumBlock.IEnumMeta {
|
||||||
|
TIBERIUM,
|
||||||
|
AURODIUM,
|
||||||
|
PROMETHEUM,
|
||||||
|
ARCANITE,
|
||||||
|
TITANITE,
|
||||||
|
MYTHRIL,
|
||||||
|
URU,
|
||||||
|
VIBRANIUM,
|
||||||
|
ETERNITE,
|
||||||
|
FRACTORYTE,
|
||||||
|
PALLADIUM,
|
||||||
|
IGNITITE,
|
||||||
|
BISMUTH,
|
||||||
|
JAUXITE,
|
||||||
|
VIOLIUM,
|
||||||
|
KARMESINE;
|
||||||
|
|
||||||
|
public final int meta;
|
||||||
|
|
||||||
|
OreTypes() {
|
||||||
|
meta = ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.toString().toLowerCase(Locale.US);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMeta() {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -39,15 +39,14 @@ public class BlockTiberium extends BasicBlock {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||||
return Items.tiberiumCrystal;
|
return Items.tiberiumDust;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
|
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
|
||||||
if (!worldIn.isRemote) {
|
if (!worldIn.isRemote) {
|
||||||
if (random.nextFloat() < 0.5) {
|
if (random.nextFloat() < 0.5) {
|
||||||
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), random.nextFloat() * 2f + 1.5f, true,
|
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), random.nextFloat() * 2f + 1.5f, true, true);
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,63 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.book;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import slimeknights.mantle.client.book.data.BookData;
|
|
||||||
import slimeknights.mantle.client.book.data.element.ItemStackData;
|
|
||||||
import slimeknights.mantle.client.book.data.element.TextData;
|
|
||||||
import slimeknights.mantle.client.gui.book.GuiBook;
|
|
||||||
import slimeknights.mantle.client.gui.book.element.BookElement;
|
|
||||||
import slimeknights.mantle.client.gui.book.element.ElementItem;
|
|
||||||
import slimeknights.mantle.client.gui.book.element.ElementText;
|
|
||||||
import slimeknights.tconstruct.library.book.TinkerPage;
|
|
||||||
import slimeknights.tconstruct.library.client.CustomFontColor;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public class ContentOre extends TinkerPage {
|
|
||||||
|
|
||||||
public static final transient int INPUT_X = 110;
|
|
||||||
public static final transient int INPUT_Y = 80;
|
|
||||||
|
|
||||||
public static final transient float ITEM_SCALE = 1.5F;
|
|
||||||
|
|
||||||
public String title;
|
|
||||||
public int r, g, b;
|
|
||||||
|
|
||||||
public ItemStackData input;
|
|
||||||
public TextData[] description;
|
|
||||||
public String[] informations;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void build(BookData book, ArrayList<BookElement> list, boolean rightSide) {
|
|
||||||
TextData tdTitle = new TextData(title);
|
|
||||||
tdTitle.underlined = true;
|
|
||||||
|
|
||||||
addTitle(list, CustomFontColor.encodeColor(r, g, b) + title, true);
|
|
||||||
|
|
||||||
if (input != null && !input.id.equals("")) {
|
|
||||||
list.add(new ElementItem(INPUT_X, INPUT_Y, ITEM_SCALE * 2.5f, input.getItems(), input.action));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (description != null && description.length > 0) {
|
|
||||||
list.add(new ElementText(0, 15, GuiBook.PAGE_WIDTH, GuiBook.PAGE_HEIGHT - 15, description));
|
|
||||||
}
|
|
||||||
|
|
||||||
int h = GuiBook.PAGE_WIDTH / 3 - 10;
|
|
||||||
if (informations != null && informations.length > 0) {
|
|
||||||
TextData head = new TextData(parent.translate("modifier.informations"));
|
|
||||||
head.underlined = true;
|
|
||||||
list.add(new ElementText(10, 20 + h, GuiBook.PAGE_WIDTH / 2 - 5, GuiBook.PAGE_HEIGHT - h - 20, head));
|
|
||||||
|
|
||||||
List<TextData> effectData = Lists.newArrayList();
|
|
||||||
for (String e : informations) {
|
|
||||||
effectData.add(new TextData("\u25CF "));
|
|
||||||
effectData.add(new TextData(e));
|
|
||||||
effectData.add(new TextData("\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
list.add(new ElementText(10, 30 + h, GuiBook.PAGE_WIDTH / 2 + 5, GuiBook.PAGE_HEIGHT - h - 20, effectData));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -6,8 +6,7 @@ import net.minecraft.block.material.Material;
|
|||||||
public class BasicBlock extends Block {
|
public class BasicBlock extends Block {
|
||||||
private String oreDictPrefix;
|
private String oreDictPrefix;
|
||||||
|
|
||||||
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, float
|
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, float lightLevel, String oreDictPrefix) {
|
||||||
lightLevel, String oreDictPrefix) {
|
|
||||||
super(material);
|
super(material);
|
||||||
setUnlocalizedName(name);
|
setUnlocalizedName(name);
|
||||||
setRegistryName(name);
|
setRegistryName(name);
|
||||||
@@ -26,8 +25,7 @@ public class BasicBlock extends Block {
|
|||||||
this(name, material, hardness, resistance, harvest, lightLevel, null);
|
this(name, material, hardness, resistance, harvest, lightLevel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, String
|
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, String oreDictPrefix) {
|
||||||
oreDictPrefix) {
|
|
||||||
this(name, material, hardness, resistance, harvest, 0.0F, oreDictPrefix);
|
this(name, material, hardness, resistance, harvest, 0.0F, oreDictPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,18 @@
|
|||||||
|
package com.sosnitzka.taiga.generic;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.SoundType;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
|
public class BasicBlockGround extends Block {
|
||||||
|
|
||||||
|
public BasicBlockGround(String name, Material material, float hardness, float resistance, int harvest) {
|
||||||
|
super(material);
|
||||||
|
setUnlocalizedName(name);
|
||||||
|
setRegistryName(name);
|
||||||
|
setHardness(hardness);
|
||||||
|
setResistance(resistance);
|
||||||
|
setHarvestLevel("shovel", harvest);
|
||||||
|
setSoundType(SoundType.GROUND);
|
||||||
|
}
|
||||||
|
}
|
@@ -14,6 +14,16 @@ public class BasicItem extends Item {
|
|||||||
this.oreDictPrefix = oreDictPrefix;
|
this.oreDictPrefix = oreDictPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BasicItem(String name, String oreDictPrefix, String registryname) {
|
||||||
|
setUnlocalizedName(name);
|
||||||
|
setRegistryName(registryname);
|
||||||
|
this.oreDictPrefix = oreDictPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasicItem(String name) {
|
||||||
|
this(name, null);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isOreDict() {
|
public boolean isOreDict() {
|
||||||
return this.oreDictPrefix != null;
|
return this.oreDictPrefix != null;
|
||||||
}
|
}
|
||||||
|
@@ -8,15 +8,23 @@ import slimeknights.tconstruct.library.fluid.FluidMolten;
|
|||||||
* A "wrapper" for FluidMolten that makes construction and manipulation easier
|
* A "wrapper" for FluidMolten that makes construction and manipulation easier
|
||||||
*/
|
*/
|
||||||
public class BasicTinkerFluid extends FluidMolten {
|
public class BasicTinkerFluid extends FluidMolten {
|
||||||
|
|
||||||
|
private boolean toolForge;
|
||||||
|
|
||||||
public BasicTinkerFluid(String fluidName, int color, int temp, int lumen, int visk) {
|
public BasicTinkerFluid(String fluidName, int color, int temp, int lumen, int visk) {
|
||||||
// Constructs the FluidMolten with textures and color
|
// Constructs the FluidMolten with textures and color
|
||||||
super(fluidName, color, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation
|
super(fluidName, color, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation("tconstruct:blocks/fluids/molten_metal_flow"));
|
||||||
("tconstruct:blocks/fluids/molten_metal_flow"));
|
|
||||||
//Settings
|
//Settings
|
||||||
this.setUnlocalizedName(Util.prefix(fluidName));
|
this.setUnlocalizedName(Util.prefix(fluidName));
|
||||||
this.setTemperature(temp);
|
this.setTemperature(temp);
|
||||||
this.setLuminosity(lumen);
|
this.setLuminosity(lumen);
|
||||||
this.setViscosity(visk);
|
this.setViscosity(visk);
|
||||||
this.setDensity(2000);
|
this.setDensity(2000);
|
||||||
|
this.toolForge = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isToolForge() {
|
||||||
|
return toolForge;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,64 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.generic;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.Explosion;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import static slimeknights.tconstruct.TConstruct.random;
|
|
||||||
|
|
||||||
public class BlockOre extends Block {
|
|
||||||
|
|
||||||
private Item dropItem;
|
|
||||||
private int itemAmount;
|
|
||||||
private int xpAmount;
|
|
||||||
|
|
||||||
public BlockOre(String name, Material material, float hardness, float resistance, int harvest, float lightLevel,
|
|
||||||
Item item, int amount, int xp) {
|
|
||||||
super(material);
|
|
||||||
setUnlocalizedName(name);
|
|
||||||
setRegistryName(name);
|
|
||||||
setHardness(hardness);
|
|
||||||
setResistance(resistance);
|
|
||||||
setHarvestLevel("pickaxe", harvest);
|
|
||||||
setLightLevel(lightLevel);
|
|
||||||
this.dropItem = item;
|
|
||||||
this.itemAmount = amount;
|
|
||||||
this.xpAmount = xp;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) {
|
|
||||||
return random.nextInt(xpAmount) + fortune;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@ParametersAreNonnullByDefault
|
|
||||||
public int quantityDropped(IBlockState state, int fortune, Random random) {
|
|
||||||
return (random.nextInt(itemAmount + fortune) + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
|
||||||
return dropItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
|
|
||||||
if (!worldIn.isRemote) {
|
|
||||||
if (random.nextFloat() < 0.5) {
|
|
||||||
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), random.nextFloat() * 4f + 1.5f, true,
|
|
||||||
true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -4,7 +4,6 @@ import com.sosnitzka.taiga.Blocks;
|
|||||||
import com.sosnitzka.taiga.Items;
|
import com.sosnitzka.taiga.Items;
|
||||||
import com.sosnitzka.taiga.TAIGA;
|
import com.sosnitzka.taiga.TAIGA;
|
||||||
import com.sosnitzka.taiga.TAIGAConfiguration;
|
import com.sosnitzka.taiga.TAIGAConfiguration;
|
||||||
import com.sosnitzka.taiga.book.ContentOre;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
@@ -12,16 +11,11 @@ import net.minecraft.client.renderer.ItemMeshDefinition;
|
|||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.resources.I18n;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
|
||||||
import slimeknights.mantle.client.book.repository.FileRepository;
|
|
||||||
import slimeknights.tconstruct.library.book.TinkerBook;
|
|
||||||
import slimeknights.tconstruct.library.client.MaterialRenderInfo;
|
import slimeknights.tconstruct.library.client.MaterialRenderInfo;
|
||||||
import slimeknights.tconstruct.library.client.texture.MetalTextureTexture;
|
import slimeknights.tconstruct.library.client.texture.MetalTextureTexture;
|
||||||
import slimeknights.tconstruct.library.materials.Material;
|
import slimeknights.tconstruct.library.materials.Material;
|
||||||
@@ -30,10 +24,7 @@ import javax.annotation.Nonnull;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
import static com.sosnitzka.taiga.Fluids.*;
|
import static com.sosnitzka.taiga.Fluids.*;
|
||||||
import static com.sosnitzka.taiga.Keybindings.altKey;
|
|
||||||
import static com.sosnitzka.taiga.MaterialTraits.*;
|
import static com.sosnitzka.taiga.MaterialTraits.*;
|
||||||
import static slimeknights.mantle.client.book.BookLoader.registerPageType;
|
|
||||||
import static slimeknights.tconstruct.library.utils.HarvestLevels.harvestLevelNames;
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class ClientProxy extends CommonProxy {
|
public class ClientProxy extends CommonProxy {
|
||||||
@@ -46,11 +37,6 @@ public class ClientProxy extends CommonProxy {
|
|||||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void regsiterKeyBindings() {
|
|
||||||
ClientRegistry.registerKeyBinding(altKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerModels() {
|
public void registerModels() {
|
||||||
Field[] itemFields = Items.class.getDeclaredFields();
|
Field[] itemFields = Items.class.getDeclaredFields();
|
||||||
@@ -95,18 +81,15 @@ public class ClientProxy extends CommonProxy {
|
|||||||
else if (material.equals(vibranium)) metalRender(material, vibraniumFluid.getColor(), 0.6f, .8f, 1f);
|
else if (material.equals(vibranium)) metalRender(material, vibraniumFluid.getColor(), 0.6f, .8f, 1f);
|
||||||
else if (material.equals(valyrium)) metalRender(material, valyriumFluid.getColor(), .8f, 1.5f, -0.1f);
|
else if (material.equals(valyrium)) metalRender(material, valyriumFluid.getColor(), .8f, 1.5f, -0.1f);
|
||||||
else {
|
else {
|
||||||
material.setRenderInfo(new MaterialRenderInfo.BlockTexture(new ResourceLocation("taiga:blocks/block/" +
|
material.setRenderInfo(new MaterialRenderInfo.BlockTexture("taiga:blocks/block/" + material.getIdentifier()));
|
||||||
material.getIdentifier())));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void metalRender(final Material material, final int f, final float shine, final float brightness, final
|
private void metalRender(final Material material, final int f, final float shine, final float brightness, final float hueshift) {
|
||||||
float hueshift) {
|
|
||||||
material.setRenderInfo(new MaterialRenderInfo.AbstractMaterialRenderInfo() {
|
material.setRenderInfo(new MaterialRenderInfo.AbstractMaterialRenderInfo() {
|
||||||
@Override
|
@Override
|
||||||
public TextureAtlasSprite getTexture(ResourceLocation baseTexture, String location) {
|
public TextureAtlasSprite getTexture(TextureAtlasSprite baseTexture, String location) {
|
||||||
return new MetalTextureTexture(new ResourceLocation("taiga:materials/" + material.getIdentifier()),
|
return new MetalTextureTexture("taiga:materials/" + material.getIdentifier(), baseTexture, location, f, shine, brightness, hueshift);
|
||||||
baseTexture, location, f, shine, brightness, hueshift);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -124,8 +107,10 @@ public class ClientProxy extends CommonProxy {
|
|||||||
FluidStateMapper mapper = new FluidStateMapper(fluid);
|
FluidStateMapper mapper = new FluidStateMapper(fluid);
|
||||||
|
|
||||||
// item-model
|
// item-model
|
||||||
ModelLoader.registerItemVariants(item);
|
if (item != null) {
|
||||||
ModelLoader.setCustomMeshDefinition(item, mapper);
|
ModelLoader.registerItemVariants(item);
|
||||||
|
ModelLoader.setCustomMeshDefinition(item, mapper);
|
||||||
|
}
|
||||||
// block-model
|
// block-model
|
||||||
ModelLoader.setCustomStateMapper(block, mapper);
|
ModelLoader.setCustomStateMapper(block, mapper);
|
||||||
}
|
}
|
||||||
@@ -137,13 +122,8 @@ public class ClientProxy extends CommonProxy {
|
|||||||
TAIGAConfiguration.clientPreInit();
|
TAIGAConfiguration.clientPreInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void registerBookPages() {
|
|
||||||
TinkerBook.INSTANCE.addRepository(new FileRepository("taiga:book"));
|
|
||||||
registerPageType("taigaore", ContentOre.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class FluidStateMapper extends StateMapperBase implements ItemMeshDefinition {
|
public static class FluidStateMapper extends StateMapperBase implements ItemMeshDefinition {
|
||||||
|
|
||||||
public final Fluid fluid;
|
public final Fluid fluid;
|
||||||
public final ModelResourceLocation location;
|
public final ModelResourceLocation location;
|
||||||
|
|
||||||
@@ -151,8 +131,7 @@ public class ClientProxy extends CommonProxy {
|
|||||||
this.fluid = fluid;
|
this.fluid = fluid;
|
||||||
|
|
||||||
// have each block hold its fluid per nbt? hm
|
// have each block hold its fluid per nbt? hm
|
||||||
this.location = new ModelResourceLocation(new ResourceLocation(TAIGA.MODID, "fluid_block"), fluid.getName
|
this.location = new ModelResourceLocation(new ResourceLocation(TAIGA.MODID, "fluid_block"), fluid.getName());
|
||||||
());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@@ -167,11 +146,4 @@ public class ClientProxy extends CommonProxy {
|
|||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void registerHarvestLevels() {
|
|
||||||
harvestLevelNames.put(DURANITE, I18n.format("harvestlevel.duranite", TextFormatting.GREEN, TextFormatting.RESET));
|
|
||||||
harvestLevelNames.put(VALYRIUM, I18n.format("harvestlevel.valyrium", TextFormatting.GOLD, TextFormatting.RESET));
|
|
||||||
harvestLevelNames.put(VIBRANIUM, I18n.format("harvestlevel.vibranium", TextFormatting.DARK_PURPLE, TextFormatting.RESET));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -5,9 +5,6 @@ import net.minecraftforge.fluids.Fluid;
|
|||||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||||
import slimeknights.tconstruct.library.materials.Material;
|
import slimeknights.tconstruct.library.materials.Material;
|
||||||
|
|
||||||
import static com.sosnitzka.taiga.MaterialTraits.*;
|
|
||||||
import static slimeknights.tconstruct.library.utils.HarvestLevels.harvestLevelNames;
|
|
||||||
|
|
||||||
public class CommonProxy {
|
public class CommonProxy {
|
||||||
|
|
||||||
public void registerModels() {
|
public void registerModels() {
|
||||||
@@ -27,17 +24,4 @@ public class CommonProxy {
|
|||||||
|
|
||||||
public void registerServerCommands(FMLServerStartingEvent e) {
|
public void registerServerCommands(FMLServerStartingEvent e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerBookPages() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void regsiterKeyBindings() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void registerHarvestLevels() {
|
|
||||||
harvestLevelNames.put(DURANITE, "harvestlevel.duranite");
|
|
||||||
harvestLevelNames.put(VALYRIUM, "harvestlevel.valyrium");
|
|
||||||
harvestLevelNames.put(VIBRANIUM, "harvestlevel.vibranium");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,61 +1,7 @@
|
|||||||
package com.sosnitzka.taiga.recipes;
|
package com.sosnitzka.taiga.recipes;
|
||||||
|
|
||||||
import com.sosnitzka.taiga.Blocks;
|
|
||||||
import com.sosnitzka.taiga.Items;
|
|
||||||
import com.sosnitzka.taiga.TAIGA;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.crafting.Ingredient;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
|
||||||
|
|
||||||
public class CraftingRegistry {
|
public class CraftingRegistry {
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
convertion(Item.getItemFromBlock(Blocks.tiberiumBlock), Items.tiberiumIngot, Items.tiberiumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.auroriumBlock), Items.auroriumIngot, Items.auroriumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.prometheumBlock), Items.prometheumIngot, Items.prometheumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.duraniteBlock), Items.duraniteIngot, Items.duraniteNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.valyriumBlock), Items.valyriumIngot, Items.valyriumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.vibraniumBlock), Items.vibraniumIngot, Items.vibraniumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.karmesineBlock), Items.karmesineIngot, Items.karmesineNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.oviumBlock), Items.oviumIngot, Items.oviumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.jauxumBlock), Items.jauxumIngot, Items.jauxumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.palladiumBlock), Items.palladiumIngot, Items.palladiumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.uruBlock), Items.uruIngot, Items.uruNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.osramBlock), Items.osramIngot, Items.osramNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.eezoBlock), Items.eezoIngot, Items.eezoNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.abyssumBlock), Items.abyssumIngot, Items.abyssumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.terraxBlock), Items.terraxIngot, Items.terraxNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.triberiumBlock), Items.triberiumIngot, Items.triberiumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.fractumBlock), Items.fractumIngot, Items.fractumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.violiumBlock), Items.violiumIngot, Items.violiumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.proxiiBlock), Items.proxiiIngot, Items.proxiiNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.tritoniteBlock), Items.tritoniteIngot, Items.tritoniteNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.ignitzBlock), Items.ignitzIngot, Items.ignitzNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.imperomiteBlock), Items.imperomiteIngot, Items.imperomiteNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.solariumBlock), Items.solariumIngot, Items.solariumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.nihiliteBlock), Items.nihiliteIngot, Items.nihiliteNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.adamantBlock), Items.adamantIngot, Items.adamantNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.dyoniteBlock), Items.dyoniteIngot, Items.dyoniteNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.nucleumBlock), Items.nucleumIngot, Items.nucleumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.lumixBlock), Items.lumixIngot, Items.lumixNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.seismumBlock), Items.seismumIngot, Items.seismumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.astriumBlock), Items.astriumIngot, Items.astriumNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.niobBlock), Items.niobIngot, Items.niobNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.yrdeenBlock), Items.yrdeenIngot, Items.yrdeenNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.ioxBlock), Items.ioxIngot, Items.ioxNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.blockMeteorite), Items.meteoriteIngot, Items.meteoriteNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.blockObsidiorite), Items.obsidioriteIngot, Items.obsidioriteNugget);
|
|
||||||
convertion(Item.getItemFromBlock(Blocks.dilithiumBlock), Items.dilithiumIngot, Items.dilithiumNugget);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void convertion(Item block, Item ingot, Item nugget) {
|
|
||||||
GameRegistry.addShapelessRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_block_" + block
|
|
||||||
.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(ingot, 9), Ingredient.fromStacks(new
|
|
||||||
ItemStack(block)));
|
|
||||||
GameRegistry.addShapelessRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_nugget_" + block
|
|
||||||
.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(nugget, 9), Ingredient.fromStacks(new
|
|
||||||
ItemStack(ingot)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,13 @@
|
|||||||
package com.sosnitzka.taiga.recipes;
|
package com.sosnitzka.taiga.recipes;
|
||||||
|
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
public class SmeltingRegistry {
|
public class SmeltingRegistry {
|
||||||
public static void register() {
|
public static void register() {
|
||||||
|
ItemStack nugget_iron = OreDictionary.getOres("nuggetIron").get(OreDictionary.getOres("nuggetIron").size() - 1);
|
||||||
|
//GameRegistry.addSmelting(tiberiumOre, new ItemStack(tiberiumShardInstable, 6), (1F));
|
||||||
|
//GameRegistry.addSmelting(tiberiumShardInstable, new ItemStack(tiberiumIngot), (.1F));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,36 +25,34 @@ public class TraitAnalysing extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onXpDrop(LivingExperienceDropEvent event) {
|
public void onXpDrop(LivingExperienceDropEvent event) {
|
||||||
EntityPlayer player = event.getAttackingPlayer();
|
EntityPlayer player = event.getAttackingPlayer();
|
||||||
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)
|
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier) && event.getDroppedExperience() >= 0) {
|
||||||
&& event.getDroppedExperience() > 0) {
|
|
||||||
event.setDroppedExperience(this.getUpdateXP(event.getDroppedExperience()));
|
event.setDroppedExperience(this.getUpdateXP(event.getDroppedExperience()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||||
EntityPlayer player = event.getPlayer();
|
EntityPlayer player = event.getPlayer();
|
||||||
if (!event.getWorld().isRemote && player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
|
if (!event.getWorld().isRemote && player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier) && event.getExpToDrop() >= 0) {
|
||||||
.getHeldItemMainhand()), this.identifier) && event.getExpToDrop() > 0) {
|
|
||||||
event.setExpToDrop(this.getUpdateXP(event.getExpToDrop()));
|
event.setExpToDrop(this.getUpdateXP(event.getExpToDrop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMobDrops(LivingDropsEvent event) {
|
public void onMobDrops(LivingDropsEvent event) {
|
||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
if (random.nextFloat() < .1f && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
if (random.nextFloat() < .1f && event.getSource().getEntity() instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||||
if (!w.isRemote && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe
|
if (!w.isRemote && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
(player.getHeldItemMainhand()), identifier)) {
|
|
||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getUpdateXP(int xp) {
|
private int getUpdateXP(int xp) {
|
||||||
float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextInt(xp) * (1 +
|
float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextInt(xp) * (1 + random.nextFloat()));
|
||||||
random.nextFloat()));
|
|
||||||
return Math.round(exp);
|
return Math.round(exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,8 +26,7 @@ public class TraitArcane extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
int time = (int) world.getWorldTime();
|
int time = (int) world.getWorldTime();
|
||||||
if (random.nextFloat() <= 0.05 && isNight(time)) {
|
if (random.nextFloat() <= 0.05 && isNight(time)) {
|
||||||
ToolHelper.healTool(tool, random.nextInt(8) + 1, null);
|
ToolHelper.healTool(tool, random.nextInt(8) + 1, null);
|
||||||
@@ -35,8 +34,7 @@ public class TraitArcane extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||||
wasCritical, boolean wasHit) {
|
|
||||||
int time = (int) player.getEntityWorld().getWorldTime();
|
int time = (int) player.getEntityWorld().getWorldTime();
|
||||||
if (random.nextFloat() <= 0.05 && isNight(time)) {
|
if (random.nextFloat() <= 0.05 && isNight(time)) {
|
||||||
ToolHelper.healTool(tool, random.nextInt(8) + 1, null);
|
ToolHelper.healTool(tool, random.nextInt(8) + 1, null);
|
||||||
@@ -47,11 +45,10 @@ public class TraitArcane extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onEntityKill(LivingDeathEvent e) {
|
public void onEntityKill(LivingDeathEvent e) {
|
||||||
World w = e.getEntity().getEntityWorld();
|
World w = e.getEntity().getEntityWorld();
|
||||||
if (!w.isRemote && e.getSource().getTrueSource() != null) {
|
if (!w.isRemote && e.getSource().getEntity() != null) {
|
||||||
if (e.getSource().getTrueSource() instanceof EntityPlayer && e.getEntity() instanceof EntityCreature) {
|
if (e.getSource().getEntity() instanceof EntityPlayer && e.getEntity() instanceof EntityCreature) {
|
||||||
ItemStack tool = ((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand();
|
ItemStack tool = ((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand();
|
||||||
if (isNight((int) w.getWorldTime()) && random.nextFloat() < 0.1 && TinkerUtil.hasTrait(TagUtil
|
if (isNight((int) w.getWorldTime()) && random.nextFloat() < 0.1 && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
||||||
.getTagSafe(tool), identifier)) {
|
|
||||||
ToolHelper.healTool(tool, random.nextInt(16), null);
|
ToolHelper.healTool(tool, random.nextInt(16), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,15 +16,13 @@ import slimeknights.tconstruct.library.utils.TagUtil;
|
|||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
import slimeknights.tconstruct.library.utils.ToolHelper;
|
import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||||
|
|
||||||
import static com.sosnitzka.taiga.Keybindings.altKey;
|
|
||||||
|
|
||||||
|
public class TraitBeserk extends TraitProgressiveStats {
|
||||||
public class TraitBerserk extends TraitProgressiveStats {
|
|
||||||
|
|
||||||
protected static int TICK_PER_STAT = 8;
|
protected static int TICK_PER_STAT = 8;
|
||||||
|
|
||||||
public TraitBerserk() {
|
public TraitBeserk() {
|
||||||
super(TraitBerserk.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
super(TraitBeserk.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,14 +35,14 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
newDamage, boolean isCritical) {
|
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
if (!data.active) return newDamage;
|
if (!data.active) return newDamage;
|
||||||
return newDamage * 4;
|
return newDamage * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
@@ -54,10 +52,11 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
NBTTagCompound root = TagUtil.getTagSafe(tool);
|
NBTTagCompound root = TagUtil.getTagSafe(tool);
|
||||||
StatNBT distributed = getBonus(root);
|
StatNBT distributed = getBonus(root);
|
||||||
if (data.active) {
|
if (data.active) {
|
||||||
if (!TagUtil.hasEnchantEffect(root))
|
TagUtil.setEnchantEffect(root, true);
|
||||||
TagUtil.setEnchantEffect(root, true);
|
if (entity instanceof FakePlayer) {
|
||||||
|
return;
|
||||||
if (entity instanceof FakePlayer || entity.ticksExisted % TICK_PER_STAT != 0) {
|
}
|
||||||
|
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,10 +68,7 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
ToolHelper.damageTool(tool, 1, player);
|
ToolHelper.damageTool(tool, 1, player);
|
||||||
TagUtil.setToolTag(root, stat.get());
|
TagUtil.setToolTag(root, stat.get());
|
||||||
setBonus(root, distributed);
|
setBonus(root, distributed);
|
||||||
} else {
|
} else TagUtil.setEnchantEffect(root, false);
|
||||||
if (TagUtil.hasEnchantEffect(root))
|
|
||||||
TagUtil.setEnchantEffect(root, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +76,7 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||||
World w = event.getWorld();
|
World w = event.getWorld();
|
||||||
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && altKey.isKeyDown()) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
NBTTagCompound root = TagUtil.getTagSafe(tool);
|
NBTTagCompound root = TagUtil.getTagSafe(tool);
|
||||||
@@ -91,6 +87,7 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
TagUtil.setEnchantEffect(root, false);
|
TagUtil.setEnchantEffect(root, false);
|
||||||
TagUtil.setExtraTag(root, tag);
|
TagUtil.setExtraTag(root, tag);
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
stat.durability -= 10;
|
stat.durability -= 10;
|
||||||
distributed.durability -= 10;
|
distributed.durability -= 10;
|
||||||
@@ -102,6 +99,9 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
TagUtil.setExtraTag(root, tag);
|
TagUtil.setExtraTag(root, tag);
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@@ -19,8 +19,7 @@ public class TraitBlind extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
int time = (int) world.getWorldTime();
|
int time = (int) world.getWorldTime();
|
||||||
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
|
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
|
||||||
if (random.nextBoolean())
|
if (random.nextBoolean())
|
||||||
@@ -31,8 +30,7 @@ public class TraitBlind extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||||
wasCritical, boolean wasHit) {
|
|
||||||
int time = (int) player.getEntityWorld().getWorldTime();
|
int time = (int) player.getEntityWorld().getWorldTime();
|
||||||
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
|
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
|
||||||
if (random.nextBoolean())
|
if (random.nextBoolean())
|
||||||
|
@@ -22,8 +22,7 @@ public class TraitBright extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
newDamage, boolean isCritical) {
|
|
||||||
int time = (int) target.getEntityWorld().getWorldTime();
|
int time = (int) target.getEntityWorld().getWorldTime();
|
||||||
if (!isNight(time)) {
|
if (!isNight(time)) {
|
||||||
newDamage = damage * (1 + random.nextFloat() / 2f);
|
newDamage = damage * (1 + random.nextFloat() / 2f);
|
||||||
@@ -31,9 +30,9 @@ public class TraitBright extends AbstractTrait {
|
|||||||
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
if (random.nextFloat() >= chance) {
|
if (random.nextFloat() >= chance) {
|
||||||
player.addPotionEffect(new PotionEffect(GLOWING, 200));
|
player.addPotionEffect(new PotionEffect(GLOWING, 200));
|
||||||
}
|
}
|
||||||
|
25
src/main/java/com/sosnitzka/taiga/traits/TraitCarousel.java
Normal file
25
src/main/java/com/sosnitzka/taiga/traits/TraitCarousel.java
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
|
|
||||||
|
public class TraitCarousel extends AbstractTrait {
|
||||||
|
|
||||||
|
public static final int TICK = 24;
|
||||||
|
|
||||||
|
public TraitCarousel() {
|
||||||
|
super(TraitCarousel.class.getSimpleName().toLowerCase().substring(5), 0xffcc5511);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -16,16 +16,14 @@ public class TraitCascade extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
float f = random.nextFloat();
|
float f = random.nextFloat();
|
||||||
if (!world.isRemote && tool.canHarvestBlock(state) && f <= 0.1) {
|
if (!world.isRemote && tool.canHarvestBlock(state) && f <= 0.1) {
|
||||||
double x, y, z, sx, sy, sz;
|
double x, y, z, sx, sy, sz;
|
||||||
sx = x = pos.getX();
|
sx = x = pos.getX();
|
||||||
sy = y = pos.getY();
|
sy = y = pos.getY();
|
||||||
sz = z = pos.getZ();
|
sz = z = pos.getZ();
|
||||||
int i = random.nextInt((int) Math.min(300f * (float) ToolHelper.getCurrentDurability(tool) / ToolHelper
|
int i = random.nextInt((int) Math.min(300f * (float) ToolHelper.getCurrentDurability(tool) / ToolHelper.getMaxDurability(tool), 50f));
|
||||||
.getMaxDurability(tool), 50f));
|
|
||||||
for (int a = i; a > 0; a--) {
|
for (int a = i; a > 0; a--) {
|
||||||
int r = random.nextInt(3);
|
int r = random.nextInt(3);
|
||||||
int d = random.nextBoolean() ? 1 : -1;
|
int d = random.nextBoolean() ? 1 : -1;
|
||||||
|
@@ -16,15 +16,11 @@ import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
|||||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
import slimeknights.tconstruct.library.utils.ToolHelper;
|
import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||||
|
|
||||||
import static com.sosnitzka.taiga.Keybindings.altKey;
|
|
||||||
|
|
||||||
|
|
||||||
public class TraitCatcher extends AbstractTrait {
|
public class TraitCatcher extends AbstractTrait {
|
||||||
|
|
||||||
@@ -38,33 +34,26 @@ public class TraitCatcher extends AbstractTrait {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void killEntity(LivingDeathEvent event) {
|
public void killEntity(LivingDeathEvent event) {
|
||||||
if (!(event.getSource().getTrueSource() instanceof EntityPlayer))
|
if (!(event.getSource().getEntity() instanceof EntityPlayer))
|
||||||
return;
|
return;
|
||||||
if (event.getEntityLiving() instanceof EntityPlayer || event.getEntityLiving() instanceof EntityPlayerMP)
|
if (event.getEntityLiving() instanceof EntityPlayer || event.getEntityLiving() instanceof EntityPlayerMP)
|
||||||
return;
|
return;
|
||||||
|
World w = event.getSource().getEntity().getEntityWorld();
|
||||||
World w = event.getSource().getTrueSource().getEntityWorld();
|
EntityPlayer p = (EntityPlayer) event.getSource().getEntity();
|
||||||
EntityPlayer p = (EntityPlayer) event.getSource().getTrueSource();
|
|
||||||
|
|
||||||
if (!TinkerUtil.hasTrait(TagUtil.getTagSafe(p.getHeldItemMainhand()), identifier))
|
|
||||||
return;
|
|
||||||
|
|
||||||
EntityLivingBase target = event.getEntityLiving();
|
EntityLivingBase target = event.getEntityLiving();
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(p.getHeldItemMainhand());
|
NBTTagCompound tag = TagUtil.getExtraTag(p.getHeldItemMainhand());
|
||||||
Data data = Data.read(tag);
|
Data data = Data.read(tag);
|
||||||
|
|
||||||
if (!data.mobClass.isEmpty())
|
if (!data.mobClass.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!w.isRemote && random.nextInt((int) target.getMaxHealth()) <= chance && target instanceof EntityLiving) {
|
if (!w.isRemote && random.nextInt((int) target.getMaxHealth()) <= chance && target instanceof EntityLiving) {
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
target.setDropItemsWhenDead(false);
|
target.setDropItemsWhenDead(false);
|
||||||
|
|
||||||
if (data.mobClass.isEmpty()) {
|
if (data.mobClass.isEmpty()) {
|
||||||
data.mobClass = target.getClass().getName();
|
data.mobClass = target.getClass().getName();
|
||||||
data.mobName = target.getName();
|
data.mobName = target.getName();
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
TagUtil.setExtraTag(p.getHeldItemMainhand(), tag);
|
if (p.getHeldItemMainhand() != null)
|
||||||
|
TagUtil.setExtraTag(p.getHeldItemMainhand(), tag);
|
||||||
p.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
p.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
target.setDropItemsWhenDead(false);
|
target.setDropItemsWhenDead(false);
|
||||||
target.setDead();
|
target.setDead();
|
||||||
@@ -72,6 +61,7 @@ public class TraitCatcher extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
@@ -84,12 +74,13 @@ public class TraitCatcher extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||||
World w = event.getWorld();
|
World w = event.getWorld();
|
||||||
BlockPos pos = event.getEntityPlayer().getPosition();
|
BlockPos pos = event.getEntityPlayer().getPosition();
|
||||||
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && altKey.isKeyDown()) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Data data = Data.read(tag);
|
Data data = Data.read(tag);
|
||||||
if (!data.mobClass.isEmpty()) {
|
if (!data.mobClass.isEmpty()) {
|
||||||
@@ -102,20 +93,19 @@ public class TraitCatcher extends AbstractTrait {
|
|||||||
|
|
||||||
if (ent != null) {
|
if (ent != null) {
|
||||||
ent.setPosition(pos.getX(), pos.getY(), pos.getZ()); // TODO: set to player view target
|
ent.setPosition(pos.getX(), pos.getY(), pos.getZ()); // TODO: set to player view target
|
||||||
w.spawnEntity(ent);
|
w.spawnEntityInWorld(ent);
|
||||||
event.getEntityPlayer().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
event.getEntityPlayer().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
data.mobClass = "";
|
data.mobClass = "";
|
||||||
data.mobName = "";
|
data.mobName = "";
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
TagUtil.setExtraTag(tool, tag);
|
TagUtil.setExtraTag(tool, tag);
|
||||||
ToolHelper.damageTool(tool, random.nextInt((int) (ToolHelper.getCurrentDurability(tool) *
|
ToolHelper.damageTool(tool, random.nextInt((int) (ToolHelper.getCurrentDurability(tool) * costMulti)), event.getEntityPlayer());
|
||||||
costMulti)), event.getEntityPlayer());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemTooltip(ItemTooltipEvent e) {
|
public void onItemTooltip(ItemTooltipEvent e) {
|
||||||
ItemStack tool = e.getItemStack();
|
ItemStack tool = e.getItemStack();
|
||||||
@@ -123,8 +113,7 @@ public class TraitCatcher extends AbstractTrait {
|
|||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Data data = Data.read(tag);
|
Data data = Data.read(tag);
|
||||||
if (!data.mobClass.isEmpty())
|
if (!data.mobClass.isEmpty())
|
||||||
e.getToolTip().add(TextFormatting.DARK_PURPLE + "Captured: " + TextFormatting.LIGHT_PURPLE + data
|
e.getToolTip().add(TextFormatting.DARK_PURPLE + "Captured: " + TextFormatting.LIGHT_PURPLE + data.mobName);
|
||||||
.mobName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,14 +12,14 @@ import net.minecraftforge.common.MinecraftForge;
|
|||||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
|
|
||||||
|
|
||||||
public class TraitCongenial extends AbstractTrait {
|
public class TraitCongenial extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public TraitCongenial() {
|
public TraitCongenial() {
|
||||||
super(TraitCongenial.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
super(TraitCongenial.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
@@ -27,11 +27,9 @@ public class TraitCongenial extends AbstractTrait {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onEntityKill(LivingDeathEvent e) {
|
public void onEntityKill(LivingDeathEvent e) {
|
||||||
if (e.getSource().getTrueSource() instanceof EntityPlayer && !e.getSource().getTrueSource().world.isRemote &&
|
if (e.getSource().getEntity() instanceof EntityPlayer && !e.getSource().getEntity().worldObj.isRemote && e.getEntity() instanceof EntityCreature) {
|
||||||
e.getEntity() instanceof EntityCreature) {
|
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand()), identifier)) {
|
||||||
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getTrueSource())
|
ItemStack tool = ((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand();
|
||||||
.getHeldItemMainhand()), identifier)) {
|
|
||||||
ItemStack tool = ((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand();
|
|
||||||
String name = e.getEntity().getName();
|
String name = e.getEntity().getName();
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
@@ -40,14 +38,14 @@ public class TraitCongenial extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
data.name = name;
|
data.name = name;
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
|
assert tool != null;
|
||||||
TagUtil.setExtraTag(tool, tag);
|
TagUtil.setExtraTag(tool, tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
newDamage, boolean isCritical) {
|
|
||||||
World w = player.getEntityWorld();
|
World w = player.getEntityWorld();
|
||||||
if (!w.isRemote) {
|
if (!w.isRemote) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
@@ -64,7 +62,6 @@ public class TraitCongenial extends AbstractTrait {
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemTooltip(ItemTooltipEvent e) {
|
public void onItemTooltip(ItemTooltipEvent e) {
|
||||||
ItemStack tool = e.getItemStack();
|
ItemStack tool = e.getItemStack();
|
||||||
@@ -77,4 +74,5 @@ public class TraitCongenial extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,33 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.traits;
|
|
||||||
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraftforge.event.world.BlockEvent;
|
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
|
||||||
|
|
||||||
public class TraitCrushing extends AbstractTrait {
|
|
||||||
|
|
||||||
public TraitCrushing() {
|
|
||||||
super(TraitCrushing.class.getSimpleName().toLowerCase().substring(5), TextFormatting.GRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent e) {
|
|
||||||
if (!e.getWorld().isRemote) {
|
|
||||||
IBlockState state = e.getState();
|
|
||||||
float f = random.nextFloat();
|
|
||||||
if (state.equals(Blocks.STONE.getDefaultState())) {
|
|
||||||
e.getDrops().clear();
|
|
||||||
if (f < .3f) {
|
|
||||||
e.getDrops().add(new ItemStack(Blocks.SAND));
|
|
||||||
} else if (f < .6f) {
|
|
||||||
e.getDrops().add(new ItemStack(Blocks.GRAVEL));
|
|
||||||
} else if (f <= .9f) {
|
|
||||||
e.getDrops().add(new ItemStack(Blocks.COBBLESTONE));
|
|
||||||
} else e.getDrops().add(new ItemStack(Blocks.STONE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -11,8 +11,6 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
@@ -20,6 +18,8 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
public class TraitCursed extends AbstractTrait {
|
public class TraitCursed extends AbstractTrait {
|
||||||
|
|
||||||
|
private static int chance = 60 * 1000;
|
||||||
|
|
||||||
public TraitCursed() {
|
public TraitCursed() {
|
||||||
super(TraitCursed.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
super(TraitCursed.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
@@ -27,21 +27,21 @@ public class TraitCursed extends AbstractTrait {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
|
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
int chance = 60 * 1000;
|
|
||||||
if (random.nextInt((chance + data.curse) / (data.curse + 1)) == 1) {
|
if (random.nextInt((chance + data.curse) / (data.curse + 1)) == 1) {
|
||||||
if (isSelected) data.curse += 10;
|
if (isSelected) data.curse += 10;
|
||||||
else data.curse++;
|
else data.curse++;
|
||||||
entity.attackEntityFrom(new DamageSource("Curse"), random.nextFloat() * ((EntityPlayer) entity).getHealth
|
entity.attackEntityFrom(new DamageSource("Curse"), random.nextFloat() * ((EntityPlayer) entity).getHealth() / 2);
|
||||||
() / 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
TagUtil.setExtraTag(tool, tag);
|
TagUtil.setExtraTag(tool, tag);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemTooltip(ItemTooltipEvent e) {
|
public void onItemTooltip(ItemTooltipEvent e) {
|
||||||
ItemStack tool = e.getItemStack();
|
ItemStack tool = e.getItemStack();
|
||||||
@@ -53,4 +53,6 @@ public class TraitCursed extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -38,9 +38,7 @@ public class TraitCurvature extends AbstractTrait {
|
|||||||
@Override
|
@Override
|
||||||
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
|
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
|
||||||
if (!event.getWorld().isRemote && random.nextFloat() < 0.05) {
|
if (!event.getWorld().isRemote && random.nextFloat() < 0.05) {
|
||||||
List<IBlockState> blockstates = Lists.newArrayList(Blocks.STONE.getDefaultState(), Blocks.NETHERRACK
|
List<IBlockState> blockstates = Lists.newArrayList(Blocks.STONE.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), Blocks.END_STONE.getDefaultState(), Blocks.AIR.getDefaultState(), Blocks.DIRT.getDefaultState());
|
||||||
.getDefaultState(), Blocks.END_STONE.getDefaultState(), Blocks.AIR.getDefaultState(), Blocks.DIRT
|
|
||||||
.getDefaultState());
|
|
||||||
IBlockState mainstate = event.getState();
|
IBlockState mainstate = event.getState();
|
||||||
if (blockstates.contains(mainstate)) return;
|
if (blockstates.contains(mainstate)) return;
|
||||||
for (int i = 0; i < chance; i++) {
|
for (int i = 0; i < chance; i++) {
|
||||||
@@ -53,17 +51,17 @@ public class TraitCurvature extends AbstractTrait {
|
|||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
event.getWorld().setBlockState(cPos, mainstate);
|
event.getWorld().setBlockState(cPos, mainstate);
|
||||||
event.getHarvester().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
event.getHarvester().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
event.getHarvester().sendStatusMessage(new TextComponentString("Teleported to: " + x + " " + y +
|
event.getHarvester().addChatComponentMessage(new TextComponentString("Teleported to: " + x + " " + y + " " + z));
|
||||||
" " + z), false);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||||
wasCritical, boolean wasHit) {
|
|
||||||
if (random.nextFloat() <= 0.15) {
|
if (random.nextFloat() <= 0.15) {
|
||||||
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
changePos(player, target);
|
changePos(player, target);
|
||||||
@@ -73,13 +71,11 @@ public class TraitCurvature extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMobDrops(LivingDropsEvent event) {
|
public void onMobDrops(LivingDropsEvent event) {
|
||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
if (!w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
if (!w.isRemote && event.getSource().getEntity() instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||||
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
|
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
.getHeldItemMainhand()), identifier)) {
|
|
||||||
ItemStack i = new ItemStack(Items.ENDER_PEARL, random.nextInt(2));
|
ItemStack i = new ItemStack(Items.ENDER_PEARL, random.nextInt(2));
|
||||||
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event
|
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, i));
|
||||||
.getEntity().posZ, i));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,8 +15,7 @@ public class TraitDark extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
newDamage, boolean isCritical) {
|
|
||||||
int time = (int) target.getEntityWorld().getWorldTime();
|
int time = (int) target.getEntityWorld().getWorldTime();
|
||||||
if (isNight(time)) {
|
if (isNight(time)) {
|
||||||
newDamage = damage * (1 + random.nextFloat() / 2f);
|
newDamage = damage * (1 + random.nextFloat() / 2f);
|
||||||
|
@@ -21,7 +21,7 @@ import java.util.List;
|
|||||||
public class TraitDecay extends TraitProgressiveStats {
|
public class TraitDecay extends TraitProgressiveStats {
|
||||||
|
|
||||||
protected static int TICK_PER_STAT = 24;
|
protected static int TICK_PER_STAT = 24;
|
||||||
protected static int DURABILITY_STEP = 1;
|
protected static int DURABILITY_STEP = 10;
|
||||||
protected static float SPEED_STEP = 0.05f;
|
protected static float SPEED_STEP = 0.05f;
|
||||||
protected static float ATTACK_STEP = 0.05f;
|
protected static float ATTACK_STEP = 0.05f;
|
||||||
|
|
||||||
@@ -62,7 +62,16 @@ public class TraitDecay extends TraitProgressiveStats {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
if (entity instanceof FakePlayer || entity.world.isRemote || entity.ticksExisted % TICK_PER_STAT != 0 || playerIsBreakingBlock(entity)) {
|
if (entity instanceof FakePlayer || entity.worldObj.isRemote) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// every 3.6 seconds we distribute one stat. This means 1h = 1000 applications
|
||||||
|
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// we don't update if the player is currently breaking a block because that'd reset it
|
||||||
|
if (playerIsBreakingBlock(entity)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,32 @@
|
|||||||
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockStone;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.world.BlockEvent;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
|
|
||||||
|
|
||||||
|
public class TraitDevelopement extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
|
public TraitDevelopement() {
|
||||||
|
super(TraitDevelopement.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onBreak(BlockEvent.BreakEvent e) {
|
||||||
|
IBlockState state = e.getState();
|
||||||
|
ItemStack tool = e.getPlayer().getHeldItemMainhand();
|
||||||
|
if (state.getBlock().equals(net.minecraft.init.Blocks.STONE) && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier))
|
||||||
|
System.out.println("State.Variant: " + state.getValue(BlockStone.VARIANT));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -13,7 +13,6 @@ import slimeknights.tconstruct.library.traits.AbstractTrait;
|
|||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
|
|
||||||
|
|
||||||
public class TraitDiffuse extends AbstractTrait {
|
public class TraitDiffuse extends AbstractTrait {
|
||||||
|
|
||||||
public TraitDiffuse() {
|
public TraitDiffuse() {
|
||||||
@@ -24,8 +23,7 @@ public class TraitDiffuse extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||||
EntityPlayer player = event.getPlayer();
|
EntityPlayer player = event.getPlayer();
|
||||||
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()),
|
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) {
|
||||||
this.identifier)) {
|
|
||||||
event.setExpToDrop((int) this.getUpdateXP(event.getExpToDrop()));
|
event.setExpToDrop((int) this.getUpdateXP(event.getExpToDrop()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,17 +31,16 @@ public class TraitDiffuse extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMobDrops(LivingDropsEvent event) {
|
public void onMobDrops(LivingDropsEvent event) {
|
||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
if (!w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
if (!w.isRemote && event.getSource().getEntity() instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||||
if (event.getEntity() instanceof EntityCreature && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
|
if (event.getEntity() instanceof EntityCreature && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
.getHeldItemMainhand()), identifier)) {
|
|
||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getUpdateXP(int xp) {
|
private float getUpdateXP(int xp) {
|
||||||
float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (1 + random.nextFloat() * xp);
|
float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextFloat() * xp);
|
||||||
if (random.nextFloat() <= 0.25)
|
if (random.nextFloat() <= 0.25)
|
||||||
return exp;
|
return exp;
|
||||||
else return 0;
|
else return 0;
|
||||||
|
@@ -18,13 +18,13 @@ public class TraitDissolving extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// high chance to remove XP, low chance to double,triple or quatruple dropped Experience
|
// high chance to remove XP, low chance to double,triple or quatruple dropped Experience
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onXpDrop(LivingExperienceDropEvent event) {
|
public void onXpDrop(LivingExperienceDropEvent event) {
|
||||||
if (!event.getEntity().getEntityWorld().isRemote) {
|
if (!event.getEntity().getEntityWorld().isRemote) {
|
||||||
EntityPlayer player = event.getAttackingPlayer();
|
EntityPlayer player = event.getAttackingPlayer();
|
||||||
float r = random.nextFloat();
|
float r = random.nextFloat();
|
||||||
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this
|
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) {
|
||||||
.identifier)) {
|
|
||||||
if (r <= 0.80) {
|
if (r <= 0.80) {
|
||||||
event.setDroppedExperience(0);
|
event.setDroppedExperience(0);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -20,8 +20,7 @@ public class TraitFracture extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
float f = random.nextFloat();
|
float f = random.nextFloat();
|
||||||
float b = 0.99F * calcBonus(tool);
|
float b = 0.99F * calcBonus(tool);
|
||||||
if (!world.isRemote && tool.canHarvestBlock(state) && f <= b) {
|
if (!world.isRemote && tool.canHarvestBlock(state) && f <= b) {
|
||||||
@@ -31,38 +30,32 @@ public class TraitFracture extends AbstractTrait {
|
|||||||
switch (mop.sideHit) {
|
switch (mop.sideHit) {
|
||||||
case UP:
|
case UP:
|
||||||
BlockPos next1 = new BlockPos(pos.getX(), pos.getY() - i, pos.getZ());
|
BlockPos next1 = new BlockPos(pos.getX(), pos.getY() - i, pos.getZ());
|
||||||
if (tool.canHarvestBlock(world.getBlockState(next1)) && !world.getBlockState(next1)
|
if (tool.canHarvestBlock(world.getBlockState(next1)) && !world.getBlockState(next1).equals(Blocks.BEDROCK.getDefaultState()))
|
||||||
.equals(Blocks.BEDROCK.getDefaultState()))
|
|
||||||
world.destroyBlock(next1, true);
|
world.destroyBlock(next1, true);
|
||||||
break;
|
break;
|
||||||
case DOWN:
|
case DOWN:
|
||||||
BlockPos next2 = new BlockPos(pos.getX(), pos.getY() + i, pos.getZ());
|
BlockPos next2 = new BlockPos(pos.getX(), pos.getY() + i, pos.getZ());
|
||||||
if (tool.canHarvestBlock(world.getBlockState(next2)) && !world.getBlockState(next2)
|
if (tool.canHarvestBlock(world.getBlockState(next2)) && !world.getBlockState(next2).equals(Blocks.BEDROCK.getDefaultState()))
|
||||||
.equals(Blocks.BEDROCK.getDefaultState()))
|
|
||||||
world.destroyBlock(next2, true);
|
world.destroyBlock(next2, true);
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
BlockPos next3 = new BlockPos(pos.getX() + i, pos.getY(), pos.getZ());
|
BlockPos next3 = new BlockPos(pos.getX() + i, pos.getY(), pos.getZ());
|
||||||
if (tool.canHarvestBlock(world.getBlockState(next3)) && !world.getBlockState(next3)
|
if (tool.canHarvestBlock(world.getBlockState(next3)) && !world.getBlockState(next3).equals(Blocks.BEDROCK.getDefaultState()))
|
||||||
.equals(Blocks.BEDROCK.getDefaultState()))
|
|
||||||
world.destroyBlock(next3, true);
|
world.destroyBlock(next3, true);
|
||||||
break;
|
break;
|
||||||
case EAST:
|
case EAST:
|
||||||
BlockPos next4 = new BlockPos(pos.getX() - i, pos.getY(), pos.getZ());
|
BlockPos next4 = new BlockPos(pos.getX() - i, pos.getY(), pos.getZ());
|
||||||
if (tool.canHarvestBlock(world.getBlockState(next4)) && !world.getBlockState(next4)
|
if (tool.canHarvestBlock(world.getBlockState(next4)) && !world.getBlockState(next4).equals(Blocks.BEDROCK.getDefaultState()))
|
||||||
.equals(Blocks.BEDROCK.getDefaultState()))
|
|
||||||
world.destroyBlock(next4, true);
|
world.destroyBlock(next4, true);
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
BlockPos next5 = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - i);
|
BlockPos next5 = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - i);
|
||||||
if (tool.canHarvestBlock(world.getBlockState(next5)) && !world.getBlockState(next5)
|
if (tool.canHarvestBlock(world.getBlockState(next5)) && !world.getBlockState(next5).equals(Blocks.BEDROCK.getDefaultState()))
|
||||||
.equals(Blocks.BEDROCK.getDefaultState()))
|
|
||||||
world.destroyBlock(next5, true);
|
world.destroyBlock(next5, true);
|
||||||
break;
|
break;
|
||||||
case NORTH:
|
case NORTH:
|
||||||
BlockPos next6 = new BlockPos(pos.getX(), pos.getY() - i, pos.getZ() + i);
|
BlockPos next6 = new BlockPos(pos.getX(), pos.getY() - i, pos.getZ() + i);
|
||||||
if (tool.canHarvestBlock(world.getBlockState(next6)) && !world.getBlockState(next6)
|
if (tool.canHarvestBlock(world.getBlockState(next6)) && !world.getBlockState(next6).equals(Blocks.BEDROCK.getDefaultState()))
|
||||||
.equals(Blocks.BEDROCK.getDefaultState()))
|
|
||||||
world.destroyBlock(next6, true);
|
world.destroyBlock(next6, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -18,8 +18,7 @@ public class TraitFragile extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
if (random.nextBoolean()) {
|
if (random.nextBoolean()) {
|
||||||
float f = random.nextFloat();
|
float f = random.nextFloat();
|
||||||
float b = 0.99F * calcBonus(tool);
|
float b = 0.99F * calcBonus(tool);
|
||||||
|
@@ -28,10 +28,9 @@ public class TraitGarishly extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMobDrops(LivingDropsEvent event) {
|
public void onMobDrops(LivingDropsEvent event) {
|
||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
if (!w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
if (!w.isRemote && event.getSource().getEntity() instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||||
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
|
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
.getHeldItemMainhand()), identifier)) {
|
|
||||||
|
|
||||||
int r = random.nextInt(2);
|
int r = random.nextInt(2);
|
||||||
ItemStack i = null;
|
ItemStack i = null;
|
||||||
@@ -47,8 +46,7 @@ public class TraitGarishly extends AbstractTrait {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
assert i != null;
|
assert i != null;
|
||||||
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event
|
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, i));
|
||||||
.getEntity().posZ, i));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,12 +56,13 @@ public class TraitGarishly extends AbstractTrait {
|
|||||||
float r = random.nextFloat();
|
float r = random.nextFloat();
|
||||||
if (random.nextBoolean()) event.getDrops().clear();
|
if (random.nextBoolean()) event.getDrops().clear();
|
||||||
else if (r < 0.25 && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.ROCK) {
|
else if (r < 0.25 && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.ROCK) {
|
||||||
@SuppressWarnings("ConstantConditions") ItemStack stack = new ItemStack(Item.getItemFromBlock(event
|
@SuppressWarnings("ConstantConditions") ItemStack stack = new ItemStack(Item.getItemFromBlock(event.getWorld().getBlockState(event.getPos()).getBlock()), random.nextInt(3));
|
||||||
.getWorld().getBlockState(event.getPos()).getBlock()), random.nextInt(3));
|
|
||||||
event.getDrops().add(0, stack);
|
event.getDrops().add(0, stack);
|
||||||
ToolHelper.damageTool(tool, random.nextInt(6) + 1, event.getHarvester());
|
ToolHelper.damageTool(tool, random.nextInt(6) + 1, event.getHarvester());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
public class TraitGlimmer extends AbstractTrait {
|
public class TraitGlimmer extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public TraitGlimmer() {
|
public TraitGlimmer() {
|
||||||
super("glimmer", TextFormatting.DARK_GRAY);
|
super("glimmer", TextFormatting.DARK_GRAY);
|
||||||
}
|
}
|
||||||
@@ -32,16 +33,14 @@ public class TraitGlimmer extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
if (random.nextFloat() <= 0.05) {
|
if (random.nextFloat() <= 0.05) {
|
||||||
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, random.nextInt(600) + 300));
|
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, random.nextInt(600) + 300));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||||
wasCritical, boolean wasHit) {
|
|
||||||
if (random.nextFloat() <= 0.05) {
|
if (random.nextFloat() <= 0.05) {
|
||||||
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, random.nextInt(600) + 300));
|
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, random.nextInt(600) + 300));
|
||||||
}
|
}
|
||||||
|
@@ -16,17 +16,11 @@ public class TraitHeroic extends AbstractTrait {
|
|||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
int durability = ToolHelper.getCurrentDurability(tool);
|
int durability = ToolHelper.getCurrentDurability(tool);
|
||||||
int durabilitymax = ToolHelper.getMaxDurability(tool);
|
int durabilitymax = ToolHelper.getMaxDurability(tool);
|
||||||
|
|
||||||
int safeDenominator = durabilitymax - durability - 1;
|
|
||||||
if (safeDenominator <= 0) {
|
|
||||||
safeDenominator = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
float calc;
|
float calc;
|
||||||
if ((durability * durabilitymax / (durabilitymax - durability - 1 / safeDenominator)) != 0) {
|
if ((durability * durabilitymax / (durabilitymax - durability - 1)) != 0) {
|
||||||
calc = newDamage + (newDamage / 2) / (durability * durabilitymax / safeDenominator);
|
calc = newDamage + (newDamage / 2) / (durability * durabilitymax / (durabilitymax - durability - 1));
|
||||||
} else {
|
} else {
|
||||||
calc = newDamage + (newDamage / 2) / ((durability * durabilitymax / safeDenominator) + 1);
|
calc = newDamage + (newDamage / 2) / ((durability * durabilitymax / (durabilitymax - durability - 1)) + 1);
|
||||||
}
|
}
|
||||||
if ((float) durability < (float) (0.10 * durabilitymax) || player.getHealth() < player.getMaxHealth() / 8 || (target.getHealth() == target.getMaxHealth() && random.nextFloat() > 0.8)) {
|
if ((float) durability < (float) (0.10 * durabilitymax) || player.getHealth() < player.getMaxHealth() / 8 || (target.getHealth() == target.getMaxHealth() && random.nextFloat() > 0.8)) {
|
||||||
return super.damage(tool, player, target, damage, calc, isCritical);
|
return super.damage(tool, player, target, damage, calc, isCritical);
|
||||||
|
@@ -24,9 +24,9 @@ public class TraitHollow extends AbstractTrait {
|
|||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void onHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean isCritical) {
|
||||||
isCritical) {
|
|
||||||
int time = (int) player.getEntityWorld().getWorldTime();
|
int time = (int) player.getEntityWorld().getWorldTime();
|
||||||
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
|
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
|
||||||
((EntityLiving) target).setNoAI(true);
|
((EntityLiving) target).setNoAI(true);
|
||||||
@@ -40,10 +40,9 @@ public class TraitHollow extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMobDrops(LivingDropsEvent event) {
|
public void onMobDrops(LivingDropsEvent event) {
|
||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
if (!w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
if (!w.isRemote && event.getSource().getEntity() instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||||
if (random.nextFloat() <= 0.9 && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil
|
if (random.nextFloat() <= 0.9 && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
|
||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,10 +20,11 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
import slimeknights.tconstruct.library.utils.ToolHelper;
|
import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||||
|
|
||||||
|
|
||||||
public class TraitUnstable extends AbstractTrait {
|
public class TraitInstable extends AbstractTrait {
|
||||||
|
|
||||||
public TraitUnstable() {
|
|
||||||
super("unstable", TextFormatting.DARK_RED);
|
public TraitInstable() {
|
||||||
|
super("instable", TextFormatting.DARK_RED);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,12 +56,11 @@ public class TraitUnstable extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMobDrops(LivingDropsEvent event) {
|
public void onMobDrops(LivingDropsEvent event) {
|
||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
if (random.nextFloat() < 0.05 && !w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
if (random.nextFloat() < 0.05 && !w.isRemote && event.getSource().getEntity() instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||||
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
ItemStack i = new ItemStack(Items.GUNPOWDER, random.nextInt(2));
|
ItemStack i = new ItemStack(Items.GUNPOWDER, random.nextInt(2));
|
||||||
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event
|
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, i));
|
||||||
.getEntity().posZ, i));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -18,12 +18,12 @@ public class TraitMelting extends AbstractTrait {
|
|||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void blockbreak(BlockEvent.BreakEvent e) {
|
public void blockbreak(BlockEvent.BreakEvent e) {
|
||||||
Block b = e.getWorld().getBlockState(e.getPos()).getBlock();
|
Block b = e.getWorld().getBlockState(e.getPos()).getBlock();
|
||||||
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(e.getPlayer().getHeldItemMainhand()), identifier)) {
|
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(e.getPlayer().getHeldItemMainhand()), identifier)) {
|
||||||
if (!e.getWorld().isRemote && random.nextFloat() <= 0.025 && (b == Blocks.STONE || b == Blocks
|
if (!e.getWorld().isRemote && random.nextFloat() <= 0.025 && (b == Blocks.STONE || b == Blocks.COBBLESTONE || b == Blocks.NETHERRACK || b == Blocks.OBSIDIAN)) {
|
||||||
.COBBLESTONE || b == Blocks.NETHERRACK || b == Blocks.OBSIDIAN)) {
|
|
||||||
e.setCanceled(true);
|
e.setCanceled(true);
|
||||||
e.getWorld().setBlockState(e.getPos(), Blocks.LAVA.getDefaultState());
|
e.getWorld().setBlockState(e.getPos(), Blocks.LAVA.getDefaultState());
|
||||||
}
|
}
|
||||||
|
@@ -1,42 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.traits;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.event.world.BlockEvent;
|
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static com.google.common.collect.Lists.newArrayList;
|
|
||||||
|
|
||||||
|
|
||||||
public class TraitMutate extends AbstractTrait {
|
|
||||||
|
|
||||||
public TraitMutate() {
|
|
||||||
super(TraitMutate.class.getSimpleName().toLowerCase().substring(5), TextFormatting.YELLOW);
|
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeBlockBreak(ItemStack tool, BlockEvent.BreakEvent event) {
|
|
||||||
if (!event.getWorld().isRemote && random.nextFloat() > 0.95) {
|
|
||||||
IBlockState state = event.getState();
|
|
||||||
List<Block> blist = newArrayList(Blocks.STONE, Blocks.COBBLESTONE, Blocks.DIRT, Blocks.SAND, Blocks
|
|
||||||
.GRASS, Blocks.CLAY, Blocks.NETHERRACK, Blocks.ICE, Blocks.SNOW, Blocks.BONE_BLOCK, Blocks.LAVA,
|
|
||||||
Blocks.WATER, Blocks.WHEAT);
|
|
||||||
if (blist.contains(state.getBlock())) {
|
|
||||||
Block newBlock = blist.get(random.nextInt(blist.size()));
|
|
||||||
IBlockState newState = newBlock.getDefaultState();
|
|
||||||
event.setCanceled(true);
|
|
||||||
event.getWorld().setBlockState(event.getPos(), newState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -1,6 +1,5 @@
|
|||||||
package com.sosnitzka.taiga.traits;
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
import com.sosnitzka.taiga.Keybindings;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
@@ -19,7 +18,6 @@ import slimeknights.tconstruct.library.utils.ToolHelper;
|
|||||||
|
|
||||||
|
|
||||||
public class TraitPorted extends AbstractTrait {
|
public class TraitPorted extends AbstractTrait {
|
||||||
|
|
||||||
public static int distance = 10;
|
public static int distance = 10;
|
||||||
|
|
||||||
public TraitPorted() {
|
public TraitPorted() {
|
||||||
@@ -30,22 +28,21 @@ public class TraitPorted extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemRightClick(PlayerInteractEvent.RightClickItem e) {
|
public void onItemRightClick(PlayerInteractEvent.RightClickItem e) {
|
||||||
ItemStack tool = e.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = e.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && Keybindings.altKey.isKeyDown())
|
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier))
|
||||||
teleport(e.getEntityPlayer(), e.getWorld());
|
teleport(e.getEntityPlayer(), e.getWorld());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
if (random.nextFloat() <= 0.005) {
|
if (random.nextFloat() <= 0.005) {
|
||||||
player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
teleport(player, world);
|
teleport(player, world);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||||
wasCritical, boolean wasHit) {
|
|
||||||
if (random.nextFloat() <= 0.005) {
|
if (random.nextFloat() <= 0.005) {
|
||||||
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
|
||||||
teleport(player, player.getEntityWorld());
|
teleport(player, player.getEntityWorld());
|
||||||
@@ -65,7 +62,6 @@ public class TraitPorted extends AbstractTrait {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e.setPosition(tPos.getX(), tPos.getY(), tPos.getZ());
|
e.setPosition(tPos.getX(), tPos.getY(), tPos.getZ());
|
||||||
ToolHelper.damageTool(e.getHeldItemMainhand(), ToolHelper.getCurrentDurability(e.getHeldItemMainhand()) / 2 +
|
ToolHelper.damageTool(e.getHeldItemMainhand(), ToolHelper.getCurrentDurability(e.getHeldItemMainhand()) / 2 + 1, e);
|
||||||
1, e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,13 @@ public abstract class TraitProgressiveStats extends AbstractTrait {
|
|||||||
applied_key = identifier + "StatBonus";
|
applied_key = identifier + "StatBonus";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TraitProgressiveStats(String identifier, int color) {
|
||||||
|
super(identifier, color);
|
||||||
|
|
||||||
|
pool_key = identifier + "StatPool";
|
||||||
|
applied_key = identifier + "StatBonus";
|
||||||
|
}
|
||||||
|
|
||||||
/* Modifier management */
|
/* Modifier management */
|
||||||
|
|
||||||
protected static StatNBT getStats(NBTTagCompound root, String key) {
|
protected static StatNBT getStats(NBTTagCompound root, String key) {
|
||||||
|
@@ -29,7 +29,7 @@ public class TraitPulverizing extends AbstractTrait {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
|
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
|
||||||
if (random.nextFloat() < 0.6) {
|
if (random.nextFloat() < 0.9) {
|
||||||
event.getDrops().clear();
|
event.getDrops().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,7 @@ import slimeknights.tconstruct.library.traits.AbstractTrait;
|
|||||||
|
|
||||||
public class TraitResonance extends AbstractTrait {
|
public class TraitResonance extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public static float chance = 0.33f;
|
public static float chance = 0.33f;
|
||||||
|
|
||||||
public TraitResonance() {
|
public TraitResonance() {
|
||||||
@@ -14,11 +15,9 @@ public class TraitResonance extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||||
wasCritical, boolean wasHit) {
|
|
||||||
if (random.nextFloat() <= chance) {
|
if (random.nextFloat() <= chance) {
|
||||||
target.knockBack(target, random.nextFloat() * random.nextFloat() * 10, player.posX - target.posX, player
|
target.knockBack(target, random.nextFloat() * random.nextFloat() * 10, player.posX - target.posX, player.posZ - target.posZ);
|
||||||
.posZ - target.posZ);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ package com.sosnitzka.taiga.traits;
|
|||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityCreature;
|
import net.minecraft.entity.EntityCreature;
|
||||||
import net.minecraft.entity.EntityList;
|
import net.minecraft.entity.EntityList;
|
||||||
|
import net.minecraft.entity.monster.EntitySkeleton;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.SoundEvents;
|
import net.minecraft.init.SoundEvents;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
@@ -18,6 +19,7 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
public class TraitReviving extends AbstractTrait {
|
public class TraitReviving extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public final float chance = 0.15f;
|
public final float chance = 0.15f;
|
||||||
|
|
||||||
public TraitReviving() {
|
public TraitReviving() {
|
||||||
@@ -29,16 +31,18 @@ public class TraitReviving extends AbstractTrait {
|
|||||||
public void onEntityKill(LivingDeathEvent e) {
|
public void onEntityKill(LivingDeathEvent e) {
|
||||||
BlockPos pos = e.getEntity().getPosition();
|
BlockPos pos = e.getEntity().getPosition();
|
||||||
World w = e.getEntity().getEntityWorld();
|
World w = e.getEntity().getEntityWorld();
|
||||||
if (!w.isRemote && e.getSource().getTrueSource() != null) {
|
if (!w.isRemote && e.getSource().getEntity() != null) {
|
||||||
if (e.getSource().getTrueSource() instanceof EntityPlayer && e.getEntity() instanceof EntityCreature) {
|
if (e.getSource().getEntity() instanceof EntityPlayer && e.getEntity() instanceof EntityCreature) {
|
||||||
if (random.nextFloat() <= chance && TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e
|
if (random.nextFloat() <= chance && TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand()), identifier)) {
|
||||||
.getSource().getTrueSource()).getHeldItemMainhand()), identifier)) {
|
String name = EntityList.getEntityString(e.getEntity());
|
||||||
int id = e.getEntity().getEntityId();
|
Entity ent = EntityList.createEntityByName(name, w);
|
||||||
Entity ent = EntityList.createEntityByID(id, w);
|
|
||||||
if (ent != null) {
|
if (ent != null) {
|
||||||
|
if (ent instanceof EntitySkeleton && e.getEntity() instanceof EntitySkeleton) {
|
||||||
|
((EntitySkeleton) ent).setSkeletonType(((EntitySkeleton) e.getEntity()).getSkeletonType());
|
||||||
|
}
|
||||||
ent.setPosition(pos.getX(), pos.getY(), pos.getZ());
|
ent.setPosition(pos.getX(), pos.getY(), pos.getZ());
|
||||||
w.spawnEntity(ent);
|
w.spawnEntityInWorld(ent);
|
||||||
e.getSource().getTrueSource().playSound(SoundEvents.AMBIENT_CAVE, 1.0F, 1.0F);
|
e.getSource().getEntity().playSound(SoundEvents.AMBIENT_CAVE, 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ package com.sosnitzka.taiga.traits;
|
|||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -20,18 +21,15 @@ public class TraitSlaughtering extends AbstractTrait {
|
|||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMobDrops(LivingDropsEvent event) {
|
public void onMobDrops(LivingDropsEvent event) {
|
||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
if (event.getSource().getTrueSource() instanceof EntityPlayer) {
|
if (event.getSource().getEntity() instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
|
||||||
if (!w.isRemote && event.getEntity() instanceof EntityLiving && !(event.getEntity() instanceof
|
if (!w.isRemote && event.getEntity() instanceof EntityLiving && !(event.getEntity() instanceof EntityPlayer) && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
EntityPlayer) && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()),
|
Item i = event.getDrops().get(random.nextInt(event.getDrops().size())).getEntityItem().getItem();
|
||||||
identifier)) {
|
event.getDrops().add(new EntityItem(event.getEntity().getEntityWorld(), event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, new ItemStack(i, random.nextInt(4) + 1)));
|
||||||
ItemStack i = event.getDrops().get(random.nextInt(event.getDrops().size())).getItem();
|
|
||||||
event.getDrops().add(new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event
|
|
||||||
.getEntity().posZ, new ItemStack(i.getItem(), random.nextInt(4) + 1, i.getMetadata(), i
|
|
||||||
.getTagCompound())));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,8 +12,6 @@ import net.minecraftforge.common.MinecraftForge;
|
|||||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
@@ -21,6 +19,8 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
public class TraitSoulEater extends AbstractTrait {
|
public class TraitSoulEater extends AbstractTrait {
|
||||||
|
|
||||||
|
private static float divisor = 25000f;
|
||||||
|
|
||||||
public TraitSoulEater() {
|
public TraitSoulEater() {
|
||||||
super(TraitSoulEater.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
super(TraitSoulEater.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
@@ -28,16 +28,15 @@ public class TraitSoulEater extends AbstractTrait {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onTargetKilled(LivingDeathEvent event) {
|
public void onTargetKilled(LivingDeathEvent event) {
|
||||||
if (event.getSource().getTrueSource() instanceof EntityPlayer && event.getEntity() instanceof EntityLiving) {
|
if (event.getSource().getEntity() instanceof EntityPlayer && event.getEntity() instanceof EntityLiving) {
|
||||||
World w = event.getSource().getTrueSource().world;
|
World w = event.getSource().getEntity().worldObj;
|
||||||
ItemStack tool = ((EntityPlayer) event.getSource().getTrueSource()).getHeldItemMainhand();
|
ItemStack tool = ((EntityPlayer) event.getSource().getEntity()).getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
float health = ((EntityLiving) event.getEntity()).getMaxHealth();
|
float health = ((EntityLiving) event.getEntity()).getMaxHealth();
|
||||||
data.killcount += 1;
|
data.killcount += 1;
|
||||||
data.health = health;
|
data.health = health;
|
||||||
float divisor = 25000f;
|
|
||||||
float bonus = Math.round(random.nextFloat() * health * 100) / divisor;
|
float bonus = Math.round(random.nextFloat() * health * 100) / divisor;
|
||||||
data.bonus += bonus;
|
data.bonus += bonus;
|
||||||
data.bonus = (float) Math.round(data.bonus * 100f) / 100f;
|
data.bonus = (float) Math.round(data.bonus * 100f) / 100f;
|
||||||
@@ -48,15 +47,13 @@ public class TraitSoulEater extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
newDamage, boolean isCritical) {
|
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
float bonus = data.bonus;
|
float bonus = data.bonus;
|
||||||
return newDamage + bonus;
|
return newDamage + bonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemTooltip(ItemTooltipEvent e) {
|
public void onItemTooltip(ItemTooltipEvent e) {
|
||||||
ItemStack tool = e.getItemStack();
|
ItemStack tool = e.getItemStack();
|
||||||
@@ -69,4 +66,5 @@ public class TraitSoulEater extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -13,8 +13,6 @@ import net.minecraftforge.common.MinecraftForge;
|
|||||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
|
|
||||||
@@ -22,7 +20,7 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
public class TraitSuperHeavy extends TraitProgressiveStats {
|
public class TraitSuperHeavy extends TraitProgressiveStats {
|
||||||
|
|
||||||
protected static int TICK_PER_STAT = 50;
|
protected static int TICK_PER_STAT = 50;
|
||||||
protected static float blockcount = 500f;
|
protected static float blockcount = 250f;
|
||||||
|
|
||||||
public TraitSuperHeavy() {
|
public TraitSuperHeavy() {
|
||||||
super(TraitSuperHeavy.class.getSimpleName().toLowerCase().substring(5), TextFormatting.DARK_GRAY);
|
super(TraitSuperHeavy.class.getSimpleName().toLowerCase().substring(5), TextFormatting.DARK_GRAY);
|
||||||
@@ -35,13 +33,11 @@ public class TraitSuperHeavy extends TraitProgressiveStats {
|
|||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
if (data.brokenblocks == 0) return;
|
if (data.brokenblocks == 0) return;
|
||||||
event.setNewSpeed(Math.max(event.getNewSpeed() - data.brokenblocks * event.getOriginalSpeed() / blockcount,
|
event.setNewSpeed(Math.max(event.getNewSpeed() - data.brokenblocks * event.getOriginalSpeed() / blockcount, 0.25f));
|
||||||
0.35f));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
data.brokenblocks += 1;
|
data.brokenblocks += 1;
|
||||||
@@ -69,7 +65,6 @@ public class TraitSuperHeavy extends TraitProgressiveStats {
|
|||||||
TagUtil.setExtraTag(tool, tag);
|
TagUtil.setExtraTag(tool, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemTooltip(ItemTooltipEvent e) {
|
public void onItemTooltip(ItemTooltipEvent e) {
|
||||||
ItemStack tool = e.getItemStack();
|
ItemStack tool = e.getItemStack();
|
||||||
@@ -80,4 +75,6 @@ public class TraitSuperHeavy extends TraitProgressiveStats {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package com.sosnitzka.taiga.traits;
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
import com.sosnitzka.taiga.Keybindings;
|
|
||||||
import com.sosnitzka.taiga.util.Utils;
|
import com.sosnitzka.taiga.util.Utils;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -13,8 +12,6 @@ import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
|||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.event.world.BlockEvent;
|
import net.minecraftforge.event.world.BlockEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.tconstruct.common.Sounds;
|
import slimeknights.tconstruct.common.Sounds;
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
@@ -22,11 +19,12 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
import static com.sosnitzka.taiga.Blocks.tiberiumOre;
|
import static com.sosnitzka.taiga.Blocks.tiberiumOre;
|
||||||
|
|
||||||
/*
|
|
||||||
* Collects tiberium, to release it for an explosion
|
|
||||||
*/
|
|
||||||
public class TraitTantrum extends AbstractTrait {
|
public class TraitTantrum extends AbstractTrait {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Collects tiberium, to release it for an explosion
|
||||||
|
*/
|
||||||
|
|
||||||
public static float max_charges = 12f;
|
public static float max_charges = 12f;
|
||||||
public static float max_power = 5;
|
public static float max_power = 5;
|
||||||
|
|
||||||
@@ -50,8 +48,7 @@ public class TraitTantrum extends AbstractTrait {
|
|||||||
if (data.amount >= max_charges) {
|
if (data.amount >= max_charges) {
|
||||||
TagUtil.setEnchantEffect(tool, true);
|
TagUtil.setEnchantEffect(tool, true);
|
||||||
if (event.getHarvester() instanceof EntityPlayerMP) {
|
if (event.getHarvester() instanceof EntityPlayerMP) {
|
||||||
Sounds.PlaySoundForPlayer(event.getHarvester(), Sounds.shocking_discharge, 1f, 0.8f + .2f *
|
Sounds.PlaySoundForPlayer(event.getHarvester(), Sounds.shocking_discharge, 1f, 0.8f + .2f * random.nextFloat());
|
||||||
random.nextFloat());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
@@ -61,17 +58,16 @@ public class TraitTantrum extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void rightClickItem(PlayerInteractEvent.RightClickItem event) {
|
public void RightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||||
World w = event.getWorld();
|
World w = event.getWorld();
|
||||||
BlockPos pos = event.getPos();
|
BlockPos pos = event.getPos();
|
||||||
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && Keybindings.altKey.isKeyDown()) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Data data = Data.read(tag);
|
Data data = Data.read(tag);
|
||||||
if (data.amount > 1f) {
|
if (data.amount > 1f) {
|
||||||
double d = Math.min(Utils.round2(random.nextDouble() * data.amount), max_power);
|
double d = Math.min(Utils.round2(random.nextDouble() * data.amount), max_power);
|
||||||
w.newExplosion(event.getEntityPlayer(), pos.getX(), pos.getY(), pos.getZ(), (float) Math.pow((double)
|
w.newExplosion(event.getEntityPlayer(), pos.getX(), pos.getY(), pos.getZ(), (float) Math.pow((double) 1.2f, d), false, true);
|
||||||
1.2f, d), false, true);
|
|
||||||
data.amount -= d;
|
data.amount -= d;
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
TagUtil.setExtraTag(tool, tag);
|
TagUtil.setExtraTag(tool, tag);
|
||||||
@@ -80,7 +76,6 @@ public class TraitTantrum extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemTooltip(ItemTooltipEvent e) {
|
public void onItemTooltip(ItemTooltipEvent e) {
|
||||||
ItemStack tool = e.getItemStack();
|
ItemStack tool = e.getItemStack();
|
||||||
@@ -92,6 +87,7 @@ public class TraitTantrum extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class Data {
|
public static class Data {
|
||||||
|
|
||||||
float amount;
|
float amount;
|
||||||
|
|
||||||
public static Data read(NBTTagCompound tag) {
|
public static Data read(NBTTagCompound tag) {
|
||||||
@@ -104,4 +100,6 @@ public class TraitTantrum extends AbstractTrait {
|
|||||||
tag.setFloat("amount", amount);
|
tag.setFloat("amount", amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
17
src/main/java/com/sosnitzka/taiga/traits/TraitTemplate.java
Normal file
17
src/main/java/com/sosnitzka/taiga/traits/TraitTemplate.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
|
|
||||||
|
public class TraitTemplate extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
|
public TraitTemplate() {
|
||||||
|
super(TraitTemplate.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,49 @@
|
|||||||
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityCreature;
|
||||||
|
import net.minecraft.entity.EntityList;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||||
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
|
|
||||||
|
|
||||||
|
public class TraitTraditional extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
|
public TraitTraditional() {
|
||||||
|
super("traditional", 0xff33ff);
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onEntityKill(LivingDeathEvent e) {
|
||||||
|
World w = e.getEntity().getEntityWorld();
|
||||||
|
if (!w.isRemote && e.getSource().getEntity() instanceof EntityPlayer && e.getEntity() instanceof EntityCreature) {
|
||||||
|
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand()), identifier)) {
|
||||||
|
String name = EntityList.getEntityString(e.getEntity());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Data {
|
||||||
|
|
||||||
|
String mobname;
|
||||||
|
|
||||||
|
public static Data read(NBTTagCompound tag) {
|
||||||
|
Data data = new Data();
|
||||||
|
data.mobname = tag.getString("mob");
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void write(NBTTagCompound tag) {
|
||||||
|
tag.setString("amount", mobname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
15
src/main/java/com/sosnitzka/taiga/traits/TraitUncertain.java
Normal file
15
src/main/java/com/sosnitzka/taiga/traits/TraitUncertain.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
|
|
||||||
|
public class TraitUncertain extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
|
public TraitUncertain() {
|
||||||
|
super(TraitUncertain.class.getName().toLowerCase().substring(4), TextFormatting.RED);
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
}
|
17
src/main/java/com/sosnitzka/taiga/traits/TraitVortex.java
Normal file
17
src/main/java/com/sosnitzka/taiga/traits/TraitVortex.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
|
|
||||||
|
|
||||||
|
public class TraitVortex extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
|
public TraitVortex() {
|
||||||
|
super(TraitVortex.class.getSimpleName().toLowerCase().substring(5), TextFormatting.DARK_PURPLE);
|
||||||
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -1,6 +1,5 @@
|
|||||||
package com.sosnitzka.taiga.traits;
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
import com.sosnitzka.taiga.Keybindings;
|
|
||||||
import com.sosnitzka.taiga.util.Utils;
|
import com.sosnitzka.taiga.util.Utils;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
@@ -15,8 +14,6 @@ import net.minecraftforge.common.util.FakePlayer;
|
|||||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||||
import slimeknights.tconstruct.library.utils.TagUtil;
|
import slimeknights.tconstruct.library.utils.TagUtil;
|
||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
@@ -34,7 +31,11 @@ public class TraitWhirl extends AbstractTrait {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
if (entity instanceof FakePlayer || entity.world.isRemote || entity.ticksExisted % TICK_PER_STAT != 0) {
|
|
||||||
|
if (entity instanceof FakePlayer || entity.worldObj.isRemote) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ public class TraitWhirl extends AbstractTrait {
|
|||||||
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||||
World w = event.getWorld();
|
World w = event.getWorld();
|
||||||
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && Keybindings.altKey.isKeyDown()) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
if ((int) data.radius >= 1) {
|
if ((int) data.radius >= 1) {
|
||||||
@@ -60,14 +61,11 @@ public class TraitWhirl extends AbstractTrait {
|
|||||||
for (int x = -r; x <= r; x++) {
|
for (int x = -r; x <= r; x++) {
|
||||||
for (int y = -r; y <= r; y++) {
|
for (int y = -r; y <= r; y++) {
|
||||||
for (int z = -r; z <= r; z++) {
|
for (int z = -r; z <= r; z++) {
|
||||||
if (MathHelper.sqrt(x * x + y * y + z * z) > r) {
|
if (MathHelper.sqrt_double(x * x + y * y + z * z) > r) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
BlockPos nPos = new BlockPos(event.getPos().getX() + x, event.getPos().getY() + y, event
|
BlockPos nPos = new BlockPos(event.getPos().getX() + x, event.getPos().getY() + y, event.getPos().getZ() + z);
|
||||||
.getPos().getZ() + z);
|
if (!(event.getWorld().getBlockState(nPos).equals(Blocks.WATER.getDefaultState()) || event.getWorld().getBlockState(nPos).equals(Blocks.FLOWING_WATER.getDefaultState())))
|
||||||
if (!(event.getWorld().getBlockState(nPos).equals(Blocks.WATER.getDefaultState()) ||
|
|
||||||
event.getWorld().getBlockState(nPos).equals(Blocks.FLOWING_WATER.getDefaultState
|
|
||||||
())))
|
|
||||||
continue;
|
continue;
|
||||||
event.getWorld().destroyBlock(nPos, false);
|
event.getWorld().destroyBlock(nPos, false);
|
||||||
}
|
}
|
||||||
@@ -79,10 +77,11 @@ public class TraitWhirl extends AbstractTrait {
|
|||||||
TagUtil.setEnchantEffect(tool, false);
|
TagUtil.setEnchantEffect(tool, false);
|
||||||
ToolHelper.damageTool(tool, 2 * r, event.getEntityPlayer());
|
ToolHelper.damageTool(tool, 2 * r, event.getEntityPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemTooltip(ItemTooltipEvent e) {
|
public void onItemTooltip(ItemTooltipEvent e) {
|
||||||
ItemStack tool = e.getItemStack();
|
ItemStack tool = e.getItemStack();
|
||||||
@@ -90,9 +89,9 @@ public class TraitWhirl extends AbstractTrait {
|
|||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
if (data.radius > 0) {
|
if (data.radius > 0) {
|
||||||
e.getToolTip().add(TextFormatting.BLUE + "Actual Radius: " + TextFormatting.WHITE + Math.round(data
|
e.getToolTip().add(TextFormatting.BLUE + "Actual Radius: " + TextFormatting.WHITE + Math.round(data.radius * 100) / 100);
|
||||||
.radius * 100) / 100);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,99 @@
|
|||||||
|
package com.sosnitzka.taiga.util;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityCreature;
|
||||||
|
import net.minecraft.entity.ai.EntityAIBase;
|
||||||
|
import net.minecraft.entity.ai.RandomPositionGenerator;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class EntityAIPermanentPanic extends EntityAIBase {
|
||||||
|
private EntityCreature theEntityCreature;
|
||||||
|
private double speed;
|
||||||
|
private double randPosX;
|
||||||
|
private double randPosY;
|
||||||
|
private double randPosZ;
|
||||||
|
|
||||||
|
public EntityAIPermanentPanic(EntityCreature creature, double speedIn) {
|
||||||
|
this.theEntityCreature = creature;
|
||||||
|
this.speed = speedIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the EntityAIBase should begin execution.
|
||||||
|
*/
|
||||||
|
public boolean shouldExecute() {
|
||||||
|
|
||||||
|
Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4);
|
||||||
|
|
||||||
|
if (vec3d == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
this.randPosX = vec3d.xCoord;
|
||||||
|
this.randPosY = vec3d.yCoord;
|
||||||
|
this.randPosZ = vec3d.zCoord;
|
||||||
|
|
||||||
|
if (this.theEntityCreature.isBurning()) {
|
||||||
|
BlockPos blockpos = this.getRandPos(this.theEntityCreature.worldObj, this.theEntityCreature, 5, 4);
|
||||||
|
|
||||||
|
if (blockpos != null) {
|
||||||
|
this.randPosX = (double) blockpos.getX();
|
||||||
|
this.randPosY = (double) blockpos.getY();
|
||||||
|
this.randPosZ = (double) blockpos.getZ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute a one shot task or start executing a continuous task
|
||||||
|
*/
|
||||||
|
public void startExecuting() {
|
||||||
|
this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether an in-progress EntityAIBase should continue executing
|
||||||
|
*/
|
||||||
|
public boolean continueExecuting() {
|
||||||
|
return !this.theEntityCreature.getNavigator().noPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
private BlockPos getRandPos(World worldIn, Entity entityIn, int horizontalRange, int verticalRange) {
|
||||||
|
BlockPos blockpos = new BlockPos(entityIn);
|
||||||
|
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
|
||||||
|
int i = blockpos.getX();
|
||||||
|
int j = blockpos.getY();
|
||||||
|
int k = blockpos.getZ();
|
||||||
|
float f = (float) (horizontalRange * horizontalRange * verticalRange * 2);
|
||||||
|
BlockPos blockpos1 = null;
|
||||||
|
|
||||||
|
for (int l = i - horizontalRange; l <= i + horizontalRange; ++l) {
|
||||||
|
for (int i1 = j - verticalRange; i1 <= j + verticalRange; ++i1) {
|
||||||
|
for (int j1 = k - horizontalRange; j1 <= k + horizontalRange; ++j1) {
|
||||||
|
blockpos$mutableblockpos.setPos(l, i1, j1);
|
||||||
|
IBlockState iblockstate = worldIn.getBlockState(blockpos$mutableblockpos);
|
||||||
|
Block block = iblockstate.getBlock();
|
||||||
|
|
||||||
|
if (block == Blocks.WATER || block == Blocks.FLOWING_WATER) {
|
||||||
|
float f1 = (float) ((l - i) * (l - i) + (i1 - j) * (i1 - j) + (j1 - k) * (j1 - k));
|
||||||
|
|
||||||
|
if (f1 < f) {
|
||||||
|
f = f1;
|
||||||
|
blockpos1 = new BlockPos(blockpos$mutableblockpos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return blockpos1;
|
||||||
|
}
|
||||||
|
}
|
@@ -25,22 +25,15 @@ import static com.sosnitzka.taiga.util.Utils.nextInt;
|
|||||||
|
|
||||||
public class Generator {
|
public class Generator {
|
||||||
|
|
||||||
public static void generateOre(IBlockState newState, IBlockState oldState, Random random, int chunkX, int chunkZ,
|
public static void generateOre(IBlockState newState, IBlockState oldState, Random random, int chunkX, int chunkZ, World world, int count, int minY, int maxY, int minSize, int maxSize) {
|
||||||
World world, int count, int minY, int maxY, int minSize, int maxSize) {
|
generateOre(newState, oldState, null, null, random, chunkX, chunkZ, world, count, 100, minY, maxY, minSize, maxSize, null);
|
||||||
generateOre(newState, oldState, null, null, random, chunkX, chunkZ, world, count, 100, minY, maxY, minSize,
|
|
||||||
maxSize, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateOre(IBlockState newState, IBlockState oldState, Random random, int chunkX, int chunkZ,
|
public static void generateOre(IBlockState newState, IBlockState oldState, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY, int minSize, int maxSize, List<Biome> biome) {
|
||||||
World world, int count, int chance, int minY, int maxY, int minSize, int maxSize,
|
generateOre(newState, oldState, null, null, random, chunkX, chunkZ, world, count, chance, minY, maxY, minSize, maxSize, biome);
|
||||||
List<Biome> biome) {
|
|
||||||
generateOre(newState, oldState, null, null, random, chunkX, chunkZ, world, count, chance, minY, maxY,
|
|
||||||
minSize, maxSize, biome);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateOre(IBlockState newState, IBlockState oldState, IProperty property, Comparable
|
public static void generateOre(IBlockState newState, IBlockState oldState, IProperty property, Comparable comparable, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY, int minSize, int maxSize, List<Biome> biome) {
|
||||||
comparable, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int
|
|
||||||
maxY, int minSize, int maxSize, List<Biome> biome) {
|
|
||||||
int size = minSize + random.nextInt(maxSize - minSize);
|
int size = minSize + random.nextInt(maxSize - minSize);
|
||||||
int height = maxY - minY;
|
int height = maxY - minY;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
@@ -50,31 +43,28 @@ public class Generator {
|
|||||||
int posZ = chunkZ + random.nextInt(16);
|
int posZ = chunkZ + random.nextInt(16);
|
||||||
BlockPos cPos = new BlockPos(posX, posY, posZ);
|
BlockPos cPos = new BlockPos(posX, posY, posZ);
|
||||||
if (biome == null || biome.contains(world.getBiome(cPos))) {
|
if (biome == null || biome.contains(world.getBiome(cPos))) {
|
||||||
new WorldGenMinable(newState, size, StateMatcher.forState(oldState, property, comparable))
|
new WorldGenMinable(newState, size, StateMatcher.forState(oldState, property, comparable)).generate(world, random, new BlockPos(posX, posY, posZ));
|
||||||
.generate(world, random, new BlockPos(posX, posY, posZ));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateOre(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random random,
|
public static void generateOre(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random random, int chunkX, int chunkZ, World world, int count, int minY, int maxY, int chance) {
|
||||||
int chunkX, int chunkZ, World world, int count, int minY, int maxY, int chance) {
|
|
||||||
if (random.nextFloat() < (float) (0.01 * chance))
|
if (random.nextFloat() < (float) (0.01 * chance))
|
||||||
generateOreDescending(replaceBlockList, replacementBlock, random, chunkX, chunkZ, world, count, minY, maxY);
|
generateOreDescending(replaceBlockList, replacementBlock, random, chunkX, chunkZ, world, count, minY, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateOreDescending(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random
|
|
||||||
random, int chunkX, int chunkZ, World world, int count, int minY, int maxY) {
|
public static void generateOreDescending(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random random, int chunkX, int chunkZ, World world, int count, int minY, int maxY) {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int posX = chunkX + random.nextInt(16);
|
int posX = chunkX + random.nextInt(16);
|
||||||
int posZ = chunkZ + random.nextInt(16);
|
int posZ = chunkZ + random.nextInt(16);
|
||||||
BlockPos cPos = new BlockPos(posX, maxY, posZ);
|
BlockPos cPos = new BlockPos(posX, maxY, posZ);
|
||||||
if (replaceBlockList.contains(world.getBlockState(cPos)) && replaceBlockList.contains(world.getBlockState
|
if (replaceBlockList.contains(world.getBlockState(cPos)) && replaceBlockList.contains(world.getBlockState(cPos.up()))) {
|
||||||
(cPos.up()))) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (replaceBlockList.contains(world.getBlockState(cPos)) && !replaceBlockList.contains(world
|
if (replaceBlockList.contains(world.getBlockState(cPos)) && !replaceBlockList.contains(world.getBlockState(cPos.up())))
|
||||||
.getBlockState(cPos.up())))
|
|
||||||
world.setBlockState(cPos, replacementBlock);
|
world.setBlockState(cPos, replacementBlock);
|
||||||
while (!replaceBlockList.contains(world.getBlockState(cPos.down())) && cPos.getY() > minY) {
|
while (!replaceBlockList.contains(world.getBlockState(cPos.down())) && cPos.getY() > minY) {
|
||||||
cPos = cPos.down();
|
cPos = cPos.down();
|
||||||
@@ -84,8 +74,7 @@ public class Generator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateOreStoneVariant(IBlockState newState, BlockStone.EnumType type, Random random, int
|
public static void generateOreStoneVariant(IBlockState newState, BlockStone.EnumType type, Random random, int chunkX, int chunkZ, World world, int count) {
|
||||||
chunkX, int chunkZ, World world, int count) {
|
|
||||||
List<BlockStone.EnumType> list = newArrayList(type);
|
List<BlockStone.EnumType> list = newArrayList(type);
|
||||||
for (int i = 0; i < count; i += 2) {
|
for (int i = 0; i < count; i += 2) {
|
||||||
int posX = chunkX + random.nextInt(16);
|
int posX = chunkX + random.nextInt(16);
|
||||||
@@ -129,8 +118,7 @@ public class Generator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateOreBottom(IBlockState oldState, IBlockState newState, Random random, int chunkX, int
|
public static void generateOreBottom(IBlockState oldState, IBlockState newState, Random random, int chunkX, int chunkZ, World world, int chance, int spread, int maxY) {
|
||||||
chunkZ, World world, int chance, int spread, int maxY) {
|
|
||||||
for (int i = 0; i < chance; i++) {
|
for (int i = 0; i < chance; i++) {
|
||||||
int posX = chunkX + random.nextInt(16);
|
int posX = chunkX + random.nextInt(16);
|
||||||
int posY = 0;
|
int posY = 0;
|
||||||
@@ -147,8 +135,7 @@ public class Generator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateCube(boolean fly, IBlockState centerBlock, IBlockState hullBlock, Random random, int
|
public static void generateCube(boolean fly, IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY, int maxS) {
|
||||||
chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY, int maxS) {
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
if (random.nextFloat() < 0.01 * chance) {
|
if (random.nextFloat() < 0.01 * chance) {
|
||||||
int outer = nextInt(random, 1, maxS);
|
int outer = nextInt(random, 1, maxS);
|
||||||
@@ -158,8 +145,7 @@ public class Generator {
|
|||||||
int posZ = chunkZ + random.nextInt(16);
|
int posZ = chunkZ + random.nextInt(16);
|
||||||
BlockPos cPos = new BlockPos(posX, posY, posZ);
|
BlockPos cPos = new BlockPos(posX, posY, posZ);
|
||||||
if (!fly) {
|
if (!fly) {
|
||||||
if (world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()) && world.getBlockState(cPos
|
if (world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()) && world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
|
||||||
.down()).equals(Blocks.AIR.getDefaultState())) {
|
|
||||||
// we are in mid air, go down
|
// we are in mid air, go down
|
||||||
while (world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
|
while (world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
|
||||||
cPos = cPos.down();
|
cPos = cPos.down();
|
||||||
@@ -172,8 +158,7 @@ public class Generator {
|
|||||||
for (int z = -inner; z <= inner; z++) {
|
for (int z = -inner; z <= inner; z++) {
|
||||||
if (!world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()))
|
if (!world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()))
|
||||||
continue;
|
continue;
|
||||||
world.setBlockState(new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z),
|
world.setBlockState(new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z), centerBlock);
|
||||||
centerBlock);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,8 +166,7 @@ public class Generator {
|
|||||||
for (int y = -outer; y <= outer; y++) {
|
for (int y = -outer; y <= outer; y++) {
|
||||||
for (int z = -outer; z <= outer; z++) {
|
for (int z = -outer; z <= outer; z++) {
|
||||||
BlockPos nPos = new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z);
|
BlockPos nPos = new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z);
|
||||||
if (world.getBlockState(nPos).equals(centerBlock) || !world.getBlockState(nPos).equals
|
if (world.getBlockState(nPos).equals(centerBlock) || !world.getBlockState(nPos).equals(Blocks.AIR.getDefaultState()))
|
||||||
(Blocks.AIR.getDefaultState()))
|
|
||||||
continue;
|
continue;
|
||||||
world.setBlockState(nPos, hullBlock);
|
world.setBlockState(nPos, hullBlock);
|
||||||
}
|
}
|
||||||
@@ -193,19 +177,16 @@ public class Generator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int generateMeteor(IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int
|
|
||||||
chunkZ, World world, int count, int chance, int minY, int maxY) {
|
public static void generateMeteor(IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY) {
|
||||||
Set<Item> validSurface = new HashSet<Item>();
|
Set<Item> validSurface = new HashSet<Item>();
|
||||||
List<String> oredictentries = Lists.newArrayList("dirt", "grass", "stone", "sand", "gravel", "cobblestone",
|
List<String> oredictentries = Lists.newArrayList("dirt", "grass", "stone", "sand", "gravel", "cobblestone", "sandstone");
|
||||||
"sandstone");
|
|
||||||
for (String e : oredictentries) {
|
for (String e : oredictentries) {
|
||||||
for (ItemStack stack : OreDictionary.getOres(e)) {
|
for (ItemStack stack : OreDictionary.getOres(e)) {
|
||||||
validSurface.add(stack.getItem());
|
validSurface.add(stack.getItem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int mGenerated = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
if (random.nextFloat() < 0.01 * chance) {
|
if (random.nextFloat() < 0.01 * chance) {
|
||||||
int r = nextInt(random, 1, 5);
|
int r = nextInt(random, 1, 5);
|
||||||
@@ -213,13 +194,13 @@ public class Generator {
|
|||||||
int posY = nextInt(random, minY, maxY);
|
int posY = nextInt(random, minY, maxY);
|
||||||
int posZ = chunkZ + random.nextInt(16);
|
int posZ = chunkZ + random.nextInt(16);
|
||||||
BlockPos cPos = new BlockPos(posX, posY, posZ);
|
BlockPos cPos = new BlockPos(posX, posY, posZ);
|
||||||
if (world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()) && world.getBlockState(cPos.down()
|
if (world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()) && world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
|
||||||
).equals(Blocks.AIR.getDefaultState())) {
|
|
||||||
// we are in mid air, go down
|
// we are in mid air, go down
|
||||||
while (world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
|
while (world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
|
||||||
cPos = cPos.down();
|
cPos = cPos.down();
|
||||||
|
|
||||||
if (cPos.getY() < minY)
|
// if we are below 0, we might be in a void dim
|
||||||
|
if (cPos.getY() < 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,25 +212,22 @@ public class Generator {
|
|||||||
saveData.addPos(cPos);
|
saveData.addPos(cPos);
|
||||||
saveData.markDirty();
|
saveData.markDirty();
|
||||||
|
|
||||||
mGenerated++;
|
|
||||||
|
|
||||||
int t = 1;
|
int t = 1;
|
||||||
if (r > 3) t = random.nextInt(r - 1);
|
if (r > 3) t = random.nextInt(r - 1);
|
||||||
for (int x = -t; x <= t; x++) {
|
for (int x = -t; x <= t; x++) {
|
||||||
for (int y = -t; y <= t; y++) {
|
for (int y = -t; y <= t; y++) {
|
||||||
for (int z = -t; z <= t; z++) {
|
for (int z = -t; z <= t; z++) {
|
||||||
if (MathHelper.sqrt(x * x + y * y + z * z) > t) {
|
if (MathHelper.sqrt_double(x * x + y * y + z * z) > t) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
world.setBlockState(new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z),
|
world.setBlockState(new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z), centerBlock);
|
||||||
centerBlock);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int x = -r; x <= r; x++) {
|
for (int x = -r; x <= r; x++) {
|
||||||
for (int y = -r; y <= r; y++) {
|
for (int y = -r; y <= r; y++) {
|
||||||
for (int z = -r; z <= r; z++) {
|
for (int z = -r; z <= r; z++) {
|
||||||
if (MathHelper.sqrt(x * x + y * y + z * z) > r) {
|
if (MathHelper.sqrt_double(x * x + y * y + z * z) > r) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
BlockPos nPos = new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z);
|
BlockPos nPos = new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z);
|
||||||
@@ -261,7 +239,5 @@ public class Generator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mGenerated;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,9 +26,10 @@ public class StateMatcher implements Predicate<IBlockState> {
|
|||||||
if (state != null) {
|
if (state != null) {
|
||||||
if (property != null && value != null) {
|
if (property != null && value != null) {
|
||||||
if (state.getBlock() == this.state.getBlock())
|
if (state.getBlock() == this.state.getBlock())
|
||||||
return checkLayerForBlocks(3, 3, -1, world, pos) ||
|
if (checkLayerForBlocks(3, 3, -1, world, pos) ||
|
||||||
checkLayerForBlocks(3, 3, 0, world, pos) ||
|
checkLayerForBlocks(3, 3, 0, world, pos) ||
|
||||||
checkLayerForBlocks(3, 3, 1, world, pos);
|
checkLayerForBlocks(3, 3, 1, world, pos))
|
||||||
|
return true;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
return state.getBlock() == this.state.getBlock();
|
return state.getBlock() == this.state.getBlock();
|
||||||
|
@@ -3,11 +3,14 @@ package com.sosnitzka.taiga.util;
|
|||||||
|
|
||||||
import com.sosnitzka.taiga.Items;
|
import com.sosnitzka.taiga.Items;
|
||||||
import com.sosnitzka.taiga.TAIGA;
|
import com.sosnitzka.taiga.TAIGA;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import slimeknights.tconstruct.library.MaterialIntegration;
|
import slimeknights.tconstruct.library.MaterialIntegration;
|
||||||
import slimeknights.tconstruct.library.TinkerRegistry;
|
import slimeknights.tconstruct.library.TinkerRegistry;
|
||||||
@@ -25,7 +28,16 @@ public class Utils {
|
|||||||
public static String PREFIX_ORE = "ore";
|
public static String PREFIX_ORE = "ore";
|
||||||
public static String PREFIX_BLOCK = "block";
|
public static String PREFIX_BLOCK = "block";
|
||||||
public static String PREFIX_DUST = "dust";
|
public static String PREFIX_DUST = "dust";
|
||||||
public static String PREFIX_CRYSTAL = "crystal";
|
|
||||||
|
/**
|
||||||
|
* Registers the block and its corresponding item (block as item in inventory)
|
||||||
|
*
|
||||||
|
* @param block the associated block
|
||||||
|
*/
|
||||||
|
public static void registerBlockWithItem(Block block) {
|
||||||
|
GameRegistry.register(block);
|
||||||
|
GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers the fluid and its bucket item
|
* Registers the fluid and its bucket item
|
||||||
@@ -52,11 +64,8 @@ public class Utils {
|
|||||||
return (Math.round(d * 100.0) / 100.0);
|
return (Math.round(d * 100.0) / 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void integrateMaterial(String oreSuffix, @Nullable Material material, Fluid fluid, int headDura,
|
public static void integrateMaterial(String oreSuffix, @Nullable Material material, Fluid fluid, int headDura, float headSpeed, float headAttack, float handleMod, int handleDura, int extra, int headLevel, float draw, float range, int bdamage) {
|
||||||
float headSpeed, float headAttack, float handleMod, int handleDura, int
|
integrateMaterial(oreSuffix, material, fluid, headDura, headSpeed, headAttack, handleMod, handleDura, extra, headLevel, new BowMaterialStats(draw, range, bdamage), false, true);
|
||||||
extra, int headLevel, float draw, float range, int bdamage) {
|
|
||||||
integrateMaterial(oreSuffix, material, fluid, headDura, headSpeed, headAttack, handleMod, handleDura, extra,
|
|
||||||
headLevel, new BowMaterialStats(draw, range, bdamage), false, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void integrateMaterial(String oreSuffix, @Nullable Material material, Fluid fluid, int headDura, float headSpeed, float headAttack, float handleMod, int handleDura, int extra, int headLevel, BowMaterialStats bowstats) {
|
public static void integrateMaterial(String oreSuffix, @Nullable Material material, Fluid fluid, int headDura, float headSpeed, float headAttack, float handleMod, int handleDura, int extra, int headLevel, BowMaterialStats bowstats) {
|
||||||
@@ -68,8 +77,7 @@ public class Utils {
|
|||||||
if (TinkerRegistry.getMaterial(material.identifier) != Material.UNKNOWN)
|
if (TinkerRegistry.getMaterial(material.identifier) != Material.UNKNOWN)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TinkerRegistry.addMaterialStats(material, new HeadMaterialStats(headDura, headSpeed, headAttack,
|
TinkerRegistry.addMaterialStats(material, new HeadMaterialStats(headDura, headSpeed, headAttack, headLevel));
|
||||||
headLevel));
|
|
||||||
TinkerRegistry.addMaterialStats(material, new HandleMaterialStats(handleMod, handleDura));
|
TinkerRegistry.addMaterialStats(material, new HandleMaterialStats(handleMod, handleDura));
|
||||||
TinkerRegistry.addMaterialStats(material, new ExtraMaterialStats(extra));
|
TinkerRegistry.addMaterialStats(material, new ExtraMaterialStats(extra));
|
||||||
TinkerRegistry.addMaterialStats(material, bowstats);
|
TinkerRegistry.addMaterialStats(material, bowstats);
|
||||||
@@ -94,13 +102,12 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MaterialIntegration integration = new MaterialIntegration(material, fluid, oreSuffix);
|
MaterialIntegration integration = new MaterialIntegration(material, fluid, oreSuffix);
|
||||||
integration.preInit();
|
integration.integrate();
|
||||||
TAIGA.integrateList.add(integration);
|
TAIGA.integrateList.add(integration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void integrateOre(String oreSuffix, Fluid fluid) {
|
public static void integrateOre(String oreSuffix, Fluid fluid) {
|
||||||
integrateMaterial(oreSuffix, null, fluid, -1, -1, -1, -1, -1, -1, -1, new BowMaterialStats(0.1f, 0.1f, -1f),
|
integrateMaterial(oreSuffix, null, fluid, -1, -1, -1, -1, -1, -1, -1, new BowMaterialStats(0.1f, 0.1f, -1f), true, true);
|
||||||
true, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int nextInt(Random random, int min, int max) {
|
public static int nextInt(Random random, int min, int max) {
|
||||||
|
@@ -5,8 +5,8 @@ import com.google.gson.Gson;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.WorldSavedData;
|
||||||
import net.minecraft.world.storage.MapStorage;
|
import net.minecraft.world.storage.MapStorage;
|
||||||
import net.minecraft.world.storage.WorldSavedData;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -28,8 +28,7 @@ public class MeteorWorldSaveData extends WorldSavedData {
|
|||||||
|
|
||||||
public static MeteorWorldSaveData getForWorld(World world) {
|
public static MeteorWorldSaveData getForWorld(World world) {
|
||||||
MapStorage storage = world.getPerWorldStorage();
|
MapStorage storage = world.getPerWorldStorage();
|
||||||
MeteorWorldSaveData instance = (MeteorWorldSaveData) storage.getOrLoadData(MeteorWorldSaveData.class,
|
MeteorWorldSaveData instance = (MeteorWorldSaveData) storage.getOrLoadData(MeteorWorldSaveData.class, DATA_NAME);
|
||||||
DATA_NAME);
|
|
||||||
|
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new MeteorWorldSaveData();
|
instance = new MeteorWorldSaveData();
|
||||||
@@ -56,8 +55,7 @@ public class MeteorWorldSaveData extends WorldSavedData {
|
|||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbt) {
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
if (nbt.hasKey("posData") && !nbt.getString("posData").isEmpty()) {
|
if (nbt.hasKey("posData") && !nbt.getString("posData").isEmpty()) {
|
||||||
posList = new Gson().fromJson(nbt.getString("posData"), new TypeToken<List<BlockPos>>() {
|
posList = new Gson().fromJson(nbt.getString("posData"), new TypeToken<List<BlockPos>>(){}.getType());
|
||||||
}.getType());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
package com.sosnitzka.taiga.world;
|
package com.sosnitzka.taiga.world;
|
||||||
|
|
||||||
|
|
||||||
import com.sosnitzka.taiga.TAIGA;
|
|
||||||
import com.sosnitzka.taiga.util.Generator;
|
import com.sosnitzka.taiga.util.Generator;
|
||||||
import net.minecraft.block.BlockStone;
|
import net.minecraft.block.BlockStone;
|
||||||
import net.minecraft.init.Biomes;
|
import net.minecraft.init.Biomes;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.chunk.IChunkGenerator;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.IChunkGenerator;
|
|
||||||
import net.minecraftforge.fml.common.IWorldGenerator;
|
import net.minecraftforge.fml.common.IWorldGenerator;
|
||||||
|
import slimeknights.tconstruct.gadgets.block.BlockStoneTorch;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Random;
|
||||||
|
|
||||||
import static com.google.common.collect.Lists.newArrayList;
|
import static com.google.common.collect.Lists.newArrayList;
|
||||||
import static com.sosnitzka.taiga.Blocks.*;
|
import static com.sosnitzka.taiga.Blocks.*;
|
||||||
@@ -19,133 +19,38 @@ import static com.sosnitzka.taiga.TAIGAConfiguration.*;
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class WorldGen implements IWorldGenerator {
|
public class WorldGen implements IWorldGenerator {
|
||||||
private static WorldGen INSTANCE;
|
|
||||||
private final List<Integer> blackList = new ArrayList();
|
|
||||||
private final Map<Integer, Integer> meteorGenStats = new HashMap();
|
|
||||||
private final Map<Integer, Integer> meteorChunkStats = new HashMap();
|
|
||||||
|
|
||||||
public static WorldGen getInstance() {
|
|
||||||
if (INSTANCE == null)
|
|
||||||
INSTANCE = new WorldGen();
|
|
||||||
|
|
||||||
return INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void nether(Random random, int x, int z, World world) {
|
private void nether(Random random, int x, int z, World world) {
|
||||||
Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
|
Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, TIBERIUM_VAL, 0, 128, 10, 35);
|
||||||
world, TIBERIUM_VAL, 32, 128, 10, 35);
|
Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, PROMETHEUM_VAL, 0, 128, 2, 4);
|
||||||
Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
|
Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, VALYRIUM_VAL, 0, 32, 2, 4);
|
||||||
world, PROMETHEUM_VAL, 0, 32, 2, 4);
|
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
|
||||||
Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
|
|
||||||
world, VALYRIUM_VAL, 0, 128, 2, 4);
|
|
||||||
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()),
|
|
||||||
osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void other(Random random, int x, int z, World world) {
|
|
||||||
int dim = world.provider.getDimension();
|
|
||||||
if (!meteorGenStats.containsKey(dim))
|
|
||||||
meteorGenStats.put(dim, 0);
|
|
||||||
|
|
||||||
if (!meteorChunkStats.containsKey(dim))
|
|
||||||
meteorChunkStats.put(dim, 0);
|
|
||||||
|
|
||||||
meteorChunkStats.put(dim, meteorChunkStats.get(dim) + 1);
|
|
||||||
meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre
|
|
||||||
.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112));
|
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA
|
|
||||||
.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
|
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(),
|
|
||||||
random, x, z, world, EEZO_VAL, 0, 10);
|
|
||||||
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z,
|
|
||||||
world, KARMESINE_VAL);
|
|
||||||
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
|
|
||||||
world, OVIUM_VAL);
|
|
||||||
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, JAUXUM_VAL);
|
|
||||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
|
|
||||||
VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes
|
|
||||||
.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
|
|
||||||
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
|
|
||||||
DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes
|
|
||||||
.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
|
|
||||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1,
|
|
||||||
15, 0, 128, 1, 5, null);
|
|
||||||
if (ironGen) {
|
|
||||||
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z,
|
|
||||||
world, IRON_VAL, 0, 32, 2, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (meteorChunkStats.get(dim) > 100 && meteorGenStats.get(dim) == 0) {
|
|
||||||
blackList.add(dim);
|
|
||||||
TAIGA.logger.info(String.format("Detected void dimension, adding to blacklist: %d", dim));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void world(Random random, int x, int z, World world) {
|
private void world(Random random, int x, int z, World world) {
|
||||||
Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z,
|
Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112);
|
||||||
world, DURANITE_VAL, 6, 16, 112);
|
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA
|
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), random, x, z, world, EEZO_VAL, 0, 10);
|
||||||
.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
|
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, world, KARMESINE_VAL);
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(),
|
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, OVIUM_VAL);
|
||||||
random, x, z, world, EEZO_VAL, 0, 10);
|
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, world, JAUXUM_VAL);
|
||||||
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z,
|
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, VIBRANIUM_VAL, 100, 0, 64, 2, 9, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
|
||||||
world, KARMESINE_VAL);
|
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, 25, 0, 128, 1, 5, null);
|
||||||
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
|
|
||||||
world, OVIUM_VAL);
|
|
||||||
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, JAUXUM_VAL);
|
|
||||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
|
|
||||||
VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes
|
|
||||||
.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
|
|
||||||
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
|
|
||||||
DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes
|
|
||||||
.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
|
|
||||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1,
|
|
||||||
15, 0, 128, 1, 5, null);
|
|
||||||
if (ironGen) {
|
if (ironGen) {
|
||||||
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z,
|
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, IRON_VAL, 0, 32, 2, 8);
|
||||||
world, IRON_VAL, 0, 32, 2, 8);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void end(Random random, int x, int z, World world) {
|
private void end(Random random, int x, int z, World world) {
|
||||||
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z,
|
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, world, URU_VAL, 2, 0, 96, 3);
|
||||||
world, URU_VAL, 2, 0, 96, 3);
|
|
||||||
if (endGen)
|
if (endGen)
|
||||||
Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null,
|
Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, random, x, z, world, 1, 100, 3, 64, 3, 8, null);
|
||||||
random, x, z, world, 1, 100, 3, 64, 3, 8, null);
|
Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world, AURORIUM_VAL, 32, 48, 2, 4);
|
||||||
Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world,
|
Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world, PALLADIUM_VAL, 48, 64, 2, 4);
|
||||||
AURORIUM_VAL, 32, 48, 2, 4);
|
Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, world, ABYSSUM_VAL, 4, 64);
|
||||||
Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z,
|
|
||||||
world, PALLADIUM_VAL, 48, 64, 2, 4);
|
|
||||||
Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z,
|
|
||||||
world, ABYSSUM_VAL, 4, 64);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures */
|
|
||||||
private void worldNetherless(Random random, int x, int z, World world) {
|
|
||||||
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z,
|
|
||||||
world, URU_VAL, 2, 0, 96, 3);
|
|
||||||
Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world,
|
|
||||||
AURORIUM_VAL, 8, 48, 2, 4);
|
|
||||||
Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
|
|
||||||
world, PALLADIUM_VAL, 12, 64, 2, 4);
|
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), abyssumOre.getDefaultState(), random, x, z,
|
|
||||||
world, ABYSSUM_VAL, 4, 6);
|
|
||||||
Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, TIBERIUM_VAL, 16, 128, 10, 35);
|
|
||||||
Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, PROMETHEUM_VAL, 0, 32, 2, 4);
|
|
||||||
Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, VALYRIUM_VAL, 0, 128, 2, 4);
|
|
||||||
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()),
|
|
||||||
osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
IChunkProvider chunkProvider) {
|
|
||||||
int x = chunkX * 16;
|
int x = chunkX * 16;
|
||||||
int z = chunkZ * 16;
|
int z = chunkZ * 16;
|
||||||
switch (world.provider.getDimension()) {
|
switch (world.provider.getDimension()) {
|
||||||
@@ -154,18 +59,12 @@ public class WorldGen implements IWorldGenerator {
|
|||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
world(random, x, z, world);
|
world(random, x, z, world);
|
||||||
if(!net.minecraft.server.MinecraftServer.getAllowNether()) {
|
|
||||||
|
|
||||||
/** worldNetherless generates nether/end ores in overworld */
|
|
||||||
worldNetherless(random, x, z, world);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
end(random, x, z, world);
|
end(random, x, z, world);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!blackList.contains(world.provider.getDimension()))
|
world(random, x, z, world);
|
||||||
other(random, x, z, world);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,24 +1,31 @@
|
|||||||
package com.sosnitzka.taiga.world;
|
package com.sosnitzka.taiga.world;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
import com.sosnitzka.taiga.util.StateMatcher;
|
import com.sosnitzka.taiga.util.StateMatcher;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.block.state.pattern.BlockMatcher;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
public class WorldGenMinable extends net.minecraft.world.gen.feature.WorldGenMinable {
|
public class WorldGenMinable extends net.minecraft.world.gen.feature.WorldGenMinable {
|
||||||
private final IBlockState oreBlock;
|
private final IBlockState oreBlock;
|
||||||
|
/**
|
||||||
// The number of com.sosnitzka.taiga.blocks to generate.
|
* The number of com.sosnitzka.taiga.blocks to generate.
|
||||||
|
*/
|
||||||
private final int numberOfBlocks;
|
private final int numberOfBlocks;
|
||||||
private final Predicate<IBlockState> predicate;
|
private final Predicate<IBlockState> predicate;
|
||||||
|
|
||||||
|
public WorldGenMinable(IBlockState state, int blockCount) {
|
||||||
|
this(state, blockCount, BlockMatcher.forBlock(Blocks.STONE));
|
||||||
|
}
|
||||||
|
|
||||||
public WorldGenMinable(IBlockState state, int blockCount, Predicate<IBlockState> predicate) {
|
public WorldGenMinable(IBlockState state, int blockCount, Predicate<IBlockState> predicate) {
|
||||||
super(state, blockCount, predicate::test);
|
super(state, blockCount, predicate);
|
||||||
this.oreBlock = state;
|
this.oreBlock = state;
|
||||||
this.numberOfBlocks = blockCount;
|
this.numberOfBlocks = blockCount;
|
||||||
this.predicate = predicate;
|
this.predicate = predicate;
|
||||||
@@ -43,12 +50,12 @@ public class WorldGenMinable extends net.minecraft.world.gen.feature.WorldGenMin
|
|||||||
double d9 = rand.nextDouble() * (double) this.numberOfBlocks / 16.0D;
|
double d9 = rand.nextDouble() * (double) this.numberOfBlocks / 16.0D;
|
||||||
double d10 = (double) (MathHelper.sin((float) Math.PI * f1) + 1.0F) * d9 + 1.0D;
|
double d10 = (double) (MathHelper.sin((float) Math.PI * f1) + 1.0F) * d9 + 1.0D;
|
||||||
double d11 = (double) (MathHelper.sin((float) Math.PI * f1) + 1.0F) * d9 + 1.0D;
|
double d11 = (double) (MathHelper.sin((float) Math.PI * f1) + 1.0F) * d9 + 1.0D;
|
||||||
int j = MathHelper.floor(d6 - d10 / 2.0D);
|
int j = MathHelper.floor_double(d6 - d10 / 2.0D);
|
||||||
int k = MathHelper.floor(d7 - d11 / 2.0D);
|
int k = MathHelper.floor_double(d7 - d11 / 2.0D);
|
||||||
int l = MathHelper.floor(d8 - d10 / 2.0D);
|
int l = MathHelper.floor_double(d8 - d10 / 2.0D);
|
||||||
int i1 = MathHelper.floor(d6 + d10 / 2.0D);
|
int i1 = MathHelper.floor_double(d6 + d10 / 2.0D);
|
||||||
int j1 = MathHelper.floor(d7 + d11 / 2.0D);
|
int j1 = MathHelper.floor_double(d7 + d11 / 2.0D);
|
||||||
int k1 = MathHelper.floor(d8 + d10 / 2.0D);
|
int k1 = MathHelper.floor_double(d8 + d10 / 2.0D);
|
||||||
|
|
||||||
for (int l1 = j; l1 <= i1; ++l1) {
|
for (int l1 = j; l1 <= i1; ++l1) {
|
||||||
double d12 = ((double) l1 + 0.5D - d6) / (d10 / 2.0D);
|
double d12 = ((double) l1 + 0.5D - d6) / (d10 / 2.0D);
|
||||||
|
@@ -1,171 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.world;
|
|
||||||
|
|
||||||
|
|
||||||
import com.sosnitzka.taiga.TAIGA;
|
|
||||||
import com.sosnitzka.taiga.util.Generator;
|
|
||||||
import net.minecraft.block.BlockStone;
|
|
||||||
import net.minecraft.init.Biomes;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
import net.minecraft.world.gen.IChunkGenerator;
|
|
||||||
import net.minecraftforge.fml.common.IWorldGenerator;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import static com.google.common.collect.Lists.newArrayList;
|
|
||||||
import static com.sosnitzka.taiga.Blocks.*;
|
|
||||||
import static com.sosnitzka.taiga.TAIGAConfiguration.*;
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public class WorldGen implements IWorldGenerator {
|
|
||||||
private static WorldGen INSTANCE;
|
|
||||||
private final List<Integer> blackList = new ArrayList();
|
|
||||||
private final Map<Integer, Integer> meteorGenStats = new HashMap();
|
|
||||||
private final Map<Integer, Integer> meteorChunkStats = new HashMap();
|
|
||||||
|
|
||||||
public static WorldGen getInstance() {
|
|
||||||
if (INSTANCE == null)
|
|
||||||
INSTANCE = new WorldGen();
|
|
||||||
|
|
||||||
return INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void nether(Random random, int x, int z, World world) {
|
|
||||||
Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
|
|
||||||
world, TIBERIUM_VAL, 32, 128, 10, 35);
|
|
||||||
Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
|
|
||||||
world, PROMETHEUM_VAL, 0, 32, 2, 4);
|
|
||||||
Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
|
|
||||||
world, VALYRIUM_VAL, 0, 128, 2, 4);
|
|
||||||
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()),
|
|
||||||
osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void other(Random random, int x, int z, World world) {
|
|
||||||
int dim = world.provider.getDimension();
|
|
||||||
if (!meteorGenStats.containsKey(dim))
|
|
||||||
meteorGenStats.put(dim, 0);
|
|
||||||
|
|
||||||
if (!meteorChunkStats.containsKey(dim))
|
|
||||||
meteorChunkStats.put(dim, 0);
|
|
||||||
|
|
||||||
meteorChunkStats.put(dim, meteorChunkStats.get(dim) + 1);
|
|
||||||
meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre
|
|
||||||
.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112));
|
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA
|
|
||||||
.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
|
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(),
|
|
||||||
random, x, z, world, EEZO_VAL, 0, 10);
|
|
||||||
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z,
|
|
||||||
world, KARMESINE_VAL);
|
|
||||||
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
|
|
||||||
world, OVIUM_VAL);
|
|
||||||
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, JAUXUM_VAL);
|
|
||||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
|
|
||||||
VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes
|
|
||||||
.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
|
|
||||||
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
|
|
||||||
DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes
|
|
||||||
.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
|
|
||||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1,
|
|
||||||
15, 0, 128, 1, 5, null);
|
|
||||||
if (ironGen) {
|
|
||||||
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z,
|
|
||||||
world, IRON_VAL, 0, 32, 2, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (meteorChunkStats.get(dim) > 100 && meteorGenStats.get(dim) == 0) {
|
|
||||||
blackList.add(dim);
|
|
||||||
TAIGA.logger.info(String.format("Detected void dimension, adding to blacklist: %d", dim));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void world(Random random, int x, int z, World world) {
|
|
||||||
Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z,
|
|
||||||
world, DURANITE_VAL, 6, 16, 112);
|
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA
|
|
||||||
.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
|
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(),
|
|
||||||
random, x, z, world, EEZO_VAL, 0, 10);
|
|
||||||
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z,
|
|
||||||
world, KARMESINE_VAL);
|
|
||||||
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
|
|
||||||
world, OVIUM_VAL);
|
|
||||||
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, JAUXUM_VAL);
|
|
||||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
|
|
||||||
VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes
|
|
||||||
.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
|
|
||||||
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
|
|
||||||
DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes
|
|
||||||
.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
|
|
||||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1,
|
|
||||||
15, 0, 128, 1, 5, null);
|
|
||||||
if (ironGen) {
|
|
||||||
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z,
|
|
||||||
world, IRON_VAL, 0, 32, 2, 8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void end(Random random, int x, int z, World world) {
|
|
||||||
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z,
|
|
||||||
world, URU_VAL, 2, 0, 96, 3);
|
|
||||||
if (endGen)
|
|
||||||
Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null,
|
|
||||||
random, x, z, world, 1, 100, 3, 64, 3, 8, null);
|
|
||||||
Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world,
|
|
||||||
AURORIUM_VAL, 32, 48, 2, 4);
|
|
||||||
Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z,
|
|
||||||
world, PALLADIUM_VAL, 48, 64, 2, 4);
|
|
||||||
Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z,
|
|
||||||
world, ABYSSUM_VAL, 4, 64);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures */
|
|
||||||
private void worldNetherless(Random random, int x, int z, World world) {
|
|
||||||
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z,
|
|
||||||
world, URU_VAL, 2, 0, 96, 3);
|
|
||||||
Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world,
|
|
||||||
AURORIUM_VAL, 8, 48, 2, 4);
|
|
||||||
Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
|
|
||||||
world, PALLADIUM_VAL, 12, 64, 2, 4);
|
|
||||||
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), abyssumOre.getDefaultState(), random, x, z,
|
|
||||||
world, ABYSSUM_VAL, 4, 6);
|
|
||||||
Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, TIBERIUM_VAL, 16, 128, 10, 35);
|
|
||||||
Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, PROMETHEUM_VAL, 0, 32, 2, 4);
|
|
||||||
Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
|
|
||||||
world, VALYRIUM_VAL, 0, 128, 2, 4);
|
|
||||||
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()),
|
|
||||||
osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
|
|
||||||
IChunkProvider chunkProvider) {
|
|
||||||
int x = chunkX * 16;
|
|
||||||
int z = chunkZ * 16;
|
|
||||||
switch (world.provider.getDimension()) {
|
|
||||||
case -1:
|
|
||||||
nether(random, x, z, world);
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
world(random, x, z, world);
|
|
||||||
if (!net.minecraft.server.MinecraftServer.getAllowNether()) {
|
|
||||||
/** worldNetherless generates nether/end ores in overworld */
|
|
||||||
worldNetherless(random, x, z, world);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
end(random, x, z, world);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (!blackList.contains(world.provider.getDimension()))
|
|
||||||
other(random, x, z, world);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model": "minecraft:cube_all",
|
|
||||||
"textures": {
|
|
||||||
"all": "taiga:blocks/block/dilithium"
|
|
||||||
},
|
|
||||||
"transform": "forge:default-block"
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"normal": [
|
|
||||||
{}
|
|
||||||
],
|
|
||||||
"inventory": [
|
|
||||||
{}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model": "minecraft:cube_all",
|
|
||||||
"textures": {
|
|
||||||
"all": "taiga:blocks/ore/dilithium"
|
|
||||||
},
|
|
||||||
"transform": "forge:default-block"
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"normal": [
|
|
||||||
{}
|
|
||||||
],
|
|
||||||
"inventory": [
|
|
||||||
{}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@@ -18,13 +18,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dilithium_fluid": [
|
|
||||||
{
|
|
||||||
"custom": {
|
|
||||||
"fluid": "dilithium_fluid"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"nitronite_fluid": [
|
"nitronite_fluid": [
|
||||||
{
|
{
|
||||||
"custom": {
|
"custom": {
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
index_title=TAIGA
|
|
||||||
modifier.informations=Informationen
|
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Abyssum",
|
|
||||||
"r": 33,
|
|
||||||
"g": 188,
|
|
||||||
"b": 194,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:abyssum_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Wie schon bei Eezo entsteht Abyssum durch Sonnenstürme, die bis ins End reichen. Das aufgeladenen Void fusioniert dabei mit Endstein zu Abyssum und setzt sich, da keine Bedrockbarriere existiert an den Boden der Enderinseln ab."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Cobalt",
|
|
||||||
"Achtung: Stürze nicht ins Void"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Aurorium",
|
|
||||||
"r": 239,
|
|
||||||
"g": 174,
|
|
||||||
"b": 148,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:aurorium_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Aurorium ist nicht sehr häufig im Ende zu finden, aber mit ein wenig Fleiß und Geduld findet man genug. Aktuell besitzt Aurorium keine gesonderen Features."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Cobalt",
|
|
||||||
"Selten"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Basalt",
|
|
||||||
"r": 220,
|
|
||||||
"g": 220,
|
|
||||||
"b": 220,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:basalt_block"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Basalt entsteht bei hohen Temperaturen und sondert sich als Schlacke ab. Da es leichter ist, als Stein, schwimmt es auf der Lava, sodass man beim Abbau vorsichtig sein muss. Man nutzt Basalt zur Stabilisierung von Tiberium."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Iron",
|
|
||||||
"Swims on lava",
|
|
||||||
"Used for some alloys"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Dilithium",
|
|
||||||
"r": 121,
|
|
||||||
"g": 174,
|
|
||||||
"b": 166,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:dilithium_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Wo es Sand gibt, ist Dilithium nicht weit entfernt. Man nutzt es, um Tiberium zu stabilisieren, wobei es selbst viel eigene Energie besitzt. Es kann explodieren, aber auch als Wärmequelle genutzt werden."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Diamant",
|
|
||||||
"Vorsicht: Kann bei Explosionen eine Kettenreaktion auslösen",
|
|
||||||
"Orte: Wüsten, Strände, Ozene"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Duranite",
|
|
||||||
"r": 172,
|
|
||||||
"g": 221,
|
|
||||||
"b": 235,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:duranite_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Vor langer Zeit stürzten brennende Meteoriten vom Himmel. Die Reibungshitze war so groß, dass sie die Metalle im inneren zusammenschmolz und einen enorm harten Klumpen Duranite erzeugte."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Duranite",
|
|
||||||
"Sehr selten",
|
|
||||||
"Eingeschlossen in Meteoriten"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Element Zero",
|
|
||||||
"r": 56,
|
|
||||||
"g": 89,
|
|
||||||
"b": 106,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:eezo_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Hin und wieder erzeugen Sonnenstürme enorm starke Magnetwellen, die bis unter die Erdoberfläche reichen. Das Void wird davon in Wallung versetzt und reicht selten bis an den Bedrock, wo es zu Element Zero fusioniert."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Cobalt",
|
|
||||||
"Selten",
|
|
||||||
"Achtung: Beim Abbau nicht ins Void stürzen"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Jauxum",
|
|
||||||
"r": 104,
|
|
||||||
"g": 198,
|
|
||||||
"b": 99,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:jauxum_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Jauxum ist eines der drei etherischen Erze. Zusammen mit Karmesine und Ovium erzeugt es beim verschmelzen die Verbindung Terrax."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Cobalt",
|
|
||||||
"Entsteht in Granit"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Karmesin",
|
|
||||||
"r": 235,
|
|
||||||
"g": 72,
|
|
||||||
"b": 74,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:karmesine_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Karmesin ist eines der drei etherischen Erze. Zusammen mit Jauxum und Ovium erzeugt es beim verschmelzen die Verbindung Terrax."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Cobalt",
|
|
||||||
"Entsteht in andensit"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Meteorit",
|
|
||||||
"r": 35,
|
|
||||||
"g": 35,
|
|
||||||
"b": 35,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:meteorite_block"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Man muss Geduld aufbringen, um Meteoriten zu finden. Vor vielen tausend Jahren stürzten sie vom Himmel. Die meisten von ihnen liegen unter der Erde begraben, entsprechend aufwändig gestaltet die Suche."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Cobalt",
|
|
||||||
"Manchmal zerbröselt es beim Abbau",
|
|
||||||
"Liegt häufig unterirdisch"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Obsidiorit",
|
|
||||||
"r": 34,
|
|
||||||
"g": 72,
|
|
||||||
"b": 83,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:obsidiorite_block"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Obsidiorit findet man im Ende ziemlich häufig. Scheinbar entstanden die kubischen Meteoriten im Void und schweben seither im Ende umher. Man muss fliegen können oder Treppen bauen, um sie abzubauen."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Duranite",
|
|
||||||
"Manchmal brechen sie nicht vollständig",
|
|
||||||
"Sehr hart",
|
|
||||||
"Schweben im Ende"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Osram",
|
|
||||||
"r": 255,
|
|
||||||
"g": 188,
|
|
||||||
"b": 144,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:osram_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Osram entstand, als Glimmersteinpartikel unter hohem Druck und enormen Temperaturen schmolz. Dieses seltene Erz kann man in den vielen Lavaseen des Nethers entdecken."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Cobalt",
|
|
||||||
"Schwimmt in Nether-Lavaseen",
|
|
||||||
"Es ist hart und heiß"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Ovium",
|
|
||||||
"r": 125,
|
|
||||||
"g": 119,
|
|
||||||
"b": 195,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:ovium_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Ovium ist eines der drei etherischen Erze. Zusammen mit Jauxum und Karmesin erzeugt es beim verschmelzen die Verbindung Terrax."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Cobalt",
|
|
||||||
"Entsteht in Diorit"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Palladium",
|
|
||||||
"r": 238,
|
|
||||||
"g": 135,
|
|
||||||
"b": 54,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:palladium_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Palladium ist ein kristallines Erz, welches im Ende auftaucht. Die im Ende vorherrschende Strahlung wird durch Palladium erzeugt. Es glüht und zerfällt auf Grund seiner Radioaktivität."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Duranite",
|
|
||||||
"Gefährlich radioaktiv",
|
|
||||||
"Leuchtet im Dunkeln",
|
|
||||||
"Kristallin"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Prometheum",
|
|
||||||
"r": 55,
|
|
||||||
"g": 44,
|
|
||||||
"b": 73,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:prometheum_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Manche Wissenschaftler glauben, dass Prometheum durch den hohen Druck in den Tiefen des Nethers entsteht. Abgebaut, beginnt es radioaktiv zu strahlen und zerfällt nach und nach."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Duranite",
|
|
||||||
"Zerfällt allmählich",
|
|
||||||
"Leuchtet im Dunkeln",
|
|
||||||
"dY: ~16"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Tiberium",
|
|
||||||
"r": 212,
|
|
||||||
"g": 255,
|
|
||||||
"b": 0,
|
|
||||||
"input": {
|
|
||||||
"id": "taiga:tiberium_ore"
|
|
||||||
},
|
|
||||||
"description": [
|
|
||||||
{
|
|
||||||
"text": "Wenn man den Nether erforscht fallen die vielen Tiberiumadern auf. Dieses kristalline Erz ist äußerst instabil und gefährlich. Es kann urplötzlich explodieren und benötigt daher einen Stabilisator für den weiteren Nutzen."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"informations": [
|
|
||||||
"Level: Stone",
|
|
||||||
"Explosiv",
|
|
||||||
"Kristallin"
|
|
||||||
]
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user