mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-25 06:24:54 +00:00
Compare commits
199
Commits
2.2.3
..
2.5.12-GTNH
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4704d4c18c | ||
|
|
2abb28bd8e | ||
|
|
011a5767a7 | ||
|
|
9fa67a8426 | ||
|
|
fb65570ce9 | ||
|
|
0901392f11 | ||
|
|
1359133050 | ||
|
|
b12577b506 | ||
|
|
b787d693b9 | ||
|
|
1f19dc2f5e | ||
|
|
4e638db2a7 | ||
|
|
db7d6ab7a2 | ||
|
|
1db58409ec | ||
|
|
ff9e54760a | ||
|
|
a15b899913 | ||
|
|
68a2880877 | ||
|
|
913c4e5d00 | ||
|
|
51f161c2e8 | ||
|
|
a49128337b | ||
|
|
4903f97de6 | ||
|
|
f87a689045 | ||
|
|
987d7c2b11 | ||
|
|
3550fe23d4 | ||
|
|
237abd6cef | ||
|
|
5e86d62433 | ||
|
|
4c71e42dd6 | ||
|
|
de793aa5fc | ||
|
|
58439c0936 | ||
|
|
ef76ab40e3 | ||
|
|
d2a3b91fe0 | ||
|
|
a370c61948 | ||
|
|
04ea5e8862 | ||
|
|
b411fec0c1 | ||
|
|
82368a06bf | ||
|
|
58a9fa9e0f | ||
|
|
bcb38e8718 | ||
|
|
59d2f6bdb0 | ||
|
|
989bb6f917 | ||
|
|
9c044ffc9a | ||
|
|
ce32e21597 | ||
|
|
2375121778 | ||
|
|
5e2543027d | ||
|
|
74afd10913 | ||
|
|
1ef16b4dba | ||
|
|
c1cc32b2f6 | ||
|
|
451f183e83 | ||
|
|
bff3c669bf | ||
|
|
6c28a687ab | ||
|
|
918334e5bf | ||
|
|
afee91a925 | ||
|
|
9196bee240 | ||
|
|
824e72ac82 | ||
|
|
fe7824eef4 | ||
|
|
c796902c91 | ||
|
|
d13d5ec3dd | ||
|
|
90186aa9be | ||
|
|
155d638647 | ||
|
|
130b7c6836 | ||
|
|
a2ab168d69 | ||
|
|
7987c846aa | ||
|
|
11eb9e4fb1 | ||
|
|
0569b81126 | ||
|
|
264385c778 | ||
|
|
93c8fb9dd0 | ||
|
|
36e3209167 | ||
|
|
5c81c964b1 | ||
|
|
dce77fb246 | ||
|
|
c9fe22c399 | ||
|
|
e314a79e24 | ||
|
|
a46274fc6d | ||
|
|
275f03ccba | ||
|
|
7fa6eb8953 | ||
|
|
e6ae553eb8 | ||
|
|
8f5e4127f0 | ||
|
|
1e082e087f | ||
|
|
8952663d40 | ||
|
|
2e82ba2bf1 | ||
|
|
9597ebb658 | ||
|
|
5615d2a75b | ||
|
|
3a3bc29155 | ||
|
|
c1043bb588 | ||
|
|
e555aeaec2 | ||
|
|
ab5b7c7532 | ||
|
|
80a078d2ed | ||
|
|
ab70d8aec2 | ||
|
|
e8002e069a | ||
|
|
90e5cf801b | ||
|
|
e5a26e1b88 | ||
|
|
72e8fb4c24 | ||
|
|
a76d0d1c29 | ||
|
|
167b1f5257 | ||
|
|
01cfec7169 | ||
|
|
3fde6fb08c | ||
|
|
eacb9f2609 | ||
|
|
3f43cc52c1 | ||
|
|
f1086f3095 | ||
|
|
2503c94b83 | ||
|
|
af44fb9d89 | ||
|
|
8569a43f87 | ||
|
|
bd8fa92266 | ||
|
|
4d2ea94b76 | ||
|
|
8d65e675d1 | ||
|
|
8beb50fcf8 | ||
|
|
800799e85c | ||
|
|
66c0f02a6e | ||
|
|
aa2ef7f24d | ||
|
|
4326da4013 | ||
|
|
3d61472a7e | ||
|
|
97d50f0405 | ||
|
|
ab8a16b26d | ||
|
|
ce8fb0323d | ||
|
|
89975c8718 | ||
|
|
7ae7af2238 | ||
|
|
0bdbcdb2f8 | ||
|
|
354f2ef71b | ||
|
|
4c93eb6bf4 | ||
|
|
922a8fffd6 | ||
|
|
ae15b9e77f | ||
|
|
03068d7ddb | ||
|
|
a1a4506a14 | ||
|
|
4f7370b521 | ||
|
|
25a17fcbfd | ||
|
|
9a3fb6ba16 | ||
|
|
07fde529a4 | ||
|
|
aad6b1fa13 | ||
|
|
651aa82045 | ||
|
|
c078d1a24c | ||
|
|
e87af0d409 | ||
|
|
fde41046d6 | ||
|
|
77d2833e7e | ||
|
|
cc4ac2a389 | ||
|
|
fa5c8aa264 | ||
|
|
7ee2bc991e | ||
|
|
5f78df9fe8 | ||
|
|
7124041129 | ||
|
|
dc7c54f85a | ||
|
|
d0ce872a13 | ||
|
|
fcdf5bd5b3 | ||
|
|
7a77dca7c7 | ||
|
|
3fad743f61 | ||
|
|
787a20c0da | ||
|
|
b326e366b6 | ||
|
|
be652f2fd8 | ||
|
|
6c61749d35 | ||
|
|
a0cf62c2a0 | ||
|
|
0f644270cc | ||
|
|
fbbc0c5050 | ||
|
|
71686766a9 | ||
|
|
8e7767d4ba | ||
|
|
e5f296cf83 | ||
|
|
e0432846d5 | ||
|
|
e9c1e5cf8c | ||
|
|
12dd21e35a | ||
|
|
8ef17ecbc9 | ||
|
|
bab96ead6b | ||
|
|
07ca48aa43 | ||
|
|
0715532170 | ||
|
|
b43137e399 | ||
|
|
707266cad7 | ||
|
|
7a028787c5 | ||
|
|
1c5d255f58 | ||
|
|
4f41f39f92 | ||
|
|
7e930f44be | ||
|
|
23b595e250 | ||
|
|
0c9b6df7b2 | ||
|
|
cddddca223 | ||
|
|
c62db23f79 | ||
|
|
223aba18a4 | ||
|
|
2e4a7d7bb1 | ||
|
|
913433b0c7 | ||
|
|
3b28e2499e | ||
|
|
090a6a2fc3 | ||
|
|
0a28b3fe63 | ||
|
|
b1a3223fbe | ||
|
|
be12564bcc | ||
|
|
e56afa8feb | ||
|
|
a74b2da532 | ||
|
|
ec00af6c09 | ||
|
|
43acadef2c | ||
|
|
25df457b18 | ||
|
|
07942d4218 | ||
|
|
079c572a1a | ||
|
|
975a63afef | ||
|
|
21b26e491c | ||
|
|
546ad5fc00 | ||
|
|
88fa3d6837 | ||
|
|
83f82decd8 | ||
|
|
549433e445 | ||
|
|
a6c235aa5a | ||
|
|
99c40a99a9 | ||
|
|
30509d4180 | ||
|
|
fe8c118f7f | ||
|
|
e14a3c6a62 | ||
|
|
83c5e49a28 | ||
|
|
2e42dd5be3 | ||
|
|
00d01c55ad | ||
|
|
7afda32063 | ||
|
|
eeb6cb356d | ||
|
|
61fdd7ad09 |
No files matched your search
@@ -0,0 +1,19 @@
|
||||
# This is the universal Text Editor Configuration
|
||||
# for all GTNewHorizons projects
|
||||
# See: https://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{bat,ini}]
|
||||
end_of_line = crlf
|
||||
|
||||
[*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}]
|
||||
indent_size = 2
|
||||
Executable
+51
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# bashsupport disable=BP5006 # Global environment variables
|
||||
RUNDIR="run" \
|
||||
CRASH="crash-reports" \
|
||||
SERVERLOG="server.log"
|
||||
|
||||
# enable nullglob to get 0 results when no match rather than the pattern
|
||||
shopt -s nullglob
|
||||
|
||||
# store matches in array
|
||||
crash_reports=("$RUNDIR/$CRASH/crash"*.txt)
|
||||
|
||||
# if array not empty there are crash_reports
|
||||
if [ "${#crash_reports[@]}" -gt 0 ]; then
|
||||
# get the latest crash_report from array
|
||||
latest_crash_report="${crash_reports[-1]}"
|
||||
{
|
||||
printf 'Latest crash report detected %s:\n' "${latest_crash_report##*/}"
|
||||
cat "$latest_crash_report"
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet --fixed-strings 'Fatal errors were detected' "$SERVERLOG"; then
|
||||
{
|
||||
printf 'Fatal errors detected:\n'
|
||||
cat server.log
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' \
|
||||
"$SERVERLOG"; then
|
||||
{
|
||||
printf 'Server force stopped:'
|
||||
cat server.log
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep --quiet --perl-regexp --only-matching '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then
|
||||
{
|
||||
printf 'Server did not finish startup:'
|
||||
cat server.log
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf 'No crash reports detected'
|
||||
exit 0
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
name: Build and test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
name: Release tagged build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: [ '*' ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release-tags:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
|
||||
secrets: inherit
|
||||
+28
-23
@@ -1,26 +1,31 @@
|
||||
# IntelliJ IDEA Files
|
||||
.gradle
|
||||
.settings
|
||||
/.idea/
|
||||
/run/
|
||||
/build/
|
||||
/eclipse/
|
||||
.classpath
|
||||
.project
|
||||
/bin/
|
||||
/config/
|
||||
/crash-reports/
|
||||
/logs/
|
||||
options.txt
|
||||
/saves/
|
||||
usernamecache.json
|
||||
banned-ips.json
|
||||
banned-players.json
|
||||
eula.txt
|
||||
ops.json
|
||||
server.properties
|
||||
servers.dat
|
||||
usercache.json
|
||||
whitelist.json
|
||||
/out/
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
out/
|
||||
.idea/
|
||||
|
||||
# Eclipse Project Files
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
eclipse/
|
||||
|
||||
# Gradle
|
||||
.gradle
|
||||
gradle/
|
||||
build/
|
||||
debug/
|
||||
bin/
|
||||
config/
|
||||
crash-reports/
|
||||
logs/
|
||||
mods/
|
||||
saves/
|
||||
usernamecache.json
|
||||
options.txt
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "src/api/java/thaumcraft/api"]
|
||||
path = src/api/java/thaumcraft/api
|
||||
url = https://github.com/Azanor/thaumcraft-api
|
||||
@@ -0,0 +1,3 @@
|
||||
# Any Github changes require admin approval
|
||||
/.github/** @GTNewHorizons/admin
|
||||
|
||||
+712
-36
@@ -1,50 +1,426 @@
|
||||
//version: 1646409286
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle for updates.
|
||||
*/
|
||||
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.internal.logging.text.StyledTextOutput.Style
|
||||
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
name 'forge'
|
||||
url 'https://maven.minecraftforge.net'
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
name 'sonatype'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
}
|
||||
maven {
|
||||
name 'Scala CI dependencies'
|
||||
url 'https://repo1.maven.org/maven2/'
|
||||
}
|
||||
maven {
|
||||
name 'jitpack'
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'scala'
|
||||
id 'maven-publish'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false
|
||||
id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false
|
||||
id 'org.ajoberstar.grgit' version '4.1.1'
|
||||
id 'com.github.johnrengelman.shadow' version '4.0.4'
|
||||
id 'com.palantir.git-version' version '0.13.0' apply false
|
||||
id 'de.undercouch.download' version '5.0.1'
|
||||
id 'com.github.gmazzo.buildconfig' version '3.0.3' apply false
|
||||
}
|
||||
|
||||
if (project.file('.git/HEAD').isFile()) {
|
||||
apply plugin: 'com.palantir.git-version'
|
||||
}
|
||||
|
||||
def out = services.get(StyledTextOutputFactory).create('an-output')
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
def projectJavaVersion = JavaLanguageVersion.of(8)
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(projectJavaVersion)
|
||||
}
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
inheritOutputDirs = true
|
||||
downloadJavadoc = true
|
||||
downloadSources = true
|
||||
}
|
||||
}
|
||||
|
||||
if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
|
||||
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
|
||||
}
|
||||
|
||||
checkPropertyExists("modName")
|
||||
checkPropertyExists("modId")
|
||||
checkPropertyExists("modGroup")
|
||||
checkPropertyExists("autoUpdateBuildScript")
|
||||
checkPropertyExists("minecraftVersion")
|
||||
checkPropertyExists("forgeVersion")
|
||||
checkPropertyExists("replaceGradleTokenInFile")
|
||||
checkPropertyExists("gradleTokenModId")
|
||||
checkPropertyExists("gradleTokenModName")
|
||||
checkPropertyExists("gradleTokenVersion")
|
||||
checkPropertyExists("gradleTokenGroupName")
|
||||
checkPropertyExists("apiPackage")
|
||||
checkPropertyExists("accessTransformersFile")
|
||||
checkPropertyExists("usesMixins")
|
||||
checkPropertyExists("mixinPlugin")
|
||||
checkPropertyExists("mixinsPackage")
|
||||
checkPropertyExists("coreModClass")
|
||||
checkPropertyExists("containsMixinsAndOrCoreModOnly")
|
||||
checkPropertyExists("usesShadowedDependencies")
|
||||
checkPropertyExists("developmentEnvironmentUserName")
|
||||
|
||||
boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false
|
||||
boolean usesMixinDebug = project.findProperty('usesMixinDebug') ?: project.usesMixins.toBoolean()
|
||||
|
||||
String javaSourceDir = "src/main/java/"
|
||||
String scalaSourceDir = "src/main/scala/"
|
||||
String kotlinSourceDir = "src/main/kotlin/"
|
||||
|
||||
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
|
||||
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
|
||||
}
|
||||
|
||||
if(apiPackage) {
|
||||
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
||||
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
||||
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
||||
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
|
||||
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
|
||||
}
|
||||
}
|
||||
|
||||
if(accessTransformersFile) {
|
||||
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
|
||||
if(!getFile(targetFile).exists()) {
|
||||
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
|
||||
}
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) {
|
||||
throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!")
|
||||
}
|
||||
|
||||
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
||||
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
||||
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
||||
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
|
||||
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
|
||||
}
|
||||
|
||||
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
|
||||
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
|
||||
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
|
||||
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".kt"
|
||||
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
|
||||
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
|
||||
}
|
||||
}
|
||||
|
||||
if(coreModClass) {
|
||||
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
|
||||
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala"
|
||||
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
|
||||
String targetFileKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".kt"
|
||||
if(!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) {
|
||||
throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin)
|
||||
}
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
|
||||
|
||||
// Make sure GregTech build won't time out
|
||||
System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String)
|
||||
System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String)
|
||||
}
|
||||
|
||||
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
|
||||
try {
|
||||
'git config core.fileMode false'.execute()
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
out.style(Style.Failure).println("git isn't installed at all")
|
||||
}
|
||||
|
||||
// Pulls version first from the VERSION env and then git tag
|
||||
String identifiedVersion
|
||||
String versionOverride = System.getenv("VERSION") ?: null
|
||||
try {
|
||||
identifiedVersion = versionOverride == null ? gitVersion() : versionOverride
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
out.style(Style.Failure).text(
|
||||
'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' +
|
||||
'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' +
|
||||
'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)'
|
||||
)
|
||||
versionOverride = 'NO-GIT-TAG-SET'
|
||||
identifiedVersion = versionOverride
|
||||
}
|
||||
version = minecraftVersion + '-' + identifiedVersion
|
||||
ext {
|
||||
modVersion = identifiedVersion
|
||||
}
|
||||
|
||||
if(identifiedVersion == versionOverride) {
|
||||
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
|
||||
}
|
||||
|
||||
group = modGroup
|
||||
if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
}
|
||||
else {
|
||||
archivesBaseName = modId
|
||||
}
|
||||
|
||||
def arguments = []
|
||||
def jvmArguments = []
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
arguments += [
|
||||
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
|
||||
]
|
||||
if (usesMixinDebug.toBoolean()) {
|
||||
jvmArguments += [
|
||||
"-Dmixin.debug.countInjections=true",
|
||||
"-Dmixin.debug.verbose=true",
|
||||
"-Dmixin.debug.export=true"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = minecraftVersion + '-' + forgeVersion + '-' + minecraftVersion
|
||||
runDir = 'run'
|
||||
|
||||
if (replaceGradleTokenInFile) {
|
||||
replaceIn replaceGradleTokenInFile
|
||||
if(gradleTokenModId) {
|
||||
replace gradleTokenModId, modId
|
||||
}
|
||||
if(gradleTokenModName) {
|
||||
replace gradleTokenModName, modName
|
||||
}
|
||||
if(gradleTokenVersion) {
|
||||
replace gradleTokenVersion, modVersion
|
||||
}
|
||||
if(gradleTokenGroupName) {
|
||||
replace gradleTokenGroupName, modGroup
|
||||
}
|
||||
}
|
||||
|
||||
clientIntellijRun {
|
||||
args(arguments)
|
||||
jvmArgs(jvmArguments)
|
||||
|
||||
if(developmentEnvironmentUserName) {
|
||||
args("--username", developmentEnvironmentUserName)
|
||||
}
|
||||
}
|
||||
|
||||
serverIntellijRun {
|
||||
args(arguments)
|
||||
jvmArgs(jvmArguments)
|
||||
}
|
||||
}
|
||||
|
||||
if(file('addon.gradle').exists()) {
|
||||
apply from: 'addon.gradle'
|
||||
}
|
||||
|
||||
apply from: 'repositories.gradle'
|
||||
|
||||
configurations {
|
||||
implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
|
||||
implementation.extendsFrom(shadowCompile)
|
||||
implementation.extendsFrom(shadeCompile)
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "forestry"
|
||||
url = "http://maven.ic2.player.to/"
|
||||
name 'Overmind forge repo mirror'
|
||||
url 'https://gregtech.overminddl1.com/'
|
||||
}
|
||||
if(usesMixins.toBoolean()) {
|
||||
maven {
|
||||
name 'sponge'
|
||||
url 'https://repo.spongepowered.org/repository/maven-public'
|
||||
}
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
ext.version_mod = "${project.version_major}.${project.version_minor}.${project.version_rev}"
|
||||
version = project.version_mc + "-" + project.version_mod
|
||||
group= "magicbees" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "magicbees"
|
||||
|
||||
minecraft {
|
||||
version = project.version_mc + "-" + project.version_forge
|
||||
runDir = "."
|
||||
|
||||
replace '@VERSION@', project.version_mod
|
||||
replace '@MCVERSION@', project.version_mc
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "net.sengir.forestry:forestry_${project.version_mc}:${project.version_forestry}:dev"
|
||||
compile files("/libs/BloodMagic-${project.version_mc}-${project.version_bloodmagic}.jar")
|
||||
compile files("/libs/Botania ${project.version_botania}-deobf.jar")
|
||||
if(usesMixins.toBoolean()) {
|
||||
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
|
||||
annotationProcessor('com.google.guava:guava:24.1.1-jre')
|
||||
annotationProcessor('com.google.code.gson:gson:2.8.6')
|
||||
annotationProcessor('org.spongepowered:mixin:0.8-SNAPSHOT')
|
||||
// using 0.8 to workaround a issue in 0.7 which fails mixin application
|
||||
compile('com.github.GTNewHorizons:SpongePoweredMixin:0.7.12-GTNH') {
|
||||
// Mixin includes a lot of dependencies that are too up-to-date
|
||||
exclude module: 'launchwrapper'
|
||||
exclude module: 'guava'
|
||||
exclude module: 'gson'
|
||||
exclude module: 'commons-io'
|
||||
exclude module: 'log4j-core'
|
||||
}
|
||||
compile('com.github.GTNewHorizons:SpongeMixins:1.5.0')
|
||||
}
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
|
||||
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
|
||||
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
|
||||
|
||||
task generateAssets {
|
||||
if (usesMixins.toBoolean()) {
|
||||
def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json");
|
||||
if (!mixinConfigFile.exists()) {
|
||||
mixinConfigFile.text = """{
|
||||
"required": true,
|
||||
"minVersion": "0.7.11",
|
||||
"package": "${modGroup}.${mixinsPackage}",
|
||||
"plugin": "${modGroup}.${mixinPlugin}",
|
||||
"refmap": "${mixingConfigRefMap}",
|
||||
"target": "@env(DEFAULT)",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [],
|
||||
"client": [],
|
||||
"server": []
|
||||
}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task relocateShadowJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = modGroup + ".shadow"
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
|
||||
dependsOn(relocateShadowJar)
|
||||
}
|
||||
|
||||
jar {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(shadowJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
reobf {
|
||||
if(usesMixins.toBoolean()) {
|
||||
addExtraSrgFile mixinSrg
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
if(usesMixins.toBoolean()) {
|
||||
tasks.compileJava {
|
||||
options.compilerArgs += [
|
||||
"-AreobfSrgFile=${tasks.reobf.srg}",
|
||||
"-AoutSrgFile=${mixinSrg}",
|
||||
"-AoutRefMapFile=${refMap}",
|
||||
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
|
||||
"-XDenableSunApiLintControl",
|
||||
"-XDignore.symbol.file"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runClient {
|
||||
if(developmentEnvironmentUserName) {
|
||||
arguments += [
|
||||
"--username",
|
||||
developmentEnvironmentUserName
|
||||
]
|
||||
}
|
||||
|
||||
args(arguments)
|
||||
jvmArgs(jvmArguments)
|
||||
}
|
||||
|
||||
runServer {
|
||||
args(arguments)
|
||||
jvmArgs(jvmArguments)
|
||||
}
|
||||
|
||||
tasks.withType(JavaExec).configureEach {
|
||||
javaLauncher.set(
|
||||
javaToolchains.launcherFor {
|
||||
languageVersion = projectJavaVersion
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
processResources {
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
@@ -52,20 +428,320 @@ processResources
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
|
||||
// replace modVersion and minecraftVersion
|
||||
expand "minecraftVersion": project.minecraft.version,
|
||||
"modVersion": modVersion,
|
||||
"modId": modId,
|
||||
"modName": modName
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
from refMap
|
||||
}
|
||||
|
||||
// copy everything else that's not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
inheritOutputDirs = true
|
||||
def getManifestAttributes() {
|
||||
def manifestAttributes = [:]
|
||||
if(!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) {
|
||||
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
|
||||
}
|
||||
|
||||
if(accessTransformersFile) {
|
||||
manifestAttributes += ["FMLAT" : accessTransformersFile.toString()]
|
||||
}
|
||||
|
||||
if(coreModClass) {
|
||||
manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass]
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
manifestAttributes += [
|
||||
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
|
||||
"MixinConfigs" : "mixins." + modId + ".json",
|
||||
"ForceLoadAsMod" : !containsMixinsAndOrCoreModOnly.toBoolean()
|
||||
]
|
||||
}
|
||||
return manifestAttributes
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from (sourceSets.main.allSource)
|
||||
from (file("$projectDir/LICENSE"))
|
||||
getArchiveClassifier().set('sources')
|
||||
}
|
||||
|
||||
task shadowDevJar(type: ShadowJar) {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
|
||||
}
|
||||
|
||||
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowDevJar
|
||||
prefix = modGroup + ".shadow"
|
||||
}
|
||||
|
||||
task circularResolverJar(type: Jar) {
|
||||
dependsOn(relocateShadowDevJar)
|
||||
dependsOn(shadowDevJar)
|
||||
enabled = false
|
||||
}
|
||||
|
||||
task devJar(type: Jar) {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(circularResolverJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
task apiJar(type: Jar) {
|
||||
from (sourceSets.main.allSource) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.output) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.resources.srcDirs) {
|
||||
include("LICENSE")
|
||||
}
|
||||
|
||||
getArchiveClassifier().set('api')
|
||||
}
|
||||
|
||||
artifacts {
|
||||
if(!noPublishedSources) {
|
||||
archives sourcesJar
|
||||
}
|
||||
archives devJar
|
||||
if(apiPackage) {
|
||||
archives apiJar
|
||||
}
|
||||
}
|
||||
|
||||
// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID),
|
||||
// and isn't strictly needed with the POM so just disable it.
|
||||
tasks.withType(GenerateModuleMetadata) {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
// workaround variable hiding in pom processing
|
||||
def projectConfigs = project.configurations
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
artifact source: shadowJar, classifier: ""
|
||||
}
|
||||
if(!noPublishedSources) {
|
||||
artifact source: sourcesJar, classifier: "src"
|
||||
}
|
||||
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
|
||||
if (apiPackage) {
|
||||
artifact source: apiJar, classifier: "api"
|
||||
}
|
||||
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
|
||||
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
|
||||
// Using the identified version, not project.version as it has the prepended 1.7.10
|
||||
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
|
||||
|
||||
// remove extra garbage from minecraft and minecraftDeps configuration
|
||||
pom.withXml {
|
||||
def badArtifacts = [:].withDefault {[] as Set<String>}
|
||||
for (configuration in [projectConfigs.minecraft, projectConfigs.minecraftDeps]) {
|
||||
for (dependency in configuration.allDependencies) {
|
||||
badArtifacts[dependency.group == null ? "" : dependency.group] += dependency.name
|
||||
}
|
||||
}
|
||||
// example for specifying extra stuff to ignore
|
||||
// badArtifacts["org.example.group"] += "artifactName"
|
||||
|
||||
Node pomNode = asNode()
|
||||
pomNode.dependencies.'*'.findAll() {
|
||||
badArtifacts[it.groupId.text()].contains(it.artifactId.text())
|
||||
}.each() {
|
||||
it.parent().remove(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases"
|
||||
credentials {
|
||||
username = System.getenv("MAVEN_USER") ?: "NONE"
|
||||
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Updating
|
||||
task updateBuildScript {
|
||||
doLast {
|
||||
if (performBuildScriptUpdate(projectDir.toString())) return
|
||||
|
||||
print("Build script already up-to-date!")
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
|
||||
if (autoUpdateBuildScript.toBoolean()) {
|
||||
performBuildScriptUpdate(projectDir.toString())
|
||||
} else {
|
||||
out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'")
|
||||
}
|
||||
}
|
||||
|
||||
static URL availableBuildScriptUrl() {
|
||||
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/main/build.gradle")
|
||||
}
|
||||
|
||||
boolean performBuildScriptUpdate(String projectDir) {
|
||||
if (isNewBuildScriptVersionAvailable(projectDir)) {
|
||||
def buildscriptFile = getFile("build.gradle")
|
||||
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
|
||||
out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
boolean isNewBuildScriptVersionAvailable(String projectDir) {
|
||||
Map parameters = ["connectTimeout": 2000, "readTimeout": 2000]
|
||||
|
||||
String currentBuildScript = getFile("build.gradle").getText()
|
||||
String currentBuildScriptHash = getVersionHash(currentBuildScript)
|
||||
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
|
||||
String availableBuildScriptHash = getVersionHash(availableBuildScript)
|
||||
|
||||
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
|
||||
return !isUpToDate
|
||||
}
|
||||
|
||||
static String getVersionHash(String buildScriptContent) {
|
||||
String versionLine = buildScriptContent.find("^//version: [a-z0-9]*")
|
||||
if(versionLine != null) {
|
||||
return versionLine.split(": ").last()
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
configure(updateBuildScript) {
|
||||
group = 'forgegradle'
|
||||
description = 'Updates the build script to the latest version'
|
||||
}
|
||||
|
||||
// Deobfuscation
|
||||
|
||||
def deobf(String sourceURL) {
|
||||
try {
|
||||
URL url = new URL(sourceURL)
|
||||
String fileName = url.getFile()
|
||||
|
||||
//get rid of directories:
|
||||
int lastSlash = fileName.lastIndexOf("/")
|
||||
if(lastSlash > 0) {
|
||||
fileName = fileName.substring(lastSlash + 1)
|
||||
}
|
||||
//get rid of extension:
|
||||
if(fileName.endsWith(".jar")) {
|
||||
fileName = fileName.substring(0, fileName.lastIndexOf("."))
|
||||
}
|
||||
|
||||
String hostName = url.getHost()
|
||||
if(hostName.startsWith("www.")) {
|
||||
hostName = hostName.substring(4)
|
||||
}
|
||||
List parts = Arrays.asList(hostName.split("\\."))
|
||||
Collections.reverse(parts)
|
||||
hostName = String.join(".", parts)
|
||||
|
||||
return deobf(sourceURL, hostName + "/" + fileName)
|
||||
} catch(Exception e) {
|
||||
return deobf(sourceURL, "deobf/" + String.valueOf(sourceURL.hashCode()))
|
||||
}
|
||||
}
|
||||
|
||||
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
|
||||
def deobf(String sourceURL, String fileName) {
|
||||
String cacheDir = System.getProperty("user.home") + "/.gradle/caches/"
|
||||
String bon2Dir = cacheDir + "forge_gradle/deobf"
|
||||
String bon2File = bon2Dir + "/BON2-2.5.0.jar"
|
||||
String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar"
|
||||
String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar"
|
||||
|
||||
if(file(deobfFile).exists()) {
|
||||
return files(deobfFile)
|
||||
}
|
||||
|
||||
download.run {
|
||||
src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar'
|
||||
dest bon2File
|
||||
quiet true
|
||||
overwrite false
|
||||
}
|
||||
|
||||
download.run {
|
||||
src sourceURL
|
||||
dest obfFile
|
||||
quiet true
|
||||
overwrite false
|
||||
}
|
||||
|
||||
exec {
|
||||
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch'
|
||||
workingDir bon2Dir
|
||||
standardOutput = new ByteArrayOutputStream()
|
||||
}
|
||||
|
||||
return files(deobfFile)
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
|
||||
def checkPropertyExists(String propertyName) {
|
||||
if (!project.hasProperty(propertyName)) {
|
||||
throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties")
|
||||
}
|
||||
}
|
||||
|
||||
def getFile(String relativePath) {
|
||||
return new File(projectDir, relativePath)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:ForestryMC:4.4.6:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.14:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.9.2-GTNH:api') {transitive = false}
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive = false}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
2.2.2
|
||||
false
|
||||
Magic Apiary, assorted bugfixes.
|
||||
+62
-8
@@ -1,10 +1,64 @@
|
||||
version_major=2
|
||||
version_minor=2
|
||||
version_rev=3
|
||||
modName = Magic Bees
|
||||
|
||||
version_forestry=3.4.0.7
|
||||
version_bloodmagic=1.3.1-7
|
||||
version_botania=r1.6-180
|
||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||
modId = MagicBees
|
||||
|
||||
version_mc=1.7.10
|
||||
version_forge=10.13.2.1230
|
||||
modGroup = magicbees
|
||||
|
||||
# WHY is there no version field?
|
||||
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
||||
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
||||
|
||||
# Will update your build.gradle automatically whenever an update is available
|
||||
autoUpdateBuildScript = false
|
||||
|
||||
minecraftVersion = 1.7.10
|
||||
forgeVersion = 10.13.4.1614
|
||||
|
||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you
|
||||
# restart Minecraft in development. Choose this dependent on your mod:
|
||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Define a source file of your project with:
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...])
|
||||
# Leave these properties empty to skip individual token replacements
|
||||
replaceGradleTokenInFile = VersionInfo.java
|
||||
gradleTokenModId =
|
||||
gradleTokenModName =
|
||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||
gradleTokenGroupName =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||
apiPackage = api
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
accessTransformersFile =
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage =
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatibility only
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass =
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = false
|
||||
|
||||
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
|
||||
# responsibility check the licence and request permission for distribution, if required.
|
||||
usesShadowedDependencies = false
|
||||
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
|
||||
# projects. New projects should not use this parameter.
|
||||
customArchiveBaseName = magicbees
|
||||
Vendored
BIN
Binary file not shown.
+1
-2
@@ -1,6 +1,5 @@
|
||||
#Wed Jul 02 15:54:47 CDT 2014
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
|
||||
@@ -1,4 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
@@ -6,47 +22,6 @@
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
@@ -61,9 +36,49 @@ while [ -h "$PRG" ] ; do
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
@@ -90,7 +105,7 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
@@ -110,10 +125,11 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
@@ -154,11 +170,19 @@ if $cygwin ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+20
-10
@@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@@ -8,14 +24,14 @@
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
@@ -46,10 +62,9 @@ echo location of your Java installation.
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
@@ -60,11 +75,6 @@ set _SKIP=2
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
before_install:
|
||||
- ./gradlew setupCIWorkspace
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name 'GTNH Maven'
|
||||
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
|
||||
allowInsecureProtocol
|
||||
}
|
||||
maven {
|
||||
name 'ic2'
|
||||
url 'https://maven.ic2.player.to/'
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
maven {
|
||||
url 'https://cursemaven.com'
|
||||
content {
|
||||
includeGroup 'curse.maven'
|
||||
}
|
||||
}
|
||||
}
|
||||
Submodule src/api/java/thaumcraft/api deleted from 4120e665c9.
@@ -6,4 +6,8 @@ public class MagicBeesAPI
|
||||
{
|
||||
// Use this object during or after the Mod.Init phase to add your logic to the Transmutation bee effect.
|
||||
public static ITransmutationEffectController transmutationEffectController;
|
||||
|
||||
// This is a reference to the Tempus aspect. Initialized after MagicBees's post init phase.
|
||||
// Ensure it is not null, and cast it to thaumcraft.api.aspects.Aspect.
|
||||
public static Object thaumcraftAspectTempus;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package magicbees.api.bees;
|
||||
|
||||
public enum AuraChargeType {
|
||||
MUTATION,
|
||||
DEATH,
|
||||
PRODUCTION,
|
||||
;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package magicbees.api.bees;
|
||||
|
||||
public interface IAuraChargeType {
|
||||
}
|
||||
@@ -42,5 +42,5 @@ public interface IMagicApiaryAuraProvider {
|
||||
*
|
||||
* @return True if a charge is given; false otherwise.
|
||||
*/
|
||||
boolean getCharge(IAuraChargeType auraChargeType);
|
||||
boolean getCharge(AuraChargeType auraChargeType);
|
||||
}
|
||||
@@ -1,10 +1,36 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import magicbees.api.MagicBeesAPI;
|
||||
import magicbees.bees.allele.effect.AlleleEffectCrumbling;
|
||||
import magicbees.bees.allele.effect.AlleleEffectCure;
|
||||
import magicbees.bees.allele.effect.AlleleEffectEmpowering;
|
||||
import magicbees.bees.allele.effect.AlleleEffectNodeConversion;
|
||||
import magicbees.bees.allele.effect.AlleleEffectNodeRepair;
|
||||
import magicbees.bees.allele.effect.AlleleEffectPlaceholder;
|
||||
import magicbees.bees.allele.effect.AlleleEffectPotion;
|
||||
import magicbees.bees.allele.effect.AlleleEffectRecharge;
|
||||
import magicbees.bees.allele.effect.AlleleEffectSpawnMob;
|
||||
import magicbees.bees.allele.effect.AlleleEffectSpawnMobWeighted;
|
||||
import magicbees.bees.allele.effect.AlleleEffectSpawnWisp;
|
||||
import magicbees.bees.allele.effect.AlleleEffectTransmuting;
|
||||
import magicbees.bees.allele.effect.TransmutationEffectController;
|
||||
import magicbees.bees.allele.effect.TransmutationEffectLBotaniaLiving;
|
||||
import magicbees.bees.allele.effect.TransmutationEffectRailcraft;
|
||||
import magicbees.bees.allele.effect.TransmutationEffectVanilla;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderArsMagicaFlower;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderAuraNode;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderBookshelf;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderBotania;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderThaumcraftFlower;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import magicbees.main.utils.compat.ThermalExpansionHelper;
|
||||
import magicbees.main.utils.compat.ThermalModsHelper;
|
||||
import net.minecraft.potion.Potion;
|
||||
import thaumcraft.api.nodes.NodeType;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
@@ -12,257 +38,278 @@ import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IAlleleFlowers;
|
||||
import forestry.api.genetics.IAlleleRegistry;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
|
||||
public class Allele implements IAllele {
|
||||
|
||||
private static final String FLOWER_ARS_MAGICA_PLANT = "flowerArsMagicaPlant";
|
||||
private static final String FLOWER_BOTANIA = "flowerBotania";
|
||||
private static final String EFFECT_TE_BLIZZY = "TEBlizzy";
|
||||
private static final String EFFECT_TE_BLITZ = "TEBlitz";
|
||||
private static final String EFFECT_TE_BASALZ = "TEBasalz";
|
||||
private static final String EFFECT_AM_WISP = "AMWisp";
|
||||
private static final String EFFECT_MANA_DRAIN = "ManaDrain";
|
||||
private static final String EFFECT_DREAMING = "Dreaming";
|
||||
private static final String EFFECT_WISPY = "Wispy";
|
||||
private static final String EFFECT_BATTY = "Batty";
|
||||
private static final String EFFECT_BRAINY = "Brainy";
|
||||
private static final String EFFECT_NODE_RAVENING = "NodeRavening";
|
||||
private static final String EFFECT_NODE_PURIFYING = "NodePurifying";
|
||||
private static final String EFFECT_NODE_TAINTING = "NodeTainting";
|
||||
private static final String EFFECT_NODE_REPAIR = "NodeRepair";
|
||||
private static final String EFFECT_NODE_EMPOWER = "NodeEmpower";
|
||||
private static final String EFFECT_VIS_RECHARGE = "VisRecharge";
|
||||
private static final String FLOWERS_AURA_NODE = "AuraNode";
|
||||
private static final String FLOWERS_THAUMCRAFT_PLANT = "ThaumcraftPlant";
|
||||
|
||||
public class Allele implements IAllele
|
||||
{
|
||||
public static AlleleFloat speedBlinding;
|
||||
|
||||
|
||||
public static IAlleleBeeEffect forestryBaseEffect;
|
||||
|
||||
|
||||
public static IAlleleFlowers flowerBookshelf;
|
||||
public static IAlleleFlowers flowerThaumcraft;
|
||||
public static IAlleleFlowers flowerArsMagica;
|
||||
public static IAlleleFlowers flowerAuraNode;
|
||||
|
||||
public static IAlleleFlowers flowerBotania;
|
||||
|
||||
public static IAlleleEffect effectCleansing;
|
||||
public static IAlleleEffect effectDigSpeed;
|
||||
public static IAlleleEffect effectMoveSpeed;
|
||||
public static IAlleleEffect effectSlowSpeed;
|
||||
public static IAlleleEffect effectWithering;
|
||||
public static IAlleleEffect effectVisRecharge;
|
||||
public static IAlleleEffect effectNodeEmpower;
|
||||
public static IAlleleEffect effectNodeRepair;
|
||||
public static IAlleleEffect effectNodeConversionTaint;
|
||||
public static IAlleleEffect effectNodeConversionPure;
|
||||
public static IAlleleEffect effectNodeConversionHungry;
|
||||
public static IAlleleEffect effectTransmuting;
|
||||
public static IAlleleEffect effectCrumbling;
|
||||
public static IAlleleEffect effectInvisibility;
|
||||
|
||||
public static IAlleleEffect spawnBrainyZombie;
|
||||
public static IAlleleEffect spawnWisp;
|
||||
public static IAlleleEffect effectDreaming;
|
||||
|
||||
public static IAlleleEffect spawnWolf;
|
||||
public static IAlleleEffect spawnBats;
|
||||
public static IAlleleEffect spawnCow;
|
||||
public static IAlleleEffect spawnChicken;
|
||||
public static IAlleleEffect spawnPig;
|
||||
public static IAlleleEffect spawnSheep;
|
||||
public static IAlleleEffect spawnCat;
|
||||
public static IAlleleEffect spawnHorse;
|
||||
public static IAlleleEffect spawnGhast;
|
||||
public static IAlleleEffect spawnSpider;
|
||||
public static IAlleleEffect spawnBlaze;
|
||||
public static IAlleleEffect spawnBrainyZombie;
|
||||
public static IAlleleEffect spawnWisp;
|
||||
public static IAlleleEffect spawnBlizz;
|
||||
public static IAlleleEffect spawnBlitz;
|
||||
public static IAlleleEffect spawnBasalz;
|
||||
public static IAlleleEffect spawnManaDrainer;
|
||||
public static IAlleleEffect spawnWispOrHecate;
|
||||
|
||||
/*public static IAlleleEffect effectNodeAttract;
|
||||
public static IAlleleEffect effectNodePurify;
|
||||
public static IAlleleEffect effectNodeFlux;
|
||||
public static IAlleleEffect effectNodeCharge;*/
|
||||
|
||||
public static void setupAdditionalAlleles()
|
||||
{
|
||||
forestryBaseEffect = (IAlleleBeeEffect)getBaseAllele("effectNone");
|
||||
|
||||
Allele.speedBlinding = new AlleleFloat("speedBlinding", 2f, false);
|
||||
|
||||
Allele.flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true);
|
||||
|
||||
if (ThaumcraftHelper.isActive())
|
||||
{
|
||||
Allele.flowerThaumcraft = new AlleleFlower("ThaumcraftPlant", new FlowerProviderThaumcraftFlower(), false);
|
||||
Allele.flowerAuraNode = new AlleleFlower("AuraNode", new FlowerProviderAuraNode(), true);
|
||||
|
||||
Allele.spawnBrainyZombie = new AlleleEffectSpawnMob("Brainy", false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID)
|
||||
.setAggrosPlayerOnSpawn().setThrottle(800).setSpawnsOnPlayerNear(null).setMaxMobsInSpawnZone(2);
|
||||
public static void setupAdditionalAlleles() {
|
||||
forestryBaseEffect = (IAlleleBeeEffect) getBaseAllele("effectNone");
|
||||
IFlowerProvider vanillaFlowers = ((IAlleleFlowers)getBaseAllele("flowersVanilla")).getProvider();
|
||||
|
||||
Allele.spawnBats = new AlleleEffectSpawnMob("Batty", false, ThaumcraftHelper.Entity.FIREBAT.entityID)
|
||||
.setThrottle(300).setSpawnsOnPlayerNear("Bat");
|
||||
speedBlinding = new AlleleFloat("speedBlinding", 2f, false, EnumBeeChromosome.SPEED);
|
||||
flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true);
|
||||
|
||||
Allele.spawnWisp = new AlleleEffectSpawnWisp("Wispy", false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive")
|
||||
.setThrottle(1800).setChanceToSpawn(79);
|
||||
}
|
||||
else
|
||||
{
|
||||
Allele.flowerThaumcraft = Allele.flowerAuraNode = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
|
||||
}
|
||||
|
||||
if (ArsMagicaHelper.isActive())
|
||||
{
|
||||
Allele.flowerArsMagica = new AlleleFlower("flowerArsMagicaPlant", new FlowerProviderArsMagicaFlower(), false);
|
||||
//String id, boolean isDominant, int throttle, String[] mobs, int[] chance
|
||||
Allele.spawnManaDrainer = new AlleleEffectSpawnMobWeighted("ManaDrain", true, 20,
|
||||
new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" },
|
||||
new int[] { 60, 2 });
|
||||
effectCleansing = new AlleleEffectCure("Curative", false);
|
||||
effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false);
|
||||
effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false);
|
||||
effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious();
|
||||
effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious();
|
||||
|
||||
TransmutationEffectController controller = new TransmutationEffectController(
|
||||
new TransmutationEffectRailcraft(),
|
||||
new TransmutationEffectVanilla()
|
||||
);
|
||||
MagicBeesAPI.transmutationEffectController = controller;
|
||||
effectTransmuting = new AlleleEffectTransmuting("Transmuting", true, controller, 200);
|
||||
effectCrumbling = new AlleleEffectCrumbling("Crumbling", true);
|
||||
|
||||
effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false);
|
||||
|
||||
spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan")
|
||||
.setThrottle(2060)
|
||||
.setChanceToSpawn(10)
|
||||
.setMaxMobsInSpawnZone(1);
|
||||
spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step")
|
||||
.setThrottle(400)
|
||||
.setChanceToSpawn(70)
|
||||
.setMaxMobsInSpawnZone(4);
|
||||
spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe")
|
||||
.setThrottle(800)
|
||||
.setChanceToSpawn(60)
|
||||
.setMaxMobsInSpawnZone(2);
|
||||
spawnWolf = new AlleleEffectSpawnMob("Canine", false , "Wolf", "mob.wolf.panting")
|
||||
.setThrottle(650)
|
||||
.setChanceToSpawn(40)
|
||||
.setMaxMobsInSpawnZone(2);
|
||||
spawnPig = new AlleleEffectSpawnMob("Porcine", true, "Pig", "mob.pig.say")
|
||||
.setThrottle(350)
|
||||
.setMaxMobsInSpawnZone(4);
|
||||
spawnCow = new AlleleEffectSpawnMob("Bovine", true, "Cow", "mob.cow.say")
|
||||
.setThrottle(640)
|
||||
.setMaxMobsInSpawnZone(3);
|
||||
spawnChicken = new AlleleEffectSpawnMob("Chicken", true, "Chicken", "mob.chicken.hurt")
|
||||
.setThrottle(20)
|
||||
.setMaxMobsInSpawnZone(20);
|
||||
spawnSheep = new AlleleEffectSpawnMob("Sheep", false, "Sheep", "mob.sheep.say")
|
||||
.setThrottle(450)
|
||||
.setMaxMobsInSpawnZone(5);
|
||||
spawnCat = new AlleleEffectSpawnMob("Catty", false, "Ozelot", "mob.cat.meow")
|
||||
.setThrottle(702)
|
||||
.setChanceToSpawn(60)
|
||||
.setMaxMobsInSpawnZone(2);
|
||||
spawnHorse = new AlleleEffectSpawnMob("Horse", false, "EntityHorse", "mob.horse.idle")
|
||||
.setThrottle(450)
|
||||
.setChanceToSpawn(59)
|
||||
.setMaxMobsInSpawnZone(2);
|
||||
|
||||
if (ThaumcraftHelper.isActive()) {
|
||||
flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, new FlowerProviderThaumcraftFlower(), false);
|
||||
flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, new FlowerProviderAuraNode(), true);
|
||||
|
||||
Allele.spawnWispOrHecate = new AlleleEffectSpawnMobWeighted("AMWisp", true, 20,
|
||||
effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false);
|
||||
effectNodeEmpower = new AlleleEffectEmpowering(EFFECT_NODE_EMPOWER, false);
|
||||
effectNodeRepair = new AlleleEffectNodeRepair(EFFECT_NODE_REPAIR, false);
|
||||
effectNodeConversionTaint = new AlleleEffectNodeConversion(EFFECT_NODE_TAINTING, NodeType.TAINTED, false, 250);
|
||||
effectNodeConversionPure = new AlleleEffectNodeConversion(EFFECT_NODE_PURIFYING, NodeType.PURE, false, 250);
|
||||
effectNodeConversionHungry = new AlleleEffectNodeConversion(EFFECT_NODE_RAVENING, NodeType.HUNGRY, false, 2);
|
||||
|
||||
spawnBrainyZombie = new AlleleEffectSpawnMob(EFFECT_BRAINY, false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID)
|
||||
.setAggrosPlayerOnSpawn()
|
||||
.setThrottle(800)
|
||||
.setSpawnsOnPlayerNear(null)
|
||||
.setMaxMobsInSpawnZone(2);
|
||||
|
||||
spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, ThaumcraftHelper.Entity.FIREBAT.entityID)
|
||||
.setThrottle(300)
|
||||
.setSpawnsOnPlayerNear("Bat");
|
||||
|
||||
spawnWisp = new AlleleEffectSpawnWisp(EFFECT_WISPY, false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive")
|
||||
.setThrottle(1800)
|
||||
.setChanceToSpawn(79);
|
||||
}
|
||||
else {
|
||||
spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, "Bat")
|
||||
.setThrottle(150);
|
||||
|
||||
flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, vanillaFlowers, false);
|
||||
flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, vanillaFlowers, true);Allele.effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false);
|
||||
effectNodeEmpower = new AlleleEffectPlaceholder(EFFECT_NODE_EMPOWER, false);
|
||||
effectNodeRepair = new AlleleEffectPlaceholder(EFFECT_NODE_REPAIR, false);
|
||||
effectNodeConversionTaint = new AlleleEffectPlaceholder(EFFECT_NODE_TAINTING, false);
|
||||
effectNodeConversionPure = new AlleleEffectPlaceholder(EFFECT_NODE_PURIFYING, false);
|
||||
effectNodeConversionHungry = new AlleleEffectPlaceholder(EFFECT_NODE_RAVENING, false);
|
||||
spawnBrainyZombie = new AlleleEffectPlaceholder(EFFECT_BRAINY, false);
|
||||
spawnWisp = new AlleleEffectPlaceholder(EFFECT_WISPY, false);
|
||||
}
|
||||
|
||||
if (BotaniaHelper.isActive()) {
|
||||
flowerBotania = new AlleleFlower(FLOWER_BOTANIA, new FlowerProviderBotania(), true);
|
||||
effectDreaming = new AlleleEffectTransmuting(EFFECT_DREAMING, false,
|
||||
new TransmutationEffectController(new TransmutationEffectLBotaniaLiving()), 100);
|
||||
}
|
||||
else {
|
||||
flowerBotania = new AlleleFlower(FLOWER_BOTANIA, vanillaFlowers, true);
|
||||
effectDreaming = new AlleleEffectPlaceholder(EFFECT_DREAMING, false);
|
||||
}
|
||||
|
||||
if (ArsMagicaHelper.isActive()) {
|
||||
flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, new FlowerProviderArsMagicaFlower(), false);
|
||||
spawnManaDrainer = new AlleleEffectSpawnMobWeighted(EFFECT_MANA_DRAIN, true, 20,
|
||||
new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" },
|
||||
new int[] { 60, 2 }
|
||||
);
|
||||
|
||||
spawnWispOrHecate = new AlleleEffectSpawnMobWeighted(EFFECT_AM_WISP, true, 20,
|
||||
new String[] { ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate" },
|
||||
new int[] { 40, 3 });
|
||||
new int[] { 40, 3 }
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Allele.flowerArsMagica = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
|
||||
Allele.spawnManaDrainer = Allele.spawnWispOrHecate = (IAlleleEffect)Allele.getBaseAllele("effectNone");
|
||||
else {
|
||||
flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, vanillaFlowers, false);
|
||||
spawnManaDrainer = new AlleleEffectPlaceholder(EFFECT_MANA_DRAIN, true);
|
||||
spawnWispOrHecate = new AlleleEffectPlaceholder(EFFECT_AM_WISP, true);
|
||||
}
|
||||
|
||||
/*Allele.effectNodeAttract = new AlleleEffectAuraNodeAttract("NodeAttract", false, 400);
|
||||
Allele.effectNodePurify = new AlleleEffectAuraNodePurify("NodePurify", false, 600, 150);
|
||||
Allele.effectNodeFlux = new AlleleEffectAuraNodeFlux("NodeFlux", true, 300, 300);
|
||||
Allele.effectNodeCharge = new AlleleEffectAuraNodeCharge("NodeCharge", true, 1200);*/
|
||||
|
||||
if (ThermalExpansionHelper.isActive())
|
||||
{
|
||||
Allele.spawnBlizz = new AlleleEffectSpawnMob("TEBlizzy", true, ThermalExpansionHelper.Entity.BLIZZ.entityID)
|
||||
.setThrottle(100).setChanceToSpawn(80);
|
||||
//TODO TE spawning
|
||||
if (ThermalModsHelper.isActive()) {
|
||||
spawnBlizz = new AlleleEffectSpawnMob(EFFECT_TE_BLIZZY, true, ThermalModsHelper.Entity.BLIZZ.entityID, ThermalModsHelper.Entity.BLIZZ.soundName)
|
||||
.setThrottle(100)
|
||||
.setChanceToSpawn(80);
|
||||
spawnBlitz = new AlleleEffectSpawnMob(EFFECT_TE_BLITZ, true, ThermalModsHelper.Entity.BLITZ.entityID, ThermalModsHelper.Entity.BLITZ.soundName)
|
||||
.setThrottle(100)
|
||||
.setChanceToSpawn(80);
|
||||
spawnBasalz = new AlleleEffectSpawnMob(EFFECT_TE_BASALZ, true, ThermalModsHelper.Entity.BASALZ.entityID, ThermalModsHelper.Entity.BASALZ.soundName)
|
||||
.setThrottle(100)
|
||||
.setChanceToSpawn(80);
|
||||
}
|
||||
else
|
||||
{
|
||||
Allele.spawnBlizz = (IAlleleEffect)Allele.getBaseAllele("effectNone");
|
||||
else {
|
||||
spawnBlizz = new AlleleEffectPlaceholder(EFFECT_TE_BLIZZY, true);
|
||||
spawnBlitz = new AlleleEffectPlaceholder(EFFECT_TE_BLITZ, true);
|
||||
spawnBasalz = new AlleleEffectPlaceholder(EFFECT_TE_BASALZ, true);
|
||||
}
|
||||
|
||||
Allele.effectCleansing = new AlleleEffectCure("Curative", false);
|
||||
Allele.effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false);
|
||||
Allele.effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false);
|
||||
Allele.effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious();
|
||||
Allele.effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious();
|
||||
|
||||
Allele.effectTransmuting = new AlleleEffectTransmuting("Transmuting", true);
|
||||
Allele.effectCrumbling = new AlleleEffectCrumbling("Crumbling", true);
|
||||
|
||||
Allele.effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false);
|
||||
|
||||
Allele.spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan")
|
||||
.setThrottle(2060).setChanceToSpawn(10).setMaxMobsInSpawnZone(1);
|
||||
|
||||
Allele.spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step")
|
||||
.setThrottle(400).setChanceToSpawn(70).setMaxMobsInSpawnZone(4);
|
||||
|
||||
Allele.spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe")
|
||||
.setThrottle(800).setChanceToSpawn(60).setMaxMobsInSpawnZone(2);
|
||||
}
|
||||
|
||||
public static void registerDeprecatedAlleleReplacements()
|
||||
{
|
||||
|
||||
public static void registerDeprecatedAlleleReplacements() {
|
||||
IAlleleRegistry registry = AlleleManager.alleleRegistry;
|
||||
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.fertilityHighDominant", Allele.getBaseAllele("fertilityHigh"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.flowerflowerBookshelf", flowerBookshelf);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speedBlinding", speedBlinding);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectCurative", effectCleansing);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectDigSpeed", effectDigSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectMoveSpeed", effectMoveSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectSlowSpeed", effectSlowSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.Ghast", spawnGhast);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.Spider", spawnSpider);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEsoteric", BeeSpecies.ESOTERIC);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMysterious", BeeSpecies.MYSTERIOUS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArcane", BeeSpecies.ARCANE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCharmed", BeeSpecies.CHARMED);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEnchanted", BeeSpecies.ENCHANTED);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSupernatural", BeeSpecies.SUPERNATURAL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPupil", BeeSpecies.PUPIL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesScholarly", BeeSpecies.SCHOLARLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSavant", BeeSpecies.SAVANT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAware", BeeSpecies.AWARE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpirit", BeeSpecies.SPIRIT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSoul", BeeSpecies.SOUL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSkulking", BeeSpecies.SKULKING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGhastly", BeeSpecies.GHASTLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpidery", BeeSpecies.SPIDERY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTimely", BeeSpecies.TIMELY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLordly", BeeSpecies.LORDLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDoctoral", BeeSpecies.DOCTORAL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIron", BeeSpecies.IRON);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGold", BeeSpecies.GOLD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCopper", BeeSpecies.COPPER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTin", BeeSpecies.TIN);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSilver", BeeSpecies.SILVER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLead", BeeSpecies.LEAD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDiamond", BeeSpecies.DIAMOND);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEmerald", BeeSpecies.EMERALD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesApatite", BeeSpecies.APATITE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStark", BeeSpecies.TC_CHAOS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAura", BeeSpecies.TC_AIR);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIgnis", BeeSpecies.TC_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAqua", BeeSpecies.TC_WATER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSolum", BeeSpecies.TC_EARTH);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPraecantatio", BeeSpecies.TC_ORDER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVis", BeeSpecies.TC_VIS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPure", BeeSpecies.TC_PURE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFlux", BeeSpecies.TC_TAINT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesNode", BeeSpecies.TC_ATTRACT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesRejuvenating", BeeSpecies.TC_REJUVENATING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBrainy", BeeSpecies.TC_BRAINY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGossamer", BeeSpecies.TC_WISPY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWispy", BeeSpecies.TC_WISPY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBatty", BeeSpecies.TC_BATTY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesChicken", BeeSpecies.TC_CHICKEN);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBeef", BeeSpecies.TC_BEEF);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPork", BeeSpecies.TC_PORK);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMinium", BeeSpecies.EE_MINIUM);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEssence", BeeSpecies.AM_ESSENCE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesQuintessence", BeeSpecies.AM_QUINTESSENCE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesErde", BeeSpecies.AM_EARTH);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLuft", BeeSpecies.AM_AIR);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFeuer", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWasser", BeeSpecies.AM_WATER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBlitz", BeeSpecies.AM_LIGHTNING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStaude", BeeSpecies.AM_PLANT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEis", BeeSpecies.AM_ICE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMagma", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.speciesMagma", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArkanen", BeeSpecies.AM_ARCANE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVortex", BeeSpecies.AM_VORTEX);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWight", BeeSpecies.AM_WIGHT);
|
||||
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", effectNodeEmpower);
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", effectNodeConversionPure);
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", effectNodeConversionTaint);
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", effectNodeEmpower);
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.speciesTCAttractive", BeeSpecies.TC_EMPOWERING.getSpecies());
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.speciesBMBloodyBMBloody", BeeSpecies.EARTHY.getSpecies());
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.speciesBMBloodyBMBound", BeeSpecies.ARCANE.getSpecies());
|
||||
}
|
||||
|
||||
public static IAlleleBeeSpecies getBaseSpecies(String name)
|
||||
{
|
||||
return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
|
||||
public static IAlleleBeeSpecies getBaseSpecies(String name) {
|
||||
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
|
||||
}
|
||||
|
||||
public static IAlleleBeeSpecies getExtraSpecies(String name)
|
||||
{
|
||||
return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase()).toString());
|
||||
|
||||
public static IAlleleBeeSpecies getExtraSpecies(String name) {
|
||||
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase())
|
||||
.toString());
|
||||
}
|
||||
|
||||
public static IAllele getBaseAllele(String name)
|
||||
{
|
||||
|
||||
public static IAllele getBaseAllele(String name) {
|
||||
return AlleleManager.alleleRegistry.getAllele("forestry." + name);
|
||||
}
|
||||
|
||||
public static IAllele getAllele(String name)
|
||||
{
|
||||
|
||||
public static IAllele getAllele(String name) {
|
||||
return AlleleManager.alleleRegistry.getAllele(name);
|
||||
}
|
||||
|
||||
|
||||
private String uid;
|
||||
private boolean dominant;
|
||||
|
||||
public Allele(String id, boolean isDominant)
|
||||
{
|
||||
public Allele(String id, boolean isDominant, IChromosomeType... chromosomeTypes) {
|
||||
this.uid = "magicbees." + id;
|
||||
this.dominant = isDominant;
|
||||
AlleleManager.alleleRegistry.registerAllele(this);
|
||||
AlleleManager.alleleRegistry.registerAllele(this, chromosomeTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID()
|
||||
{
|
||||
public String getUID() {
|
||||
return this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant()
|
||||
{
|
||||
public boolean isDominant() {
|
||||
return this.dominant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
public String getName() {
|
||||
return LocalizationManager.getLocalizedString(getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName()
|
||||
{
|
||||
public String getUnlocalizedName() {
|
||||
return this.uid;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,12 @@ package magicbees.bees;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
@@ -13,17 +17,24 @@ import forestry.api.genetics.IEffectData;
|
||||
public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
|
||||
{
|
||||
protected int throttle;
|
||||
protected boolean combinable;
|
||||
|
||||
public AlleleEffect(String id, boolean isDominant, int timeout)
|
||||
{
|
||||
super("effect" + id, isDominant);
|
||||
super("effect" + id, isDominant, EnumBeeChromosome.EFFECT);
|
||||
this.throttle = timeout;
|
||||
combinable = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCombinable()
|
||||
{
|
||||
return false;
|
||||
return combinable;
|
||||
}
|
||||
|
||||
public AlleleEffect setIsCombinable(boolean canCombine) {
|
||||
combinable = canCombine;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,25 +69,27 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
|
||||
return Allele.forestryBaseEffect.doFX(genome, storedData, housing);
|
||||
}
|
||||
|
||||
protected List<Entity> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing)
|
||||
@SuppressWarnings("unchecked")
|
||||
protected <T extends Entity> List<T> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing, Class<T> entityClass)
|
||||
{
|
||||
// Get the size of the affected area
|
||||
int[] area = genome.getTerritory();
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
|
||||
// Calculate offset
|
||||
int[] min = new int[3];
|
||||
int[] max = new int[3];
|
||||
min[0] = housing.getXCoord() - area[0] / 2;
|
||||
max[0] = housing.getXCoord() + area[0] / 2;
|
||||
min[0] = coords.posX - area[0] / 2;
|
||||
max[0] = coords.posX + area[0] / 2;
|
||||
|
||||
min[1] = housing.getYCoord() - area[1] / 2;
|
||||
max[1] = housing.getYCoord() + area[1] / 2;
|
||||
min[1] = coords.posY - area[1] / 2;
|
||||
max[1] = coords.posY + area[1] / 2;
|
||||
|
||||
min[2] = housing.getZCoord() - area[2] / 2;
|
||||
max[2] = housing.getZCoord() + area[2] / 2;
|
||||
min[2] = coords.posZ - area[2] / 2;
|
||||
max[2] = coords.posZ + area[2] / 2;
|
||||
|
||||
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
|
||||
return housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, bounds);
|
||||
return (List<T>)housing.getWorld().getEntitiesWithinAABB(entityClass, bounds);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectCure extends AlleleEffect
|
||||
{
|
||||
|
||||
public AlleleEffectCure(String id, boolean isDominant)
|
||||
{
|
||||
super(id, isDominant, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null)
|
||||
{
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
|
||||
|
||||
for (Entity e : entityList)
|
||||
{
|
||||
if (e instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer)e;
|
||||
player.curePotionEffects(new ItemStack(Items.milk_bucket));
|
||||
}
|
||||
}
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.item.ItemArmorApiarist;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectPotion extends AlleleEffect
|
||||
{
|
||||
private int potionId;
|
||||
private int duration;
|
||||
private boolean isMalicious;
|
||||
|
||||
public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant)
|
||||
{
|
||||
super(name, isDominant, 200);
|
||||
this.potionId = potionApplied.id;
|
||||
this.duration = 20 * effectDuration;
|
||||
this.isMalicious = false;
|
||||
}
|
||||
|
||||
public AlleleEffectPotion setMalicious()
|
||||
{
|
||||
this.isMalicious = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null)
|
||||
{
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
|
||||
|
||||
for (Entity e : entityList)
|
||||
{
|
||||
if (e instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer)e;
|
||||
if (this.isMalicious)
|
||||
{
|
||||
int armorPieces = ItemArmorApiarist.getNumberPiecesWorn(player);
|
||||
int finalDuration = this.duration / 4 * (4 - armorPieces);
|
||||
if (finalDuration > 0)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
}
|
||||
}
|
||||
@@ -1,207 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.item.ItemArmorApiarist;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectSpawnMob extends AlleleEffect
|
||||
{
|
||||
protected boolean aggosOnPlayer;
|
||||
protected boolean spawnsWhilePlayerNear;
|
||||
protected String alternateMob;
|
||||
protected String mobName;
|
||||
protected String mobSound;
|
||||
protected int chanceToSpawn;
|
||||
protected int maxMobsInArea;
|
||||
|
||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn)
|
||||
{
|
||||
this(id, isDominant, mobToSpawn, null);
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx)
|
||||
{
|
||||
super(id, isDominant, 200);
|
||||
this.aggosOnPlayer = false;
|
||||
this.mobName = mobToSpawn;
|
||||
this.chanceToSpawn = 100;
|
||||
this.maxMobsInArea = 6;
|
||||
this.mobSound = mobSoundFx;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||
{
|
||||
// Throttle; Ready to spawn
|
||||
storedData = new EffectData(1, 1, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
// Check if we're ready to spawn the mob.
|
||||
if (storedData.getBoolean(0))
|
||||
{
|
||||
World w = housing.getWorld();
|
||||
|
||||
int roll = w.rand.nextInt(100);
|
||||
|
||||
if (roll <= this.chanceToSpawn)
|
||||
{
|
||||
if (this.spawnsWhilePlayerNear)
|
||||
{
|
||||
List<Entity> entities = this.getEntitiesWithinRange(genome, housing);
|
||||
EntityPlayer target = null;
|
||||
for (Entity e : entities)
|
||||
{
|
||||
if (e instanceof EntityPlayer)
|
||||
{
|
||||
target = (EntityPlayer)e;
|
||||
// Check for wearing armor & cancel
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(target) >= 4)
|
||||
{
|
||||
// Full armor suit is treated as "invisible."
|
||||
target = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Let's spawn a mob. =D
|
||||
if (target != null)
|
||||
{
|
||||
storedData.setBoolean(0, !this.spawnMob(genome, target, w, housing, false));
|
||||
}
|
||||
else if (this.alternateMob != null)
|
||||
{
|
||||
storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.mobSound != null && w.rand.nextInt(100) < 35)
|
||||
{
|
||||
int range = genome.getTerritory()[0];
|
||||
double x = housing.getXCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||
range = genome.getTerritory()[1];
|
||||
double y = housing.getYCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||
range = genome.getTerritory()[2];
|
||||
double z = housing.getZCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||
w.playSoundEffect(x, y, z, this.mobSound, 0.5f,
|
||||
(w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f);
|
||||
}
|
||||
storedData.setBoolean(0, true);
|
||||
}
|
||||
}
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate)
|
||||
{
|
||||
boolean spawnedFlag = false;
|
||||
|
||||
|
||||
EntityLiving mob;
|
||||
if (spawnAlternate && this.alternateMob != null)
|
||||
{
|
||||
mob = (EntityLiving)EntityList.createEntityByName(this.alternateMob, world);
|
||||
}
|
||||
else
|
||||
{
|
||||
mob = (EntityLiving)EntityList.createEntityByName(this.mobName, world);
|
||||
}
|
||||
|
||||
if (mob != null)
|
||||
{
|
||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||
|
||||
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
||||
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
|
||||
.expand(8.0D, 4.0D, 8.0D)).size();
|
||||
|
||||
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
||||
|
||||
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere())
|
||||
{
|
||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||
if (this.aggosOnPlayer && player != null)
|
||||
{
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4)
|
||||
{
|
||||
// Protect fully suited player from initial murder intent.
|
||||
mob.setAttackTarget(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return spawnedFlag;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn)
|
||||
{
|
||||
this.spawnsWhilePlayerNear = true;
|
||||
this.alternateMob = alternateMobToSpawn;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setAggrosPlayerOnSpawn()
|
||||
{
|
||||
this.aggosOnPlayer = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setThrottle(int val)
|
||||
{
|
||||
this.throttle = val;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setChanceToSpawn(int value)
|
||||
{
|
||||
this.chanceToSpawn = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value)
|
||||
{
|
||||
this.maxMobsInArea = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
|
||||
{
|
||||
double pos[] = new double[3];
|
||||
pos[0] = housing.getXCoord() + (world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2);
|
||||
pos[1] = housing.getYCoord() + world.rand.nextInt(3) - 1;
|
||||
pos[2] = housing.getZCoord() + (world.rand.nextDouble() * (bee.getTerritory()[2] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2);
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectSpawnMobWeighted extends AlleleEffect
|
||||
{
|
||||
private String[] entityNames;
|
||||
private int[] spawnChance;
|
||||
|
||||
public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance)
|
||||
{
|
||||
super(id, isDominant, throttle);
|
||||
if (mobs.length != chance.length)
|
||||
{
|
||||
throw new IllegalArgumentException("Array lengths must be equal!");
|
||||
}
|
||||
this.entityNames = mobs;
|
||||
this.spawnChance = chance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||
{
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
if (this.spawnMob(genome, housing))
|
||||
{
|
||||
storedData.setInteger(0, 0);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing)
|
||||
{
|
||||
boolean flag = false;
|
||||
|
||||
World w = housing.getWorld();
|
||||
int roll = 0;
|
||||
|
||||
for (int i = 0; i < this.spawnChance.length && !flag; ++i)
|
||||
{
|
||||
roll = 100 - w.rand.nextInt(100) + 1;
|
||||
if (roll < this.spawnChance[i])
|
||||
{
|
||||
flag = true;
|
||||
Entity mob = EntityList.createEntityByName(this.entityNames[i], w);
|
||||
double[] coords = this.randomMobSpawnCoords(w, genome, housing);
|
||||
|
||||
mob.setPositionAndRotation(coords[0], coords[1], coords[2], w.rand.nextFloat() * 360f, 0f);
|
||||
if (mob instanceof EntityLiving)
|
||||
{
|
||||
if (((EntityLiving)mob).getCanSpawnHere())
|
||||
{
|
||||
w.spawnEntityInWorld(mob);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
w.spawnEntityInWorld(mob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
|
||||
{
|
||||
double pos[] = new double[3];
|
||||
pos[0] = housing.getXCoord() + world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2;
|
||||
pos[1] = housing.getYCoord() + world.rand.nextDouble() * (bee.getTerritory()[1] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[1] / 2;
|
||||
pos[2] = housing.getZCoord() + world.rand.nextDouble() * (bee.getTerritory()[2] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2;
|
||||
return pos;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import magicbees.item.ItemArmorApiarist;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
|
||||
public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob
|
||||
{
|
||||
|
||||
private byte[] wispTypes = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 };
|
||||
|
||||
public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay)
|
||||
{
|
||||
super(id, isDominant, mobToSpawn, soundToPlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate)
|
||||
{
|
||||
boolean spawnedFlag = false;
|
||||
|
||||
EntityLiving mob;
|
||||
if (spawnAlternate && this.alternateMob != null)
|
||||
{
|
||||
mob = (EntityLiving)EntityList.createEntityByName(this.alternateMob, world);
|
||||
}
|
||||
else
|
||||
{
|
||||
mob = (EntityLiving)EntityList.createEntityByName(this.mobName, world);
|
||||
}
|
||||
|
||||
if (mob != null)
|
||||
{
|
||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||
|
||||
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
||||
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
|
||||
.expand(8.0D, 4.0D, 8.0D)).size();
|
||||
|
||||
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
||||
|
||||
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere())
|
||||
{
|
||||
// Try some Reflection on TC code. This could be dangerous.
|
||||
try
|
||||
{
|
||||
Class wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName());
|
||||
Field type = wispEntity.getDeclaredField("type");
|
||||
type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{ /*Last time I had a request to post error messages, I regretted it.*/ }
|
||||
|
||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||
if (this.aggosOnPlayer && player != null)
|
||||
{
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4)
|
||||
{
|
||||
// Protect fully suited player from initial murder intent.
|
||||
mob.setAttackTarget(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return spawnedFlag;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectTransmuting extends AlleleEffect
|
||||
{
|
||||
public AlleleEffectTransmuting(String id, boolean isDominant)
|
||||
{
|
||||
super(id, isDominant, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||
{
|
||||
storedData = new magicbees.bees.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
World world = housing.getWorld();
|
||||
// Get random coords within territory
|
||||
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
|
||||
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
|
||||
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
|
||||
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
|
||||
TransmutationEffectController.instance.attemptTransmutations(world, biome,
|
||||
new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)),
|
||||
xCoord, yCoord, zCoord);
|
||||
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import forestry.api.genetics.IAlleleFloat;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
|
||||
public class AlleleFloat extends Allele implements IAlleleFloat
|
||||
{
|
||||
private float value;
|
||||
|
||||
public AlleleFloat(String id, float val, boolean isDominant)
|
||||
public AlleleFloat(String id, float val, boolean isDominant, IChromosomeType... chromosomeTypes)
|
||||
{
|
||||
super(id, isDominant);
|
||||
super(id, isDominant, chromosomeTypes);
|
||||
this.value = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAlleleFlowers;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
|
||||
public class AlleleFlower extends Allele implements IAlleleFlowers
|
||||
{
|
||||
private String uid;
|
||||
private IFlowerProvider provider;
|
||||
|
||||
public AlleleFlower(String uid, IFlowerProvider flowerProvider, boolean isDominant)
|
||||
{
|
||||
super("flower" + uid, isDominant);
|
||||
super("flower" + uid, isDominant, EnumBeeChromosome.FLOWER_PROVIDER);
|
||||
this.provider = flowerProvider;
|
||||
|
||||
AlleleManager.alleleRegistry.registerAllele(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -23,4 +21,9 @@ public class AlleleFlower extends Allele implements IAlleleFlowers
|
||||
return this.provider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.provider.getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
|
||||
public class AlleleInteger extends Allele implements IAlleleInteger
|
||||
{
|
||||
private int value;
|
||||
|
||||
public AlleleInteger(String id, int val, boolean isDominant)
|
||||
{
|
||||
super(id, isDominant);
|
||||
this.value = val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getValue()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import magicbees.api.bees.AuraChargeType;
|
||||
|
||||
public enum AuraCharge {
|
||||
MUTATION(AuraChargeType.MUTATION, 850, 11),
|
||||
DEATH(AuraChargeType.DEATH, 400, 5),
|
||||
PRODUCTION(AuraChargeType.PRODUCTION, 300, 3),
|
||||
;
|
||||
|
||||
public final AuraChargeType type;
|
||||
public final int duration;
|
||||
/** The number of ticks to count between draining vis from the environment **/
|
||||
public final int tickRate;
|
||||
public final int flag;
|
||||
|
||||
AuraCharge(AuraChargeType chargeType, int duration, int tickRate) {
|
||||
this.type = chargeType;
|
||||
this.duration = duration;
|
||||
this.tickRate = tickRate;
|
||||
flag = 1 << ordinal();
|
||||
}
|
||||
|
||||
public static AuraCharge fromChargeType(AuraChargeType type) {
|
||||
for (AuraCharge charge : values()) {
|
||||
if (type == charge.type) {
|
||||
return charge;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import magicbees.api.bees.IAuraChargeType;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public enum AuraChargeType implements IAuraChargeType {
|
||||
MUTATION(Aspect.WATER, 850, 11),
|
||||
DEATH(Aspect.ENTROPY, 400, 5),
|
||||
PRODUCTION(Aspect.AIR, 300, 3);
|
||||
|
||||
public final int duration;
|
||||
public final Aspect aspect;
|
||||
/** The number of ticks to count between draining vis from the environment **/
|
||||
public final int tickRate;
|
||||
public final int flag = 1 << ordinal();
|
||||
|
||||
AuraChargeType(Aspect aspect, int duration, int tickRate) {
|
||||
this.aspect = aspect;
|
||||
this.duration = duration;
|
||||
this.tickRate = tickRate;
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public enum BeeClassification implements IClassification
|
||||
this.uID = "classification." + name.toLowerCase();
|
||||
this.latin = scientific;
|
||||
this.level = EnumClassLevel.GENUS;
|
||||
this.species = new ArrayList();
|
||||
this.species = new ArrayList<IAlleleSpecies>();
|
||||
this.parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
|
||||
AlleleManager.alleleRegistry.registerClassification(this);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,23 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import forestry.api.apiculture.IBeeIconColourProvider;
|
||||
|
||||
public enum BeeIconColourProvider implements IBeeIconColourProvider {
|
||||
RAINBOW {
|
||||
@Override
|
||||
public int getIconColour(int renderPass) {
|
||||
if (renderPass == 0) {
|
||||
int hue = (int) (System.currentTimeMillis() >> 2) % 360;
|
||||
return Color.getHSBColor(hue / 360f, 0.75f, 0.80f).getRGB();
|
||||
} else if (renderPass == 1) {
|
||||
int hue = (int) (System.currentTimeMillis() >> 3) % 360;
|
||||
hue += 60;
|
||||
hue = hue % 360;
|
||||
return Color.getHSBColor(hue / 360f, 0.5f, 0.6f).getRGB();
|
||||
}
|
||||
return 0xffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBeeIconProvider;
|
||||
|
||||
import magicbees.main.CommonProxy;
|
||||
|
||||
public enum BeeIconProvider implements IBeeIconProvider {
|
||||
SKULKING(CommonProxy.DOMAIN + ":bees/skulking/"),
|
||||
DOCTORAL(CommonProxy.DOMAIN + ":bees/doctoral/");
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[][] icons;
|
||||
private final String iconPath;
|
||||
|
||||
BeeIconProvider(String iconPath) {
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister itemMap) {
|
||||
this.icons = new IIcon[EnumBeeType.VALUES.length][3];
|
||||
|
||||
IIcon body1 = itemMap.registerIcon(iconPath + "body1");
|
||||
|
||||
for (int i = 0; i < EnumBeeType.VALUES.length; i++) {
|
||||
EnumBeeType beeType = EnumBeeType.VALUES[i];
|
||||
if (beeType == EnumBeeType.NONE)
|
||||
continue;
|
||||
|
||||
String beeTypeIconPath = iconPath + beeType.toString().toLowerCase(Locale.ENGLISH);
|
||||
|
||||
icons[i][0] = itemMap.registerIcon(beeTypeIconPath + ".outline");
|
||||
icons[i][1] = (beeType != EnumBeeType.LARVAE) ? body1 : itemMap.registerIcon(beeTypeIconPath + ".body");
|
||||
icons[i][2] = itemMap.registerIcon(beeTypeIconPath + ".body2");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(EnumBeeType type, int renderPass) {
|
||||
return icons[type.ordinal()][Math.min(renderPass, 2)];
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,14 @@ import magicbees.item.types.DropType;
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.Tuple;
|
||||
import magicbees.main.utils.compat.ExtraBeesHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
public class BeeManager
|
||||
{
|
||||
@@ -21,20 +26,43 @@ public class BeeManager
|
||||
private static List<Tuple<IAlleleBeeSpecies, Double>> worldgenSpeciesWeights = new ArrayList<Tuple<IAlleleBeeSpecies, Double>>();
|
||||
private static double worldgenSpeciesWeightsTotal = 0;
|
||||
|
||||
public static void ititializeBees()
|
||||
{
|
||||
public static void getBeeRoot() {
|
||||
beeRoot = (IBeeRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
|
||||
|
||||
}
|
||||
|
||||
public static void setupAlleles() {
|
||||
Allele.setupAdditionalAlleles();
|
||||
BeeSpecies.setupBeeSpecies();
|
||||
Allele.registerDeprecatedAlleleReplacements();
|
||||
}
|
||||
|
||||
public static void lateBeeInit()
|
||||
{
|
||||
BeeMutation.setupMutations();
|
||||
BeeProductHelper.initBaseProducts();
|
||||
BeeProductHelper.initOreDictSProducts();
|
||||
|
||||
HiveType.initHiveData();
|
||||
|
||||
beeRoot.setResearchSuitability(Config.drops.getStackForType(DropType.INTELLECT), 0.5f);
|
||||
}
|
||||
|
||||
public static ItemStack getDefaultItemStackForSpecies(IAlleleBeeSpecies beeSpecies, EnumBeeType type) {
|
||||
IBee bee = getBeeFromSpecies(beeSpecies, false);
|
||||
return BeeManager.beeRoot.getMemberStack(bee, type.ordinal());
|
||||
}
|
||||
|
||||
public static IBee getBeeFromSpecies(IAlleleBeeSpecies beeSpecies, boolean applyRainResist) {
|
||||
IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(beeSpecies.getUID());
|
||||
|
||||
if (applyRainResist) {
|
||||
speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate);
|
||||
}
|
||||
|
||||
IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(speciesTemplate);
|
||||
return BeeManager.beeRoot.getBee(null, genome);
|
||||
}
|
||||
|
||||
public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) {
|
||||
Collections.shuffle(worldgenSpeciesWeights);
|
||||
double value = r.nextDouble() * worldgenSpeciesWeightsTotal;
|
||||
@@ -66,16 +94,16 @@ public class BeeManager
|
||||
|
||||
if (ExtraBeesHelper.isActive()) {
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Water"), 12.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Rocky"), 16.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Embittered"), 10.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Rock"), 16.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Basalt"), 10.0));
|
||||
}
|
||||
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL, 20.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL, 20.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS, 13.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED, 6.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL, 10.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION, 1.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL.getSpecies(), 20.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL.getSpecies(), 20.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS.getSpecies(), 13.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED.getSpecies(), 6.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL.getSpecies(), 10.0));
|
||||
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION.getSpecies(), 1.0));
|
||||
|
||||
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
|
||||
worldgenSpeciesWeightsTotal += t.right.doubleValue();
|
||||
|
||||
@@ -1,39 +1,30 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.LogHelper;
|
||||
import magicbees.main.utils.MoonPhase;
|
||||
import magicbees.main.utils.compat.AppliedEnergisticsHelper;
|
||||
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import magicbees.main.utils.compat.EquivalentExchangeHelper;
|
||||
import magicbees.main.utils.compat.ExtraBeesHelper;
|
||||
import magicbees.main.utils.compat.ForestryHelper;
|
||||
import magicbees.main.utils.compat.RedstoneArsenalHelper;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import magicbees.main.utils.compat.ThermalExpansionHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import magicbees.main.utils.compat.ThermalModsHelper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.BiomeDictionary.Type;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeMutation;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.apiculture.IBeeMutationCustom;
|
||||
import forestry.api.apiculture.IBeeMutationFactory;
|
||||
|
||||
public class BeeMutation implements IBeeMutation
|
||||
{
|
||||
public static void setupMutations()
|
||||
{
|
||||
public class BeeMutation {
|
||||
private static IBeeMutationFactory beeMutationFactory = forestry.api.apiculture.BeeManager.beeMutationFactory;
|
||||
|
||||
public static void setupMutations() {
|
||||
IAlleleBeeSpecies baseA, baseB;
|
||||
BeeMutation mutation;
|
||||
IBeeMutationCustom mutation;
|
||||
|
||||
// Forestry + These -> Common
|
||||
|
||||
@@ -41,560 +32,351 @@ public class BeeMutation implements IBeeMutation
|
||||
String[] forestryMundane = new String[] { "Forest", "Meadows", "Modest", "Wintry", "Tropical", "Marshy" };
|
||||
String[] binnieMundane = new String[] { "marble", "rock", "water", "basalt" };
|
||||
|
||||
for (BeeSpecies species : magicMundane)
|
||||
{
|
||||
for (String str : forestryMundane)
|
||||
{
|
||||
new BeeMutation(species, Allele.getBaseSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
|
||||
for (BeeSpecies species : magicMundane) {
|
||||
for (String str : forestryMundane) {
|
||||
beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
|
||||
}
|
||||
if (ExtraBeesHelper.isActive())
|
||||
{
|
||||
for (String str : binnieMundane)
|
||||
{
|
||||
if (ExtraBeesHelper.isActive()) {
|
||||
for (String str : binnieMundane) {
|
||||
LogHelper.info("Registering " + str);
|
||||
try
|
||||
{
|
||||
new BeeMutation(species, Allele.getExtraSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
|
||||
try {
|
||||
beeMutationFactory.createMutation(species.getSpecies(), Allele.getExtraSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
catch (Exception e) {
|
||||
LogHelper.info("Unable to register! This mutation will not be available.");
|
||||
}
|
||||
}
|
||||
}
|
||||
new BeeMutation(species, Allele.getBaseSpecies("Common"), ForestryHelper.getTemplateForestryForSpecies("Cultivated"), 12);
|
||||
new BeeMutation(species, Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, 12);
|
||||
beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies("Common"), ForestryHelper.getTemplateForestryForSpecies("Cultivated"), 12);
|
||||
beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH.getGenome(), 12);
|
||||
}
|
||||
|
||||
new BeeMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, BeeSpecies.ESOTERIC, 10);
|
||||
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.ESOTERIC, BeeSpecies.MYSTERIOUS, 8);
|
||||
new BeeMutation(BeeSpecies.ESOTERIC, BeeSpecies.MYSTERIOUS, BeeSpecies.ARCANE, 8)
|
||||
.setMoonPhaseBonus(MoonPhase.WAXING_CRESCENT, MoonPhase.WAXING_GIBBOUS, 1.2f);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.ESOTERIC.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.ESOTERIC.getSpecies(), BeeSpecies.MYSTERIOUS.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ESOTERIC.getSpecies(), BeeSpecies.MYSTERIOUS.getSpecies(), BeeSpecies.ARCANE.getGenome(), 8)
|
||||
.addMutationCondition(new MoonPhaseMutationBonus(MoonPhase.WAXING_CRESCENT, MoonPhase.WAXING_GIBBOUS, 1.2f));
|
||||
|
||||
new BeeMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, BeeSpecies.CHARMED, 10);
|
||||
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.CHARMED, BeeSpecies.ENCHANTED, 8);
|
||||
new BeeMutation(BeeSpecies.CHARMED, BeeSpecies.ENCHANTED, BeeSpecies.SUPERNATURAL, 8)
|
||||
.setMoonPhaseBonus(MoonPhase.WANING_GIBBOUS, MoonPhase.WANING_CRESCENT, 1.2f);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.CHARMED.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.CHARMED.getSpecies(), BeeSpecies.ENCHANTED.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.CHARMED.getSpecies(), BeeSpecies.ENCHANTED.getSpecies(), BeeSpecies.SUPERNATURAL.getGenome(), 8)
|
||||
.addMutationCondition(new MoonPhaseMutationBonus(MoonPhase.WANING_GIBBOUS, MoonPhase.WANING_CRESCENT, 1.2f));
|
||||
|
||||
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, 7);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getGenome(), 7);
|
||||
|
||||
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.WINDY, 14)
|
||||
.setBlockRequired(Blocks.leaves);
|
||||
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.WATERY, 14)
|
||||
.setBlockRequired(Blocks.water);
|
||||
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.EARTHY, 100)//14)
|
||||
.setBlockRequired(Blocks.brick_block);
|
||||
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.FIREY, 14)
|
||||
.setBlockRequired(Blocks.lava);
|
||||
beeMutationFactory.createMutation(BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.WINDY.getGenome(), 14)
|
||||
.requireResource("treeLeaves");
|
||||
beeMutationFactory.createMutation(BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.WATERY.getGenome(), 14)
|
||||
.requireResource(Blocks.water, 0);
|
||||
beeMutationFactory.createMutation(BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.EARTHY.getGenome(), 14)
|
||||
.requireResource(Blocks.brick_block, 0);
|
||||
beeMutationFactory.createMutation(BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.FIREY.getGenome(), 14)
|
||||
.requireResource(Blocks.lava, 0);
|
||||
|
||||
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.ATTUNED, BeeSpecies.AWARE, 10);
|
||||
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.AWARE, BeeSpecies.SPIRIT, 8);
|
||||
new BeeMutation(BeeSpecies.ATTUNED, BeeSpecies.AWARE, BeeSpecies.SPIRIT, 8);
|
||||
new BeeMutation(BeeSpecies.AWARE, BeeSpecies.SPIRIT, BeeSpecies.SOUL, 7);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.ATTUNED.getSpecies(), BeeSpecies.AWARE.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ATTUNED.getSpecies(), BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getSpecies(), BeeSpecies.SOUL.getGenome(), 7);
|
||||
|
||||
new BeeMutation(Allele.getBaseSpecies("Monastic"), BeeSpecies.ARCANE, BeeSpecies.PUPIL, 10);
|
||||
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.PUPIL, BeeSpecies.SCHOLARLY, 8);
|
||||
new BeeMutation(BeeSpecies.PUPIL, BeeSpecies.SCHOLARLY, BeeSpecies.SAVANT, 6);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Monastic"), BeeSpecies.ARCANE.getSpecies(), BeeSpecies.PUPIL.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.PUPIL.getSpecies(), BeeSpecies.SCHOLARLY.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.PUPIL.getSpecies(), BeeSpecies.SCHOLARLY.getSpecies(), BeeSpecies.SAVANT.getGenome(), 6);
|
||||
|
||||
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ETHEREAL, BeeSpecies.TIMELY, 8);
|
||||
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.TIMELY, BeeSpecies.LORDLY, 8);
|
||||
new BeeMutation(BeeSpecies.TIMELY, BeeSpecies.LORDLY, BeeSpecies.DOCTORAL, 7);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.TIMELY.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.TIMELY.getSpecies(), BeeSpecies.LORDLY.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.TIMELY.getSpecies(), BeeSpecies.LORDLY.getSpecies(), BeeSpecies.DOCTORAL.getGenome(), 7);
|
||||
|
||||
new BeeMutation(BeeSpecies.INFERNAL, BeeSpecies.ELDRITCH, BeeSpecies.HATEFUL, 9)
|
||||
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||
new BeeMutation(BeeSpecies.INFERNAL, BeeSpecies.HATEFUL, BeeSpecies.SPITEFUL, 7)
|
||||
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||
new BeeMutation(Allele.getBaseSpecies("Demonic"), BeeSpecies.SPITEFUL, BeeSpecies.WITHERING, 6)
|
||||
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||
beeMutationFactory.createMutation(BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.HATEFUL.getGenome(), 9)
|
||||
.restrictBiomeType(BiomeDictionary.Type.NETHER);
|
||||
beeMutationFactory.createMutation(BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.HATEFUL.getSpecies(), BeeSpecies.SPITEFUL.getGenome(), 7)
|
||||
.restrictBiomeType(BiomeDictionary.Type.NETHER);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Demonic"), BeeSpecies.SPITEFUL.getSpecies(), BeeSpecies.WITHERING.getGenome(), 6)
|
||||
.restrictBiomeType(BiomeDictionary.Type.NETHER);
|
||||
|
||||
new BeeMutation(Allele.getBaseSpecies("Modest"), BeeSpecies.ELDRITCH, BeeSpecies.SKULKING, 12);
|
||||
new BeeMutation(Allele.getBaseSpecies("Tropical"), BeeSpecies.SKULKING, BeeSpecies.SPIDERY, 10);
|
||||
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.ETHEREAL, BeeSpecies.GHASTLY, 9);
|
||||
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.HATEFUL, BeeSpecies.SMOULDERING, 7)
|
||||
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||
|
||||
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.OBLIVION, BeeSpecies.NAMELESS, 10);
|
||||
new BeeMutation(BeeSpecies.OBLIVION, BeeSpecies.NAMELESS, BeeSpecies.ABANDONED, 8);
|
||||
new BeeMutation(BeeSpecies.NAMELESS, BeeSpecies.ABANDONED, BeeSpecies.FORLORN, 6);
|
||||
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ABANDONED, BeeSpecies.DRACONIC, 6)
|
||||
.setBiomeRequired(BiomeDictionary.Type.END);
|
||||
|
||||
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.ELDRITCH, BeeSpecies.MUTABLE, 12);
|
||||
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.TRANSMUTING, 9);
|
||||
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.CRUMBLING, 9);
|
||||
|
||||
new BeeMutation(BeeSpecies.MYSTICAL, BeeSpecies.MUTABLE, BeeSpecies.INVISIBLE, 15);
|
||||
|
||||
if (BeeSpecies.COPPER.isActive())
|
||||
{
|
||||
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER, 12)
|
||||
.setBlockRequired("blockCopper");
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Modest"), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.SKULKING.getGenome(), 12);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Tropical"), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.SPIDERY.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.BATTY.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.GHASTLY.getGenome(), 9);
|
||||
beeMutationFactory.createMutation(BeeSpecies.GHASTLY.getSpecies(), BeeSpecies.HATEFUL.getSpecies(), BeeSpecies.SMOULDERING.getGenome(), 7)
|
||||
.restrictBiomeType(BiomeDictionary.Type.NETHER);
|
||||
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.MYSTERIOUS.getSpecies(), BeeSpecies.BIGBAD.getGenome(), 7)
|
||||
.addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.FULL));
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.CHICKEN.getGenome(), 12)
|
||||
.restrictBiomeType(Type.FOREST);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.BEEF.getGenome(), 12)
|
||||
.restrictBiomeType(Type.PLAINS);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.PORK.getGenome(), 12)
|
||||
.restrictBiomeType(Type.MOUNTAIN);
|
||||
beeMutationFactory.createMutation(BeeSpecies.PORK.getSpecies(), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.SHEEPISH.getGenome(), 13)
|
||||
.restrictBiomeType(Type.PLAINS);
|
||||
beeMutationFactory.createMutation(BeeSpecies.BEEF.getSpecies(), BeeSpecies.SHEEPISH.getSpecies(), BeeSpecies.HORSE.getGenome(), 12)
|
||||
.restrictBiomeType(Type.PLAINS);
|
||||
beeMutationFactory.createMutation(BeeSpecies.CHICKEN.getSpecies(), BeeSpecies.SPIDERY.getSpecies(), BeeSpecies.CATTY.getGenome(), 15)
|
||||
.restrictBiomeType(Type.JUNGLE);
|
||||
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.BATTY.getGenome(), 9);
|
||||
if (ThaumcraftHelper.isActive()) {
|
||||
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.PUPIL.getSpecies(), BeeSpecies.BRAINY.getGenome(), 9);
|
||||
}
|
||||
if (BeeSpecies.TIN.isActive())
|
||||
{
|
||||
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Forest"), BeeSpecies.TIN, 12)
|
||||
.setBlockRequired("blockTin");
|
||||
else {
|
||||
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.BRAINY.getGenome(), 14);
|
||||
}
|
||||
new BeeMutation(Allele.getBaseSpecies("Common"), Allele.getBaseSpecies("Industrious"), BeeSpecies.IRON, 12)
|
||||
.setBlockRequired(Blocks.iron_block);
|
||||
if (BeeSpecies.LEAD.isActive())
|
||||
{
|
||||
baseA = (BeeSpecies.TIN.isActive()) ? BeeSpecies.TIN : (BeeSpecies.COPPER.isActive()) ? BeeSpecies.COPPER : BeeSpecies.IRON;
|
||||
mutation = new BeeMutation(baseA, Allele.getBaseSpecies("Common"), BeeSpecies.LEAD, 10);
|
||||
if (OreDictionary.getOres("blockLead").size() > 0)
|
||||
{
|
||||
mutation.setBlockRequired("blockLead");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.OBLIVION.getSpecies(), BeeSpecies.NAMELESS.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.OBLIVION.getSpecies(), BeeSpecies.NAMELESS.getSpecies(), BeeSpecies.ABANDONED.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.NAMELESS.getSpecies(), BeeSpecies.ABANDONED.getSpecies(), BeeSpecies.FORLORN.getGenome(), 6);
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ABANDONED.getSpecies(), BeeSpecies.DRACONIC.getGenome(), 6)
|
||||
.restrictBiomeType(BiomeDictionary.Type.END);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.UNUSUAL.getSpecies(), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.MUTABLE.getGenome(), 12);
|
||||
beeMutationFactory.createMutation(BeeSpecies.UNUSUAL.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.TRANSMUTING.getGenome(), 9);
|
||||
beeMutationFactory.createMutation(BeeSpecies.UNUSUAL.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.CRUMBLING.getGenome(), 9);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.MYSTICAL.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.INVISIBLE.getGenome(), 15);
|
||||
|
||||
if (BeeSpecies.COPPER.isActive()) {
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER.getGenome(), 12)
|
||||
.requireResource("blockCopper");
|
||||
}
|
||||
|
||||
if (BeeSpecies.TIN.isActive()) {
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Forest"), BeeSpecies.TIN.getGenome(), 12)
|
||||
.requireResource("blockTin");
|
||||
}
|
||||
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Common"), Allele.getBaseSpecies("Industrious"), BeeSpecies.IRON.getGenome(), 12)
|
||||
.requireResource(Blocks.iron_block, 0);
|
||||
|
||||
if (BeeSpecies.LEAD.isActive()) {
|
||||
baseA = (BeeSpecies.TIN.isActive()) ? BeeSpecies.TIN.getSpecies() : (BeeSpecies.COPPER.isActive()) ? BeeSpecies.COPPER.getSpecies() : BeeSpecies.IRON.getSpecies();
|
||||
mutation = beeMutationFactory.createMutation(baseA, Allele.getBaseSpecies("Common"), BeeSpecies.LEAD.getGenome(), 10);
|
||||
if (OreDictionary.getOres("blockLead").size() > 0) {
|
||||
mutation.requireResource("blockLead");
|
||||
}
|
||||
}
|
||||
if (BeeSpecies.SILVER.isActive())
|
||||
{
|
||||
mutation = new BeeMutation(Allele.getBaseSpecies("Imperial"), Allele.getBaseSpecies("Modest"), BeeSpecies.SILVER, 8);
|
||||
if (OreDictionary.getOres("blockSilver").size() > 0)
|
||||
{
|
||||
mutation.setBlockRequired("blockSilver");
|
||||
}
|
||||
}
|
||||
baseA = (BeeSpecies.EE_MINIUM.isActive()) ? BeeSpecies.EE_MINIUM : Allele.getBaseSpecies("Imperial");
|
||||
baseB = (BeeSpecies.LEAD.isActive()) ? BeeSpecies.LEAD : BeeSpecies.IRON;
|
||||
new BeeMutation(baseA, baseB, BeeSpecies.GOLD, 8)
|
||||
.setBlockRequired(Blocks.gold_block);
|
||||
|
||||
if (BeeSpecies.ALUMINUM.isActive())
|
||||
{
|
||||
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ALUMINUM, 10)
|
||||
.setBlockRequired("blockAluminum");
|
||||
}
|
||||
if (BeeSpecies.ARDITE.isActive())
|
||||
{
|
||||
new BeeMutation(Allele.getBaseSpecies("Industrious"), BeeSpecies.INFERNAL, BeeSpecies.ARDITE, 9)
|
||||
.setBlockRequired("blockArdite");
|
||||
}
|
||||
if (BeeSpecies.COBALT.isActive())
|
||||
{
|
||||
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL, BeeSpecies.COBALT, 9)
|
||||
.setBlockRequired("blockCobalt");
|
||||
}
|
||||
if (BeeSpecies.MANYULLYN.isActive())
|
||||
{
|
||||
new BeeMutation(BeeSpecies.ARDITE, BeeSpecies.COBALT, BeeSpecies.MANYULLYN, 9)
|
||||
.setBlockRequired("blockManyullyn");
|
||||
}
|
||||
|
||||
new BeeMutation(Allele.getBaseSpecies("Austere"), BeeSpecies.GOLD, BeeSpecies.DIAMOND, 7)
|
||||
.setBlockRequired(Blocks.diamond_block);
|
||||
baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER : Allele.getBaseSpecies("Imperial");
|
||||
new BeeMutation(Allele.getBaseSpecies("Austere"), baseA, BeeSpecies.EMERALD, 6)
|
||||
.setBlockRequired(Blocks.emerald_block);
|
||||
new BeeMutation(Allele.getBaseSpecies("Rural"), BeeSpecies.COPPER, BeeSpecies.APATITE, 12)
|
||||
.setBlockRequired("blockApatite");
|
||||
|
||||
if (ThaumcraftHelper.isActive())
|
||||
{
|
||||
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.WINDY, BeeSpecies.TC_AIR, 8)
|
||||
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.AIR.ordinal());
|
||||
new BeeMutation(BeeSpecies.FIREY, BeeSpecies.FIREY, BeeSpecies.TC_FIRE, 8)
|
||||
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.FIRE.ordinal());
|
||||
new BeeMutation(BeeSpecies.WATERY, BeeSpecies.WATERY, BeeSpecies.TC_WATER, 8)
|
||||
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.WATER.ordinal());
|
||||
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.EARTHY, BeeSpecies.TC_EARTH, 8)
|
||||
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.EARTH.ordinal());
|
||||
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.ARCANE, BeeSpecies.TC_ORDER, 8)
|
||||
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.ORDER.ordinal());
|
||||
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.SUPERNATURAL, BeeSpecies.TC_CHAOS, 8)
|
||||
.setBlockAndMetaRequired(Config.tcCrystal, ThaumcraftHelper.ShardType.CHAOS.ordinal());
|
||||
|
||||
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.WINDY, BeeSpecies.TC_BATTY, 9);
|
||||
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.PUPIL, BeeSpecies.TC_BRAINY, 9);
|
||||
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.GHASTLY, BeeSpecies.TC_WISPY, 9)
|
||||
.setMoonPhaseRestricted(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT);
|
||||
|
||||
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_CHICKEN, 12)
|
||||
.setBiomeRequired(Type.FOREST);
|
||||
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_BEEF, 12)
|
||||
.setBiomeRequired(Type.PLAINS);
|
||||
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.TC_PORK, 12)
|
||||
.setBiomeRequired(Type.MOUNTAIN);
|
||||
}
|
||||
|
||||
if (ArsMagicaHelper.isActive())
|
||||
{
|
||||
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.ETHEREAL, BeeSpecies.AM_ESSENCE, 10);
|
||||
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_QUINTESSENCE, 7);
|
||||
|
||||
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.WINDY, BeeSpecies.AM_AIR, 10);
|
||||
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, 10);
|
||||
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.FIREY, BeeSpecies.AM_FIRE, 10);
|
||||
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.WATERY, BeeSpecies.AM_WATER, 10);
|
||||
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.ETHEREAL, BeeSpecies.AM_ARCANE, 10);
|
||||
|
||||
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.AM_AIR, BeeSpecies.AM_LIGHTNING, 8);
|
||||
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, BeeSpecies.AM_PLANT, 8);
|
||||
new BeeMutation(BeeSpecies.WATERY, BeeSpecies.AM_WATER, BeeSpecies.AM_ICE, 8);
|
||||
|
||||
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_VORTEX, 8);
|
||||
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.GHASTLY, BeeSpecies.AM_WIGHT, 8);
|
||||
}
|
||||
|
||||
if (EquivalentExchangeHelper.isActive())
|
||||
{
|
||||
new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE, BeeSpecies.EE_MINIUM, 8);
|
||||
}
|
||||
|
||||
if (RedstoneArsenalHelper.isActive())
|
||||
{
|
||||
new BeeMutation(BeeSpecies.TE_ELECTRUM, BeeSpecies.TE_DESTABILIZED, BeeSpecies.RSA_FLUXED, 10)
|
||||
.setBlockRequired("blockElectrumFlux");
|
||||
}
|
||||
|
||||
if (ThermalExpansionHelper.isActive())
|
||||
{
|
||||
new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12)
|
||||
.setBlockRequired("blockBronze");
|
||||
|
||||
new BeeMutation(BeeSpecies.GOLD, BeeSpecies.SILVER, BeeSpecies.TE_ELECTRUM, 10)
|
||||
.setBlockRequired("blockElectrum");
|
||||
|
||||
new BeeMutation(BeeSpecies.IRON, BeeSpecies.ESOTERIC, BeeSpecies.TE_NICKEL, 14)
|
||||
.setBlockRequired("blockNickel");
|
||||
|
||||
new BeeMutation(BeeSpecies.IRON, BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, 14)
|
||||
.setBlockRequired("blockInvar");
|
||||
|
||||
new BeeMutation(BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, BeeSpecies.TE_PLATINUM, 10)
|
||||
.setBlockRequired("blockPlatinum");
|
||||
|
||||
new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12)
|
||||
.setBlockRequired("blockBronze");
|
||||
|
||||
new BeeMutation(BeeSpecies.SPITEFUL, BeeSpecies.TIN, BeeSpecies.TE_COAL, 12)
|
||||
.setBlockRequired(Blocks.coal_ore);
|
||||
|
||||
new BeeMutation(BeeSpecies.SPITEFUL, Allele.getBaseSpecies("Industrious"), BeeSpecies.TE_DESTABILIZED, 12)
|
||||
.setBlockRequired(Blocks.redstone_ore);
|
||||
|
||||
new BeeMutation(BeeSpecies.SMOULDERING, BeeSpecies.INFERNAL, BeeSpecies.TE_LUX, 12)
|
||||
.setBlockRequired(Blocks.glowstone);
|
||||
|
||||
new BeeMutation(BeeSpecies.SMOULDERING, Allele.getBaseSpecies("Austere"), BeeSpecies.TE_DANTE, 12)
|
||||
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||
|
||||
new BeeMutation(BeeSpecies.TE_DANTE, BeeSpecies.TE_COAL, BeeSpecies.TE_PYRO, 8)
|
||||
.setBiomeRequired(BiomeDictionary.Type.NETHER);
|
||||
|
||||
new BeeMutation(BeeSpecies.SKULKING, Allele.getBaseSpecies("Wintry"), BeeSpecies.TE_BLIZZY, 12);
|
||||
|
||||
new BeeMutation(BeeSpecies.TE_BLIZZY, Allele.getBaseSpecies("Icy"), BeeSpecies.TE_GELID, 8);
|
||||
|
||||
new BeeMutation(BeeSpecies.TE_PLATINUM, BeeSpecies.OBLIVION, BeeSpecies.TE_WINSOME, 12);
|
||||
|
||||
new BeeMutation(BeeSpecies.TE_WINSOME, BeeSpecies.TE_COAL, BeeSpecies.TE_ENDEARING, 8)
|
||||
.setBlockRequired("blockEnderium");
|
||||
}
|
||||
}
|
||||
|
||||
private IAllele parent1;
|
||||
private IAllele parent2;
|
||||
private IAllele mutationTemplate[];
|
||||
private int baseChance;
|
||||
private boolean isSecret;
|
||||
private boolean isMoonRestricted;
|
||||
private MoonPhase moonPhaseStart;
|
||||
private MoonPhase moonPhaseEnd;
|
||||
private float moonPhaseMutationBonus;
|
||||
private boolean requiresBlock;
|
||||
private Block requiredBlock;
|
||||
private int requiredBlockMeta;
|
||||
private String requiredBlockOreDictEntry;
|
||||
private String requiredBlockName;
|
||||
private BiomeDictionary.Type requiredBiomeType;
|
||||
|
||||
public BeeMutation(IAlleleBeeSpecies species0, IAlleleBeeSpecies species1, BeeSpecies resultSpecies, int percentChance)
|
||||
{
|
||||
this(species0, species1, resultSpecies.getGenome(), percentChance);
|
||||
}
|
||||
|
||||
public BeeMutation(IAlleleBeeSpecies species0, IAlleleBeeSpecies species1, IAllele[] resultSpeciesGenome, int percentChance)
|
||||
{
|
||||
this.parent1 = species0;
|
||||
this.parent2 = species1;
|
||||
this.mutationTemplate = resultSpeciesGenome;
|
||||
this.baseChance = percentChance;
|
||||
this.isSecret = false;
|
||||
this.isMoonRestricted = false;
|
||||
this.moonPhaseMutationBonus = -1f;
|
||||
//this.nodeType = null;
|
||||
this.requiresBlock = false;
|
||||
this.requiredBlockMeta = OreDictionary.WILDCARD_VALUE;
|
||||
this.requiredBlockOreDictEntry = null;
|
||||
this.requiredBiomeType = null;
|
||||
this.requiredBlockName = null;
|
||||
|
||||
BeeManager.beeRoot.registerMutation(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1)
|
||||
{
|
||||
float finalChance = 0f;
|
||||
float chance = this.baseChance * 1f;
|
||||
|
||||
if (this.arePartners(allele0, allele1))
|
||||
{
|
||||
// This mutation applies. Continue calculation.
|
||||
if (this.moonPhaseStart != null && this.moonPhaseEnd != null)
|
||||
{
|
||||
// Only occurs during the phases.
|
||||
if (this.isMoonRestricted && !MoonPhase.getMoonPhase(housing.getWorld()).isBetween(this.moonPhaseStart, this.moonPhaseEnd))
|
||||
{
|
||||
chance = 0;
|
||||
}
|
||||
else if (this.moonPhaseMutationBonus != -1f)
|
||||
{
|
||||
// There is a bonus to this mutation during moon phases...
|
||||
if (MoonPhase.getMoonPhase(housing.getWorld()).isBetween(this.moonPhaseStart, this.moonPhaseEnd))
|
||||
{
|
||||
chance = (int)(chance * this.moonPhaseMutationBonus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.requiresBlock)
|
||||
{
|
||||
Block blockBelow;
|
||||
int blockMeta;
|
||||
int i = 1;
|
||||
do
|
||||
{
|
||||
blockBelow = housing.getWorld().getBlock(housing.getXCoord(), housing.getYCoord() - i,
|
||||
housing.getZCoord());
|
||||
blockMeta = housing.getWorld().getBlockMetadata(housing.getXCoord(), housing.getYCoord() - i, housing.getZCoord());
|
||||
++i;
|
||||
}
|
||||
while (blockBelow != null && (blockBelow instanceof IBeeHousing || blockBelow == Config.fAlvearyBlock));
|
||||
|
||||
if (this.requiredBlockOreDictEntry != null)
|
||||
{
|
||||
int[] dicId = OreDictionary.getOreIDs(new ItemStack(blockBelow, 1, blockMeta));
|
||||
if (dicId.length != 0)
|
||||
{
|
||||
if (!OreDictionary.getOreName(dicId[0]).equals(this.requiredBlockOreDictEntry))
|
||||
{
|
||||
chance = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
chance = 0;
|
||||
}
|
||||
}
|
||||
else if (this.requiredBlock != blockBelow || (this.requiredBlockMeta != OreDictionary.WILDCARD_VALUE &&
|
||||
this.requiredBlockMeta != blockMeta))
|
||||
{
|
||||
chance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.requiredBiomeType != null)
|
||||
{
|
||||
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(housing.getWorld().getBiomeGenForCoords(housing.getXCoord(), housing.getZCoord()));
|
||||
boolean found = false;
|
||||
for (int i = 0; i < types.length; ++i)
|
||||
{
|
||||
if (this.requiredBiomeType == types[i])
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
chance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
finalChance = Math.round(chance
|
||||
* housing.getMutationModifier((IBeeGenome)genome0,
|
||||
(IBeeGenome)genome1, chance)
|
||||
* BeeManager.beeRoot.getBeekeepingMode(housing.getWorld())
|
||||
.getMutationModifier((IBeeGenome)genome0,
|
||||
(IBeeGenome)genome1, chance));
|
||||
}
|
||||
|
||||
return finalChance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getAllele0()
|
||||
{
|
||||
return parent1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getAllele1()
|
||||
{
|
||||
return parent2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele[] getTemplate()
|
||||
{
|
||||
return mutationTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBaseChance()
|
||||
{
|
||||
return baseChance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPartner(IAllele allele)
|
||||
{
|
||||
return parent1.getUID().equals(allele.getUID()) || parent2.getUID().equals(allele.getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getPartner(IAllele allele)
|
||||
{
|
||||
IAllele val = parent1;
|
||||
if (val.getUID().equals(allele.getUID()))
|
||||
val = parent2;
|
||||
return val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getSpecialConditions()
|
||||
{
|
||||
ArrayList<String> conditions = new ArrayList<String>();
|
||||
|
||||
if (this.isMoonRestricted && moonPhaseStart != null && moonPhaseEnd != null)
|
||||
{
|
||||
if (moonPhaseStart != moonPhaseEnd)
|
||||
{
|
||||
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhase"),
|
||||
moonPhaseStart.getLocalizedName(), moonPhaseEnd.getLocalizedName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhaseSingle"),
|
||||
moonPhaseStart.getLocalizedName()));
|
||||
if (BeeSpecies.SILVER.isActive()) {
|
||||
mutation = beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), Allele.getBaseSpecies("Modest"), BeeSpecies.SILVER.getGenome(), 8);
|
||||
if (OreDictionary.getOres("blockSilver").size() > 0) {
|
||||
mutation.requireResource("blockSilver");
|
||||
}
|
||||
}
|
||||
|
||||
if (this.requiresBlock)
|
||||
{
|
||||
if (this.requiredBlockName != null)
|
||||
{
|
||||
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"),
|
||||
LocalizationManager.getLocalizedString(this.requiredBlockName)));
|
||||
baseA = (BeeSpecies.EE_MINIUM.isActive()) ? BeeSpecies.EE_MINIUM.getSpecies() : Allele.getBaseSpecies("Imperial");
|
||||
baseB = (BeeSpecies.LEAD.isActive()) ? BeeSpecies.LEAD.getSpecies() : BeeSpecies.IRON.getSpecies();
|
||||
beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.GOLD.getGenome(), 8)
|
||||
.requireResource(Blocks.gold_block, 0);
|
||||
|
||||
if (BeeSpecies.ALUMINUM.isActive()) {
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ALUMINUM.getGenome(), 10)
|
||||
.requireResource("blockAluminum");
|
||||
}
|
||||
|
||||
if (BeeSpecies.ARDITE.isActive()) {
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.ARDITE.getGenome(), 9)
|
||||
.requireResource("blockArdite");
|
||||
}
|
||||
|
||||
if (BeeSpecies.COBALT.isActive()) {
|
||||
boolean hasTConCobalt = OreDictionary.getOres("nuggetCobalt").size() > 0 && OreDictionary.getOres("blockCobalt").size() > 0;
|
||||
boolean hasNaturalCobalt = OreDictionary.getOres("nuggetNaturalCobalt").size() > 0 && OreDictionary.getOres("blockNaturalCobalt").size() > 0;
|
||||
if (hasTConCobalt) {
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 11)
|
||||
.requireResource("blockCobalt");
|
||||
}
|
||||
else if (this.requiredBlockOreDictEntry != null)
|
||||
{
|
||||
ArrayList<ItemStack> ores = OreDictionary.getOres(this.requiredBlockOreDictEntry);
|
||||
if (ores.size() > 0)
|
||||
{
|
||||
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"), ores.get(0).getDisplayName()));
|
||||
}
|
||||
if (hasNaturalCobalt) {
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 11)
|
||||
.requireResource("blockNaturalCobalt");
|
||||
}
|
||||
else
|
||||
{
|
||||
int meta = OreDictionary.WILDCARD_VALUE;
|
||||
if (this.requiredBlockMeta != OreDictionary.WILDCARD_VALUE)
|
||||
{
|
||||
meta = this.requiredBlockMeta;
|
||||
}
|
||||
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"),
|
||||
new ItemStack(this.requiredBlock, 1, meta).getDisplayName()));
|
||||
if (!(hasTConCobalt || hasNaturalCobalt)) {
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 7);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.requiredBiomeType != null)
|
||||
{
|
||||
String biomeName = this.requiredBiomeType.name().substring(0, 1) + this.requiredBiomeType.name().substring(1).toLowerCase();
|
||||
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBiome"), biomeName));
|
||||
if (BeeSpecies.MANYULLYN.isActive()) {
|
||||
beeMutationFactory.createMutation(BeeSpecies.ARDITE.getSpecies(), BeeSpecies.COBALT.getSpecies(), BeeSpecies.MANYULLYN.getGenome(), 9)
|
||||
.requireResource("blockManyullyn");
|
||||
}
|
||||
|
||||
return conditions;
|
||||
if (BeeSpecies.OSMIUM.isActive()) {
|
||||
baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER.getSpecies() : Allele.getBaseSpecies("Imperial");
|
||||
baseB = (BeeSpecies.COBALT.isActive()) ? BeeSpecies.COBALT.getSpecies() : BeeSpecies.INFERNAL.getSpecies();
|
||||
mutation = beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.OSMIUM.getGenome(), 11);
|
||||
if (OreDictionary.getOres("blockOsmium").size() > 0) {
|
||||
mutation.requireResource("blockOsmium");
|
||||
}
|
||||
}
|
||||
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Austere"), BeeSpecies.GOLD.getSpecies(), BeeSpecies.DIAMOND.getGenome(), 7)
|
||||
.requireResource("blockDiamond");
|
||||
baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER.getSpecies() : Allele.getBaseSpecies("Imperial");
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Austere"), baseA, BeeSpecies.EMERALD.getGenome(), 6)
|
||||
.requireResource("blockEmerald");
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Rural"), BeeSpecies.COPPER.getSpecies(), BeeSpecies.APATITE.getGenome(), 12)
|
||||
.requireResource("blockApatite");
|
||||
|
||||
if (BeeSpecies.SILICON.isActive()) {
|
||||
baseA = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE.getSpecies() : BeeSpecies.EARTHY.getSpecies();
|
||||
beeMutationFactory.createMutation(baseA, BeeSpecies.IRON.getSpecies(), BeeSpecies.SILICON.getGenome(), 17);
|
||||
}
|
||||
|
||||
if (BeeSpecies.CERTUS.isActive()) {
|
||||
baseA = (BeeSpecies.SILICON.isActive()) ? BeeSpecies.SILICON.getSpecies() : BeeSpecies.IRON.getSpecies();
|
||||
baseB = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE.getSpecies() : BeeSpecies.EARTHY.getSpecies();
|
||||
beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.CERTUS.getGenome(), 13);
|
||||
}
|
||||
|
||||
if (BeeSpecies.FLUIX.isActive()) {
|
||||
if (BeeSpecies.CERTUS.isActive()) {
|
||||
baseA = BeeSpecies.CERTUS.getSpecies();
|
||||
}
|
||||
else if (BeeSpecies.SILICON.isActive()) {
|
||||
baseA = BeeSpecies.SILICON.getSpecies();
|
||||
}
|
||||
else {
|
||||
baseA = BeeSpecies.IRON.getSpecies();
|
||||
}
|
||||
baseB = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE.getSpecies() : BeeSpecies.EARTHY.getSpecies();
|
||||
beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.FLUIX.getGenome(), 17);
|
||||
}
|
||||
|
||||
if (ThaumcraftHelper.isActive()) {
|
||||
beeMutationFactory.createMutation(BeeSpecies.WINDY.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.TC_AIR.getGenome(), 8)
|
||||
.requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.AIR.ordinal());
|
||||
beeMutationFactory.createMutation(BeeSpecies.FIREY.getSpecies(), BeeSpecies.FIREY.getSpecies(), BeeSpecies.TC_FIRE.getGenome(), 8)
|
||||
.requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.FIRE.ordinal());
|
||||
beeMutationFactory.createMutation(BeeSpecies.WATERY.getSpecies(), BeeSpecies.WATERY.getSpecies(), BeeSpecies.TC_WATER.getGenome(), 8)
|
||||
.requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.WATER.ordinal());
|
||||
beeMutationFactory.createMutation(BeeSpecies.EARTHY.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.TC_EARTH.getGenome(), 8)
|
||||
.requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.EARTH.ordinal());
|
||||
beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.ARCANE.getSpecies(), BeeSpecies.TC_ORDER.getGenome(), 8)
|
||||
.requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.ORDER.ordinal());
|
||||
beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.TC_CHAOS.getGenome(), 8)
|
||||
.requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.CHAOS.ordinal());
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.TC_VIS.getGenome(), 9)
|
||||
.addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.WAXING_HALF, MoonPhase.WANING_HALF));
|
||||
beeMutationFactory.createMutation(BeeSpecies.ATTUNED.getSpecies(), BeeSpecies.TC_VIS.getSpecies(), BeeSpecies.TC_REJUVENATING.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.TC_VIS.getSpecies(), BeeSpecies.TC_REJUVENATING.getSpecies(), BeeSpecies.TC_EMPOWERING.getGenome(), 6)
|
||||
.addMutationCondition(new MoonPhaseMutationBonus(MoonPhase.FULL, 1.322f));
|
||||
beeMutationFactory.createMutation(BeeSpecies.TC_REJUVENATING.getSpecies(), BeeSpecies.TC_EMPOWERING.getSpecies(), BeeSpecies.TC_NEXUS.getGenome(), 10)
|
||||
.restrictBiomeType(Type.MAGICAL)
|
||||
.requireResource(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.ordinal());
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.TRANSMUTING.getSpecies(), BeeSpecies.TC_EMPOWERING.getSpecies(), BeeSpecies.TC_TAINT.getGenome(), 11)
|
||||
.addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.NEW));
|
||||
beeMutationFactory.createMutation(BeeSpecies.TRANSMUTING.getSpecies(), BeeSpecies.TC_REJUVENATING.getSpecies(), BeeSpecies.TC_PURE.getGenome(), 8)
|
||||
.restrictBiomeType(Type.MAGICAL)
|
||||
.addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.NEW));
|
||||
beeMutationFactory.createMutation(BeeSpecies.BIGBAD.getSpecies(), BeeSpecies.TC_VIS.getSpecies(), BeeSpecies.TC_HUNGRY.getGenome(), 20);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.GHASTLY.getSpecies(), BeeSpecies.TC_WISPY.getGenome(), 9)
|
||||
.addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT));
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.TC_TAINT.getSpecies(), BeeSpecies.TC_VOID.getGenome(), 5)
|
||||
.restrictBiomeType(Type.MAGICAL)
|
||||
.requireNight();
|
||||
}
|
||||
|
||||
if (ArsMagicaHelper.isActive()) {
|
||||
beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.AM_ESSENCE.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.AM_QUINTESSENCE.getGenome(), 7);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.AM_AIR.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.AM_EARTH.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.FIREY.getSpecies(), BeeSpecies.AM_FIRE.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.WATERY.getSpecies(), BeeSpecies.AM_WATER.getGenome(), 10);
|
||||
beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.AM_ARCANE.getGenome(), 10);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.WINDY.getSpecies(), BeeSpecies.AM_AIR.getSpecies(), BeeSpecies.AM_LIGHTNING.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.EARTHY.getSpecies(), BeeSpecies.AM_EARTH.getSpecies(), BeeSpecies.AM_PLANT.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.WATERY.getSpecies(), BeeSpecies.AM_WATER.getSpecies(), BeeSpecies.AM_ICE.getGenome(), 8);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.AM_VORTEX.getGenome(), 8);
|
||||
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.GHASTLY.getSpecies(), BeeSpecies.AM_WIGHT.getGenome(), 8);
|
||||
}
|
||||
|
||||
if (EquivalentExchangeHelper.isActive()) {
|
||||
beeMutationFactory.createMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.EE_MINIUM.getGenome(), 8);
|
||||
}
|
||||
|
||||
if (RedstoneArsenalHelper.isActive()) {
|
||||
beeMutationFactory.createMutation(BeeSpecies.TE_ELECTRUM.getSpecies(), BeeSpecies.TE_DESTABILIZED.getSpecies(), BeeSpecies.RSA_FLUXED.getGenome(), 10)
|
||||
.requireResource("blockElectrumFlux");
|
||||
}
|
||||
|
||||
if (ThermalModsHelper.isActive()) {
|
||||
beeMutationFactory.createMutation(BeeSpecies.TIN.getSpecies(), BeeSpecies.COPPER.getSpecies(), BeeSpecies.TE_BRONZE.getGenome(), 12)
|
||||
.requireResource("blockBronze");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.GOLD.getSpecies(), BeeSpecies.SILVER.getSpecies(), BeeSpecies.TE_ELECTRUM.getGenome(), 10)
|
||||
.requireResource("blockElectrum");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.ESOTERIC.getSpecies(), BeeSpecies.TE_NICKEL.getGenome(), 14)
|
||||
.requireResource("blockNickel");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.TE_NICKEL.getSpecies(), BeeSpecies.TE_INVAR.getGenome(), 14)
|
||||
.requireResource("blockInvar");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.TE_NICKEL.getSpecies(), BeeSpecies.TE_INVAR.getSpecies(), BeeSpecies.TE_PLATINUM.getGenome(), 10)
|
||||
.requireResource("blockPlatinum");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.TIN.getSpecies(), BeeSpecies.COPPER.getSpecies(), BeeSpecies.TE_BRONZE.getGenome(), 12)
|
||||
.requireResource("blockBronze");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.SPITEFUL.getSpecies(), BeeSpecies.TIN.getSpecies(), BeeSpecies.TE_COAL.getGenome(), 12)
|
||||
.requireResource(Blocks.coal_ore, 0);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.SPITEFUL.getSpecies(), Allele.getBaseSpecies("Industrious"), BeeSpecies.TE_DESTABILIZED.getGenome(), 12)
|
||||
.requireResource(Blocks.redstone_ore, 0);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.TE_LUX.getGenome(), 12)
|
||||
.requireResource(Blocks.glowstone, 0);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), Allele.getBaseSpecies("Austere"), BeeSpecies.TE_DANTE.getGenome(), 12)
|
||||
.restrictBiomeType(BiomeDictionary.Type.NETHER);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.TE_DANTE.getSpecies(), BeeSpecies.TE_COAL.getSpecies(), BeeSpecies.TE_PYRO.getGenome(), 8)
|
||||
.restrictBiomeType(BiomeDictionary.Type.NETHER);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), Allele.getBaseSpecies("Wintry"), BeeSpecies.TE_BLIZZY.getGenome(), 12);
|
||||
beeMutationFactory.createMutation(BeeSpecies.TE_BLIZZY.getSpecies(), Allele.getBaseSpecies("Icy"), BeeSpecies.TE_GELID.getGenome(), 8);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.TE_SHOCKING.getGenome(), 13);
|
||||
beeMutationFactory.createMutation(BeeSpecies.TE_SHOCKING.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.TE_AMPED.getGenome(), 8);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.TE_GROUNDED.getGenome(), 12);
|
||||
beeMutationFactory.createMutation(BeeSpecies.TE_GROUNDED.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.TE_ROCKING.getGenome(), 9);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.TE_PLATINUM.getSpecies(), BeeSpecies.OBLIVION.getSpecies(), BeeSpecies.TE_WINSOME.getGenome(), 12);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.TE_WINSOME.getSpecies(), BeeSpecies.TE_COAL.getSpecies(), BeeSpecies.TE_ENDEARING.getGenome(), 8)
|
||||
.requireResource("blockEnderium");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.COPPER.getSpecies(), BeeSpecies.TE_DESTABILIZED.getSpecies(), BeeSpecies.TE_SIGNALUS.getGenome(), 8)
|
||||
.requireResource("blockSignalum");
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.TIN.getSpecies(), BeeSpecies.TE_LUX.getSpecies(), BeeSpecies.TE_LUMIUS.getGenome(), 8)
|
||||
.requireResource("blockLumium");
|
||||
}
|
||||
|
||||
if (BotaniaHelper.isActive()) {
|
||||
beeMutationFactory.createMutation(BeeSpecies.ELDRITCH.getSpecies(), Allele.getBaseSpecies("Forest"), BeeSpecies.BOT_ROOTED.getGenome(), 15)
|
||||
.requireResource(BotaniaHelper.blockLivingWood, 0);
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.BOT_ROOTED.getSpecies(), BeeSpecies.WATERY.getSpecies(), BeeSpecies.BOT_SOMNOLENT.getGenome(), 16)
|
||||
.requireNight();
|
||||
beeMutationFactory.createMutation(BeeSpecies.WINDY.getSpecies(), BeeSpecies.BOT_SOMNOLENT.getSpecies(), BeeSpecies.BOT_DREAMING.getGenome(), 8)
|
||||
.requireNight();
|
||||
|
||||
beeMutationFactory.createMutation(BeeSpecies.BOT_BOTANIC.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.BOT_BLOSSOM.getGenome(), 12);
|
||||
beeMutationFactory.createMutation(BeeSpecies.BOT_BOTANIC.getSpecies(), BeeSpecies.BOT_BLOSSOM.getSpecies(), BeeSpecies.BOT_FLORAL.getGenome(), 8);
|
||||
}
|
||||
|
||||
if (AppliedEnergisticsHelper.isActive()) {
|
||||
if (BeeSpecies.AE_SKYSTONE.isActive()) {
|
||||
beeMutationFactory.createMutation(BeeSpecies.EARTHY.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.AE_SKYSTONE.getGenome(), 20)
|
||||
.requireResource(AppliedEnergisticsHelper.skystone, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeRoot getRoot()
|
||||
{
|
||||
return BeeManager.beeRoot;
|
||||
}
|
||||
|
||||
public boolean arePartners(IAllele alleleA, IAllele alleleB)
|
||||
{
|
||||
return (this.parent1.getUID().equals(alleleA.getUID())) && this.parent2.getUID().equals(alleleB.getUID()) ||
|
||||
this.parent1.getUID().equals(alleleB.getUID()) && this.parent2.getUID().equals(alleleA.getUID());
|
||||
}
|
||||
|
||||
public BeeMutation setSecret()
|
||||
{
|
||||
this.isSecret = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSecret()
|
||||
{
|
||||
return isSecret;
|
||||
}
|
||||
|
||||
public BeeMutation setBlockRequired(Block block)
|
||||
{
|
||||
this.requiresBlock = true;
|
||||
this.requiredBlock = block;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BeeMutation setBlockAndMetaRequired(Block block, int meta)
|
||||
{
|
||||
this.requiresBlock = true;
|
||||
this.requiredBlock = block;
|
||||
this.requiredBlockMeta = meta;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BeeMutation setBlockRequired(String oreDictEntry)
|
||||
{
|
||||
this.requiresBlock = true;
|
||||
this.requiredBlockOreDictEntry = oreDictEntry;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BeeMutation setBlockRequiredNameOverride(String blockName)
|
||||
{
|
||||
this.requiredBlockName = blockName;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BeeMutation setMoonPhaseRestricted(MoonPhase begin, MoonPhase end)
|
||||
{
|
||||
this.isMoonRestricted = true;
|
||||
this.moonPhaseStart = begin;
|
||||
this.moonPhaseEnd = end;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BeeMutation setMoonPhaseBonus(MoonPhase begin, MoonPhase end, float mutationBonus)
|
||||
{
|
||||
this.moonPhaseMutationBonus = mutationBonus;
|
||||
this.moonPhaseStart = begin;
|
||||
this.moonPhaseEnd = end;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BeeMutation setBiomeRequired(BiomeDictionary.Type biomeType)
|
||||
{
|
||||
this.requiredBiomeType = biomeType;
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,443 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import magicbees.item.types.CombType;
|
||||
import magicbees.item.types.DropType;
|
||||
import magicbees.item.types.NuggetType;
|
||||
import magicbees.item.types.PollenType;
|
||||
import magicbees.item.types.PropolisType;
|
||||
import magicbees.item.types.ResourceType;
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.LogHelper;
|
||||
import magicbees.main.utils.compat.AppliedEnergisticsHelper;
|
||||
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import magicbees.main.utils.compat.EquivalentExchangeHelper;
|
||||
import magicbees.main.utils.compat.ForestryHelper;
|
||||
import magicbees.main.utils.compat.RedstoneArsenalHelper;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import magicbees.main.utils.compat.ThermalModsHelper;
|
||||
import magicbees.main.utils.compat.BotaniaHelper.PastureSeed;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import static magicbees.bees.BeeSpecies.*;
|
||||
|
||||
public class BeeProductHelper {
|
||||
|
||||
public static void initBaseProducts() {
|
||||
MYSTICAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
|
||||
SORCEROUS.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
|
||||
UNUSUAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
|
||||
ATTUNED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
|
||||
ELDRITCH.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f);
|
||||
|
||||
ESOTERIC.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.18f);
|
||||
MYSTERIOUS.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.20f);
|
||||
ARCANE.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.25f)
|
||||
.addSpecialty(Config.drops.getStackForType(DropType.ENCHANTED, 1), 0.09f);
|
||||
|
||||
CHARMED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.18f);
|
||||
ENCHANTED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.20f);
|
||||
SUPERNATURAL.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.25f)
|
||||
.addSpecialty(Config.pollen.getStackForType(PollenType.UNUSUAL), 0.08f);
|
||||
|
||||
ETHEREAL.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.10f);
|
||||
|
||||
WINDY.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.25f);
|
||||
FIREY.addProduct(Config.combs.getStackForType(CombType.FIREY), 0.25f);
|
||||
EARTHY.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.25f);
|
||||
WATERY.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.25f)
|
||||
.addSpecialty(new ItemStack(Blocks.ice), 0.025f);
|
||||
|
||||
PUPIL.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.20f);
|
||||
SCHOLARLY.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.25f);
|
||||
SAVANT.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.40f);
|
||||
|
||||
AWARE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f);
|
||||
SPIRIT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.22f)
|
||||
.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.16f);
|
||||
SOUL.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f)
|
||||
.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.20f);
|
||||
|
||||
SKULKING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f);
|
||||
GHASTLY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.08f)
|
||||
.addSpecialty(new ItemStack(Items.ghast_tear), 0.099f);
|
||||
SPIDERY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.13f)
|
||||
.addProduct(new ItemStack(Items.string), 0.08f)
|
||||
.addSpecialty(new ItemStack(Items.spider_eye), 0.08f);
|
||||
SMOULDERING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f)
|
||||
.addSpecialty(new ItemStack(Items.blaze_rod), 0.05f);
|
||||
BRAINY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
|
||||
.addProduct(new ItemStack(Items.rotten_flesh), 0.06f);
|
||||
BIGBAD.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.18f)
|
||||
.addProduct(new ItemStack(Items.beef), 0.12f)
|
||||
.addProduct(new ItemStack(Items.chicken), 0.12f)
|
||||
.addSpecialty(new ItemStack(Items.melon), 0.20f);
|
||||
BATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
|
||||
.addSpecialty(new ItemStack(Items.string), 0.20f);
|
||||
CHICKEN.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.23f)
|
||||
.addSpecialty(new ItemStack(Items.feather), 0.08f)
|
||||
.addSpecialty(new ItemStack(Items.egg), 0.08f);
|
||||
BEEF.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
|
||||
.addSpecialty(new ItemStack(Items.leather), 0.165f);
|
||||
PORK.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
|
||||
.addSpecialty(new ItemStack(Items.carrot), 0.165f);
|
||||
SHEEPISH.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
|
||||
.addSpecialty(new ItemStack(Blocks.wool), 0.16f)
|
||||
.addSpecialty(new ItemStack(Items.wheat), 0.24f);
|
||||
HORSE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
|
||||
.addSpecialty(new ItemStack(Items.leather), 0.24f)
|
||||
.addSpecialty(new ItemStack(Items.apple), 0.38f);
|
||||
CATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f)
|
||||
.addSpecialty(new ItemStack(Items.fish), 0.24f);
|
||||
|
||||
TIMELY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.16f);
|
||||
LORDLY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.19f);
|
||||
DOCTORAL.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.24f)
|
||||
.addSpecialty(new ItemStack(Config.jellyBaby), 0.078f);
|
||||
|
||||
INFERNAL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.12f);
|
||||
HATEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.18f);
|
||||
SPITEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.24f);
|
||||
WITHERING.addSpecialty(Config.miscResources.getStackForType(ResourceType.SKULL_CHIP), 0.15f);
|
||||
|
||||
OBLIVION.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.14f);
|
||||
NAMELESS.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.19f);
|
||||
ABANDONED.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.24f);
|
||||
FORLORN.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.30f);
|
||||
DRACONIC.addSpecialty(Config.miscResources.getStackForType(ResourceType.DRAGON_DUST), 0.15f);
|
||||
|
||||
IRON.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
|
||||
.addSpecialty(Config.nuggets.getStackForType(NuggetType.IRON), 0.18f);
|
||||
GOLD.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
|
||||
.addSpecialty(new ItemStack(Items.gold_nugget, 1), 0.16f);
|
||||
DIAMOND.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
|
||||
.addSpecialty(Config.nuggets.getStackForType(NuggetType.DIAMOND), 0.06f);
|
||||
EMERALD.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
|
||||
.addSpecialty(Config.nuggets.getStackForType(NuggetType.EMERALD), 0.04f);
|
||||
COPPER.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
|
||||
.addSpecialty(Config.nuggets.getStackForType(NuggetType.COPPER), 0.20f);
|
||||
TIN.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
|
||||
.addSpecialty(Config.nuggets.getStackForType(NuggetType.TIN), 0.20f);
|
||||
APATITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
|
||||
.addSpecialty(Config.nuggets.getStackForType(NuggetType.APATITE), 0.10f);
|
||||
|
||||
MUTABLE.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.30f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.10f);
|
||||
TRANSMUTING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f)
|
||||
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.05f)
|
||||
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SIMMERING.ordinal()), 0.05f);
|
||||
CRUMBLING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f)
|
||||
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.POWDERY.ordinal()), 0.10f)
|
||||
.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.COCOA.ordinal()), 0.15f);
|
||||
|
||||
INVISIBLE.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.35f);
|
||||
|
||||
}
|
||||
|
||||
public static void initOreDictSProducts() {
|
||||
SILVER.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("ingotSilver").size() > 0) {
|
||||
SILVER.addSpecialty(Config.nuggets.getStackForType(NuggetType.SILVER), 0.16f);
|
||||
}
|
||||
else {
|
||||
SILVER.setInactive();
|
||||
}
|
||||
|
||||
LEAD.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("ingotLead").size() > 0) {
|
||||
LEAD.addSpecialty(Config.nuggets.getStackForType(NuggetType.LEAD), 0.17f);
|
||||
}
|
||||
else {
|
||||
LEAD.setInactive();
|
||||
}
|
||||
|
||||
ALUMINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetAluminum").size() > 0) {
|
||||
ALUMINUM.addSpecialty(OreDictionary.getOres("nuggetAluminum").get(0), 0.20f);
|
||||
} else {
|
||||
ALUMINUM.setInactive();
|
||||
}
|
||||
|
||||
TE_PLATINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetPlatinum").size() > 0&& OreDictionary.getOres("ingotPlatinum").size() > 0) {
|
||||
TE_PLATINUM.addSpecialty(OreDictionary.getOres("nuggetPlatinum").get(0), 0.18f);
|
||||
} else {
|
||||
TE_PLATINUM.setInactive();
|
||||
}
|
||||
|
||||
TE_NICKEL.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetNickel").size() > 0 && OreDictionary.getOres("ingotNickel").size() > 0) {
|
||||
TE_NICKEL.addSpecialty(OreDictionary.getOres("nuggetNickel").get(0), 0.18f);
|
||||
} else {
|
||||
TE_NICKEL.setInactive();
|
||||
}
|
||||
|
||||
ARDITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetArdite").size() > 0) {
|
||||
ARDITE.addSpecialty(OreDictionary.getOres("nuggetArdite").get(0), 0.18f);
|
||||
} else {
|
||||
ARDITE.setInactive();
|
||||
}
|
||||
|
||||
COBALT.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetCobalt").size() > 0) {
|
||||
COBALT.addSpecialty(OreDictionary.getOres("nuggetCobalt").get(0), 0.18f);
|
||||
}
|
||||
if (OreDictionary.getOres("nuggetNaturalCobalt").size() > 0) {
|
||||
COBALT.addSpecialty(OreDictionary.getOres("nuggetNaturalCobalt").get(0), 0.24f);
|
||||
}
|
||||
if (COBALT.getSpecies().getSpecialtyChances().size() <= 0) {
|
||||
COBALT.setInactive();
|
||||
}
|
||||
|
||||
TE_BRONZE.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetBronze").size() > 0 && OreDictionary.getOres("ingotBronze").size() > 0) {
|
||||
TE_BRONZE.addSpecialty(OreDictionary.getOres("nuggetBronze").get(0), 0.18f);
|
||||
} else {
|
||||
TE_BRONZE.setInactive();
|
||||
}
|
||||
|
||||
TE_INVAR.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetInvar").size() > 0 && OreDictionary.getOres("ingotInvar").size() > 0) {
|
||||
TE_INVAR.addSpecialty(OreDictionary.getOres("nuggetInvar").get(0), 0.18f);
|
||||
} else {
|
||||
TE_INVAR.setInactive();
|
||||
}
|
||||
|
||||
TE_ELECTRUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetElectrum").size() > 0 && OreDictionary.getOres("ingotElectrum").size() > 0) {
|
||||
TE_ELECTRUM.addSpecialty(OreDictionary.getOres("nuggetElectrum").get(0), 0.18f);
|
||||
} else {
|
||||
TE_ELECTRUM.setInactive();
|
||||
}
|
||||
|
||||
MANYULLYN.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("nuggetManyullyn").size() > 0) {
|
||||
MANYULLYN.addSpecialty(OreDictionary.getOres("nuggetManyullyn").get(0), 0.16f);
|
||||
} else {
|
||||
MANYULLYN.setInactive();
|
||||
}
|
||||
|
||||
OSMIUM.addProduct(ForestryHelper.itemHoneycomb, 0.15f);
|
||||
if (OreDictionary.getOres("nuggetOsmium").size() > 0) {
|
||||
OSMIUM.addSpecialty(OreDictionary.getOres("nuggetOsmium").get(0), 0.16f);
|
||||
}
|
||||
else {
|
||||
OSMIUM.setInactive();
|
||||
}
|
||||
|
||||
CERTUS.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("crystalCertusQuartz").size() > 0) {
|
||||
CERTUS.addSpecialty(OreDictionary.getOres("crystalCertusQuartz").get(0), 0.08f);
|
||||
}
|
||||
else {
|
||||
CERTUS.setInactive();
|
||||
}
|
||||
|
||||
SILICON.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("itemSilicon").size() > 0) {
|
||||
SILICON.addSpecialty(OreDictionary.getOres("itemSilicon").get(0), 0.16f);
|
||||
}
|
||||
else {
|
||||
SILICON.setInactive();
|
||||
}
|
||||
|
||||
FLUIX.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
if (OreDictionary.getOres("crystalFluix").size() > 0) {
|
||||
FLUIX.addSpecialty(OreDictionary.getOres("crystalFluix").get(0), 0.06f);
|
||||
}
|
||||
else {
|
||||
FLUIX.setInactive();
|
||||
}
|
||||
}
|
||||
|
||||
public static void initThaumcraftProducts() {
|
||||
TC_AIR.addProduct(Config.combs.getStackForType(CombType.TC_AIR), 0.20f);
|
||||
TC_FIRE.addProduct(Config.combs.getStackForType(CombType.TC_FIRE), 0.20f);
|
||||
TC_WATER.addProduct(Config.combs.getStackForType(CombType.TC_WATER), 0.20f);
|
||||
TC_EARTH.addProduct(Config.combs.getStackForType(CombType.TC_EARTH), 0.20f);
|
||||
TC_ORDER.addProduct(Config.combs.getStackForType(CombType.TC_ORDER), 0.20f);
|
||||
TC_CHAOS.addProduct(Config.combs.getStackForType(CombType.TC_CHAOS), 0.20f);
|
||||
|
||||
TC_VIS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.10f);
|
||||
TC_REJUVENATING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f);
|
||||
TC_EMPOWERING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.14f);
|
||||
TC_EMPOWERING.addSpecialty(new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), 0.02f);
|
||||
TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.25f);
|
||||
TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.12f);
|
||||
TC_NEXUS.addSpecialty(new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), 0.02f);
|
||||
TC_TAINT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f);
|
||||
TC_TAINT.addProduct(new ItemStack(ForestryHelper.craftingResource, 1 , ForestryHelper.Propolis.STICKY.ordinal()), 0.213f);
|
||||
TC_PURE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.16f);
|
||||
TC_PURE.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.19f);
|
||||
TC_HUNGRY.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f);
|
||||
TC_HUNGRY.addSpecialty(Config.combs.getStackForType(CombType.TEMPORAL), 0.195f);
|
||||
TC_WISPY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.22f)
|
||||
.addSpecialty(new ItemStack(ForestryHelper.craftingResource, 1, ForestryHelper.CraftingMaterial.SILK_WISP.ordinal()), 0.04f);
|
||||
TC_VOID.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
|
||||
if (ThaumcraftHelper.isActive()) {
|
||||
SCHOLARLY.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.02f);
|
||||
SAVANT.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.05f);
|
||||
|
||||
TC_AIR.addSpecialty(Config.propolis.getStackForType(PropolisType.AIR), 0.18f);
|
||||
TC_FIRE.addSpecialty(Config.propolis.getStackForType(PropolisType.FIRE), 0.18f);
|
||||
TC_WATER.addSpecialty(Config.propolis.getStackForType(PropolisType.WATER), 0.18f);
|
||||
TC_EARTH.addSpecialty(Config.propolis.getStackForType(PropolisType.EARTH), 0.18f);
|
||||
TC_ORDER.addSpecialty(Config.propolis.getStackForType(PropolisType.ORDER), 0.18f);
|
||||
TC_CHAOS.addSpecialty(Config.propolis.getStackForType(PropolisType.CHAOS), 0.18f);
|
||||
|
||||
BATTY.addSpecialty(new ItemStack(Items.gunpowder), 0.04f);
|
||||
BRAINY.addSpecialty(new ItemStack(ThaumcraftHelper.zombieBrain, 1), 0.02f);
|
||||
CHICKEN.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetChicken, 1), 0.09f);
|
||||
BEEF.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetBeef, 1), 0.09f);
|
||||
PORK.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetPork, 1), 0.09f);
|
||||
TC_VOID.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetMetal, 1, ThaumcraftHelper.NuggetType.VOID_METAL.ordinal()), 0.155f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initEquivalentExchange3Species() {
|
||||
EE_MINIUM.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.16f);
|
||||
|
||||
if (EquivalentExchangeHelper.isActive()) {
|
||||
EE_MINIUM.addSpecialty(new ItemStack(EquivalentExchangeHelper.minuimShard), 0.06f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initArsMagicaSpecies() {
|
||||
AM_ESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.12f);
|
||||
AM_QUINTESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.23f);
|
||||
AM_EARTH.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
|
||||
AM_AIR.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
|
||||
AM_FIRE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
|
||||
AM_WATER.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
|
||||
AM_LIGHTNING.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
|
||||
AM_PLANT.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
|
||||
AM_ICE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f);
|
||||
AM_ARCANE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.19f);
|
||||
AM_VORTEX.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.10f);
|
||||
AM_WIGHT.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.30f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f);
|
||||
|
||||
if (ArsMagicaHelper.isActive()) {
|
||||
AM_QUINTESSENCE.addSpecialty(new ItemStack(ArsMagicaHelper.itemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), 0.05f);
|
||||
AM_EARTH.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 0.07f);
|
||||
AM_AIR.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.AIR.ordinal()), 0.07f);
|
||||
AM_FIRE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.FIRE.ordinal()), 0.07f);
|
||||
AM_WATER.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.WATER.ordinal()), 0.07f);
|
||||
AM_LIGHTNING.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.LIGHTNING.ordinal()), 0.07f);
|
||||
AM_PLANT.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()), 0.07f);
|
||||
AM_ICE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ICE.ordinal()), 0.07f);
|
||||
AM_ARCANE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ARCANE.ordinal()), 0.11f);
|
||||
AM_VORTEX.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 0.15f);
|
||||
AM_WIGHT.addSpecialty(new ItemStack(ArsMagicaHelper.itemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), 0.11f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initThermalExpansionProducts() {
|
||||
TE_DANTE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f)
|
||||
.addSpecialty(new ItemStack(Items.blaze_powder), 0.05f);
|
||||
TE_PYRO.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f)
|
||||
.addSpecialty(new ItemStack(Items.blaze_powder), 0.05f);
|
||||
TE_DESTABILIZED.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f)
|
||||
.addSpecialty(new ItemStack(Items.redstone), 0.05f);
|
||||
TE_LUX.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f)
|
||||
.addSpecialty(new ItemStack(Items.glowstone_dust), 0.05f);
|
||||
TE_WINSOME.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f)
|
||||
.addSpecialty(new ItemStack(Items.ender_pearl), 0.05f);
|
||||
TE_ENDEARING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f);
|
||||
TE_COAL.addProduct(ForestryHelper.itemHoneycomb, 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TE_CARBON), 0.05f)
|
||||
.addSpecialty(new ItemStack(Items.coal), 0.05f);
|
||||
TE_BLIZZY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f);
|
||||
TE_GELID.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f);
|
||||
TE_SHOCKING.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.16f);
|
||||
TE_AMPED.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.29f);
|
||||
TE_GROUNDED.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.16f);
|
||||
TE_ROCKING.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.29f);
|
||||
|
||||
TE_SIGNALUS.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f);
|
||||
TE_LUMIUS.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f);
|
||||
|
||||
if (ThermalModsHelper.isActive()) {
|
||||
LogHelper.info("Thermal Expansion bees active");
|
||||
TE_BLIZZY.addSpecialty(ThermalModsHelper.dustBlizz, 0.09f);
|
||||
TE_GELID.addSpecialty(ThermalModsHelper.dustCryotheum, 0.09f);
|
||||
TE_DANTE.addSpecialty(ThermalModsHelper.dustSulfur, 0.09f);
|
||||
TE_PYRO.addSpecialty(ThermalModsHelper.dustPyrotheum, 0.09f);
|
||||
TE_SHOCKING.addSpecialty(ThermalModsHelper.dustBlitz, 0.09f);
|
||||
TE_AMPED.addSpecialty(ThermalModsHelper.dustAerotheum, 0.09f);
|
||||
TE_GROUNDED.addSpecialty(ThermalModsHelper.dustBasalz, 0.09f);
|
||||
TE_ROCKING.addSpecialty(ThermalModsHelper.dustPetrotheum, 0.09f);
|
||||
TE_WINSOME.addSpecialty(ThermalModsHelper.dustPlatinum, 0.09f);
|
||||
TE_ENDEARING.addSpecialty(ThermalModsHelper.enderiumNugget, 0.09f);
|
||||
TE_SIGNALUS.addSpecialty(ThermalModsHelper.signalumNugget, 0.09f);
|
||||
TE_LUMIUS.addSpecialty(ThermalModsHelper.lumiumNugget, 0.09f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initRedstoneArsenelProducts() {
|
||||
RSA_FLUXED.addProduct(ForestryHelper.itemHoneycomb, 0.10f);
|
||||
|
||||
if (RedstoneArsenalHelper.isActive()) {
|
||||
RSA_FLUXED.addSpecialty(RedstoneArsenalHelper.fluxNugget, 0.09f);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initBotaniaProducts() {
|
||||
BOT_ROOTED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f);
|
||||
BOT_BOTANIC.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f);
|
||||
BOT_BLOSSOM.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.20f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f);
|
||||
BOT_FLORAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.25f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f);
|
||||
BOT_VAZBEE.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.05f)
|
||||
.addProduct(new ItemStack(Items.dye, 1, 9), 0.20f)
|
||||
.addProduct(new ItemStack(Blocks.wool, 1, 9), 0.02f)
|
||||
.addProduct(new ItemStack(Blocks.red_flower, 1, 7), 0.06f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.15f);
|
||||
BOT_SOMNOLENT.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.08f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.15f);
|
||||
BOT_DREAMING.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.16f)
|
||||
.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.33f);
|
||||
BOT_ALFHEIM.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.28f);
|
||||
|
||||
if (BotaniaHelper.isActive()) {
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
ItemStack petal = new ItemStack(BotaniaHelper.itemPetal, 1, i);
|
||||
BOT_BOTANIC.addSpecialty(petal, 0.01f);
|
||||
BOT_BLOSSOM.addSpecialty(petal, 0.04f);
|
||||
BOT_FLORAL.addSpecialty(petal, 0.16f);
|
||||
}
|
||||
|
||||
for (PastureSeed type : PastureSeed.values()) {
|
||||
BOT_VAZBEE.addSpecialty(new ItemStack(BotaniaHelper.itemPastureSeed, 1, type.ordinal()), 0.04f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void initAppEngProducts() {
|
||||
AE_SKYSTONE.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.19f);
|
||||
if (AppliedEnergisticsHelper.skystone != null) {
|
||||
AE_SKYSTONE.addSpecialty(new ItemStack(AppliedEnergisticsHelper.skystone), 0.02f);
|
||||
}
|
||||
else {
|
||||
AE_SKYSTONE.setInactive();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,105 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderArsMagicaFlower implements IFlowerProvider
|
||||
{
|
||||
private ItemStack[] flowers = { new ItemStack(Config.amBlackOrchid), new ItemStack(Config.amDesertNova),
|
||||
new ItemStack(Config.amAum), new ItemStack(Config.amWakebloom),
|
||||
new ItemStack(Config.amTarmaRoot) };
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
boolean flag = false;
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block == Config.amBlackOrchid || block == Config.amDesertNova ||
|
||||
block == Config.amAum || block == Config.amWakebloom ||
|
||||
block == Config.amTarmaRoot)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
boolean flag = false;
|
||||
x = -222;
|
||||
y = 70;
|
||||
z = -51;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z))
|
||||
{
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass)
|
||||
{
|
||||
int dart = world.rand.nextInt(100);
|
||||
Block block;
|
||||
if (dart > 60)
|
||||
{
|
||||
block = Config.amBlackOrchid;
|
||||
}
|
||||
else if (dart > 30)
|
||||
{
|
||||
block = Config.amAum;
|
||||
}
|
||||
else
|
||||
{
|
||||
block = Config.amTarmaRoot;
|
||||
}
|
||||
world.setBlock(x, y, z, block);
|
||||
flag = true;
|
||||
}
|
||||
else if (blockDown == Blocks.sand)
|
||||
{
|
||||
world.setBlock(x, y, z, Config.amDesertNova);
|
||||
flag = true;
|
||||
}
|
||||
else if (blockDown == Blocks.stone)
|
||||
{
|
||||
world.setBlock(x, y, z, Config.amTarmaRoot);
|
||||
flag = true;
|
||||
}
|
||||
else if (blockDown == Blocks.water || blockDown == Blocks.water)
|
||||
{
|
||||
world.setBlock(x, y, z, Config.amWakebloom);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.arsmagica");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||
{
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
return this.flowers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
return pollinatable.getPlantType().size() > 1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderAuraNode implements IFlowerProvider
|
||||
{
|
||||
protected int nodeRange = 70;
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
return this.isNodeWithinRange(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
return pollinatable.getPlantType().size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.node");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||
{
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
protected boolean isNodeWithinRange(World w, int x, int y, int z)
|
||||
{
|
||||
boolean nodeNearby = false;
|
||||
/*if (ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z, this.nodeRange) >= 0)
|
||||
{
|
||||
nodeNearby = true;
|
||||
}*/
|
||||
return nodeNearby;
|
||||
}
|
||||
|
||||
/*protected AuraNode getNodeWithinRange(World w, int x, int y, int z)
|
||||
{
|
||||
AuraNode node = null;
|
||||
|
||||
int nodeId = ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z, this.nodeRange);
|
||||
if (nodeId >= 0)
|
||||
{
|
||||
node = ThaumcraftApi.getNodeCopy(nodeId);
|
||||
}
|
||||
|
||||
return node;
|
||||
}*/
|
||||
|
||||
protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack)
|
||||
{
|
||||
for (ItemStack stack : products)
|
||||
{
|
||||
if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage())
|
||||
{
|
||||
if (stack.stackSize < stack.getItem().getItemStackLimit(stack))
|
||||
{
|
||||
stack.stackSize += itemStack.stackSize;
|
||||
itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemStack.stackSize > 0)
|
||||
{
|
||||
ItemStack[] newProducts = new ItemStack[products.length + 1];
|
||||
for (int i = 0; i < products.length; ++i)
|
||||
{
|
||||
newProducts[i] = products[i];
|
||||
}
|
||||
newProducts[products.length] = itemStack;
|
||||
products = newProducts;
|
||||
}
|
||||
|
||||
return products;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderThaumcraftFlower implements IFlowerProvider
|
||||
{
|
||||
private ItemStack[] flowers = { new ItemStack(Config.tcPlant, 1, 2), new ItemStack(Config.tcPlant, 1, 3) };
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
boolean flag = false;
|
||||
if (world.getBlock(x, y, z) == Config.tcPlant)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 2 || meta == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
boolean flag = false;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z))
|
||||
{
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass)
|
||||
{
|
||||
world.setBlock(x, y, z, Config.tcPlant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2);
|
||||
flag = true;
|
||||
}
|
||||
else if (blockDown == Blocks.sand)
|
||||
{
|
||||
world.setBlock(x, y, z, Config.tcPlant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.magic");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||
{
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
return this.flowers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
return pollinatable.getPlantType().size() > 1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,27 +28,30 @@ import magicbees.world.feature.HiveGenOblivion;
|
||||
import magicbees.world.feature.HiveGenUnderground;
|
||||
|
||||
public enum HiveDescription implements IHiveDescription {
|
||||
CURIOUS(HiveType.CURIOUS, 3.0f, HiveManager.genHelper.tree()),
|
||||
UNUSUAL(HiveType.UNUSUAL, 1.0f, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)),
|
||||
RESONANT(HiveType.RESONANT, 0.5f, HiveManager.genHelper.ground(Blocks.sand, Blocks.sandstone)),
|
||||
DEEP(HiveType.DEEP, 2.0f, new HiveGenUnderground(10, 10, 6)) {
|
||||
CURIOUS(HiveType.CURIOUS, 3.0f, HiveManager.genHelper.tree(), false,
|
||||
BiomeDictionary.Type.FOREST, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.HILLS),
|
||||
UNUSUAL(HiveType.UNUSUAL, 1.0f, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass), false,
|
||||
BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.HILLS, BiomeDictionary.Type.RIVER),
|
||||
RESONANT(HiveType.RESONANT, 0.9f, HiveManager.genHelper.ground(Blocks.sand, Blocks.sandstone), false,
|
||||
BiomeDictionary.Type.SANDY, BiomeDictionary.Type.MESA, BiomeDictionary.Type.HOT, BiomeDictionary.Type.MAGICAL),
|
||||
DEEP(HiveType.DEEP, 5.0f, new HiveGenUnderground(10, 15, 5), true,
|
||||
BiomeDictionary.Type.HILLS, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.MAGICAL) {
|
||||
@Override
|
||||
public void postGen(World world, int x, int y, int z)
|
||||
{
|
||||
public void postGen(World world, int x, int y, int z) {
|
||||
super.postGen(world, x, y, z);
|
||||
Random random = world.rand;
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x + 1, y, z, 2);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x - 1, y, z, 2);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x, y + 1, z, 2);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x, y - 1, z, 2);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z + 1, 2);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z - 1, 2);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x + 1, y, z, 5);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x - 1, y, z, 5);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x, y + 1, z, 5);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x, y - 1, z, 5);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z + 1, 5);
|
||||
FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z - 1, 5);
|
||||
}
|
||||
},
|
||||
INFERNAL(HiveType.INFERNAL, 50.0f, new HiveGenNether(0, 175, 6)) {
|
||||
INFERNAL(HiveType.INFERNAL, 50.0f, new HiveGenNether(0, 175, 6), true,
|
||||
BiomeDictionary.Type.NETHER) {
|
||||
@Override
|
||||
public void postGen(World world, int x, int y, int z)
|
||||
{
|
||||
public void postGen(World world, int x, int y, int z) {
|
||||
super.postGen(world, x, y, z);
|
||||
Random random = world.rand;
|
||||
FeatureOreVein.netherQuartzGen.generateVein(world, random, x + 1, y, z, 4);
|
||||
@@ -59,22 +62,20 @@ public enum HiveDescription implements IHiveDescription {
|
||||
FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z - 1, 4);
|
||||
}
|
||||
},
|
||||
INFERNAL_OVERWORLD(HiveType.INFERNAL, 1.0f, new HiveGenUnderground(5, 13, 6)) {
|
||||
INFERNAL_OVERWORLD(HiveType.INFERNAL, 0.95f, new HiveGenUnderground(5, 13, 6), true,
|
||||
BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.HOT) {
|
||||
@Override
|
||||
public void postGen(World world, int x, int y, int z)
|
||||
{
|
||||
public void postGen(World world, int x, int y, int z) {
|
||||
super.postGen(world, x, y, z);
|
||||
Random random = world.rand;
|
||||
FeatureOreVein.glowstoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(4) + 1);
|
||||
FeatureOreVein.glowstoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(4) + 1);
|
||||
|
||||
if (BlockUtil.canBlockReplaceAt(world, x, y + 1, z, Blocks.stone))
|
||||
{
|
||||
if (BlockUtil.canBlockReplaceAt(world, x, y + 1, z, Blocks.stone)) {
|
||||
world.setBlock(x, y + 1, z, Blocks.glowstone, 0, 3);
|
||||
}
|
||||
|
||||
if (BlockUtil.canBlockReplaceAt(world, x, y - 1, z, Blocks.stone))
|
||||
{
|
||||
if (BlockUtil.canBlockReplaceAt(world, x, y - 1, z, Blocks.stone)) {
|
||||
world.setBlock(x, y - 1, z, Blocks.glowstone, 0, 3);
|
||||
}
|
||||
|
||||
@@ -82,23 +83,22 @@ public enum HiveDescription implements IHiveDescription {
|
||||
FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(4) + 1);
|
||||
}
|
||||
},
|
||||
OBLIVION(HiveType.OBLIVION, 20.0f, new HiveGenOblivion()) {
|
||||
OBLIVION(HiveType.OBLIVION, 20.0f, new HiveGenOblivion(), true,
|
||||
BiomeDictionary.Type.END) {
|
||||
@Override
|
||||
public void postGen(World world, int x, int y, int z)
|
||||
{
|
||||
public void postGen(World world, int x, int y, int z) {
|
||||
super.postGen(world, x, y, z);
|
||||
int obsidianSpikeHeight = world.rand.nextInt(8) + 3;
|
||||
|
||||
for (int i = 1; i < obsidianSpikeHeight && y - i > 0; ++i)
|
||||
{
|
||||
for (int i = 1; i < obsidianSpikeHeight && y - i > 0; ++i) {
|
||||
world.setBlock(x, y - i, z, Blocks.obsidian, 0, 2);
|
||||
}
|
||||
}
|
||||
},
|
||||
OBLIVION_OVERWORLD(HiveType.OBLIVION, 1.0f, new HiveGenUnderground(5, 5, 5)) {
|
||||
OBLIVION_OVERWORLD(HiveType.OBLIVION, 0.87f, new HiveGenUnderground(5, 5, 5), true,
|
||||
BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.COLD) {
|
||||
@Override
|
||||
public void postGen(World world, int x, int y, int z)
|
||||
{
|
||||
public void postGen(World world, int x, int y, int z) {
|
||||
super.postGen(world, x, y, z);
|
||||
Random random = world.rand;
|
||||
|
||||
@@ -117,36 +117,16 @@ public enum HiveDescription implements IHiveDescription {
|
||||
private final float genChance;
|
||||
private final List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>();
|
||||
private final IHiveGen hiveGen;
|
||||
|
||||
private HiveDescription(HiveType hiveType, float genChance, IHiveGen hiveGen)
|
||||
{
|
||||
this.hiveType = hiveType;
|
||||
this.genChance = genChance;
|
||||
this.hiveGen = hiveGen;
|
||||
}
|
||||
|
||||
public static void initHiveData()
|
||||
{
|
||||
CURIOUS.biomes.add(BiomeDictionary.Type.FOREST);
|
||||
CURIOUS.biomes.add(BiomeDictionary.Type.JUNGLE);
|
||||
CURIOUS.biomes.add(BiomeDictionary.Type.HILLS);
|
||||
|
||||
UNUSUAL.biomes.add(BiomeDictionary.Type.PLAINS);
|
||||
UNUSUAL.biomes.add(BiomeDictionary.Type.MOUNTAIN);
|
||||
UNUSUAL.biomes.add(BiomeDictionary.Type.HILLS);
|
||||
|
||||
RESONANT.biomes.add(BiomeDictionary.Type.SANDY);
|
||||
RESONANT.biomes.add(BiomeDictionary.Type.MAGICAL);
|
||||
|
||||
DEEP.biomes.add(BiomeDictionary.Type.HILLS);
|
||||
DEEP.biomes.add(BiomeDictionary.Type.MOUNTAIN);
|
||||
DEEP.biomes.add(BiomeDictionary.Type.MAGICAL);
|
||||
|
||||
INFERNAL.biomes.add(BiomeDictionary.Type.NETHER);
|
||||
INFERNAL_OVERWORLD.biomes.add(BiomeDictionary.Type.MAGICAL);
|
||||
|
||||
OBLIVION.biomes.add(BiomeDictionary.Type.END);
|
||||
OBLIVION_OVERWORLD.biomes.add(BiomeDictionary.Type.MAGICAL);
|
||||
private final boolean spawnsIgnoreClimate;
|
||||
|
||||
private HiveDescription(HiveType type, float chance, IHiveGen genType, boolean ignoreClimate, BiomeDictionary.Type ... goodBiomeTypes) {
|
||||
hiveType = type;
|
||||
genChance = chance;
|
||||
hiveGen = genType;
|
||||
spawnsIgnoreClimate = ignoreClimate;
|
||||
for (BiomeDictionary.Type biomeType : goodBiomeTypes) {
|
||||
biomes.add(biomeType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -185,13 +165,13 @@ public enum HiveDescription implements IHiveDescription {
|
||||
@Override
|
||||
public boolean isGoodHumidity(EnumHumidity humidity)
|
||||
{
|
||||
return hiveType.getOccupant().canWorkInHumidity(humidity);
|
||||
return spawnsIgnoreClimate || hiveType.getOccupant().canWorkInHumidity(humidity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGoodTemperature(EnumTemperature temperature)
|
||||
{
|
||||
return hiveType.getOccupant().canWorkInTemperature(temperature);
|
||||
return spawnsIgnoreClimate || hiveType.getOccupant().canWorkInTemperature(temperature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.core.IClimateProvider;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IMutationCondition;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.MoonPhase;
|
||||
|
||||
// There is a bonus to this mutation during moon phases...
|
||||
public class MoonPhaseMutationBonus implements IMutationCondition {
|
||||
private final MoonPhase moonPhaseStart;
|
||||
private final MoonPhase moonPhaseEnd;
|
||||
private final float mutationBonus;
|
||||
|
||||
public MoonPhaseMutationBonus(MoonPhase phase, float bonus) {
|
||||
this.moonPhaseStart = phase;
|
||||
this.moonPhaseEnd = phase;
|
||||
this.mutationBonus = bonus;
|
||||
}
|
||||
|
||||
public MoonPhaseMutationBonus(MoonPhase start, MoonPhase end, float bonus) {
|
||||
this.moonPhaseStart = start;
|
||||
this.moonPhaseEnd = end;
|
||||
this.mutationBonus = bonus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) {
|
||||
if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) {
|
||||
return this.mutationBonus;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
if (this.moonPhaseStart != this.moonPhaseEnd) {
|
||||
return String.format(LocalizationManager.getLocalizedString("research.bonusPhase"),
|
||||
moonPhaseStart.getLocalizedNameAlt(), moonPhaseEnd.getLocalizedNameAlt());
|
||||
} else {
|
||||
return String.format(LocalizationManager.getLocalizedString("research.bonusPhaseSingle"),
|
||||
moonPhaseStart.getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.core.IClimateProvider;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IMutationCondition;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.MoonPhase;
|
||||
|
||||
public class MoonPhaseMutationRestriction implements IMutationCondition {
|
||||
private final MoonPhase moonPhaseStart;
|
||||
private final MoonPhase moonPhaseEnd;
|
||||
|
||||
public MoonPhaseMutationRestriction(MoonPhase phase) {
|
||||
this.moonPhaseStart = phase;
|
||||
this.moonPhaseEnd = phase;
|
||||
}
|
||||
|
||||
public MoonPhaseMutationRestriction(MoonPhase start, MoonPhase end) {
|
||||
this.moonPhaseStart = start;
|
||||
this.moonPhaseEnd = end;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) {
|
||||
if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
if (moonPhaseStart != moonPhaseEnd) {
|
||||
return String.format(LocalizationManager.getLocalizedString("research.requiresPhase"),
|
||||
moonPhaseStart.getLocalizedNameAlt(), moonPhaseEnd.getLocalizedNameAlt());
|
||||
}
|
||||
else {
|
||||
return String.format(LocalizationManager.getLocalizedString("research.requiresPhaseSingle"),
|
||||
moonPhaseStart.getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import magicbees.api.MagicBeesAPI;
|
||||
import magicbees.api.bees.ITransmutationEffectController;
|
||||
import magicbees.api.bees.ITransmutationEffectLogic;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
public class TransmutationEffectController implements ITransmutationEffectController
|
||||
{
|
||||
private ArrayList<ITransmutationEffectLogic> logicObjects;
|
||||
static TransmutationEffectController instance;
|
||||
|
||||
public TransmutationEffectController()
|
||||
{
|
||||
logicObjects = new ArrayList<ITransmutationEffectLogic>();
|
||||
logicObjects.add(new TransmutationEffectRailcraft());
|
||||
logicObjects.add(new TransmutationEffectVanilla());
|
||||
MagicBeesAPI.transmutationEffectController = instance = this;
|
||||
}
|
||||
|
||||
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
boolean done;
|
||||
ITransmutationEffectLogic logic;
|
||||
for (int i = 0; i < logicObjects.size(); i++)
|
||||
{
|
||||
logic = logicObjects.get(i);
|
||||
try
|
||||
{
|
||||
done = logic.tryTransmutation(world, biome, sourceBlock, x, y, z);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
done = false;
|
||||
FMLLog.warning("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.", logic.getClass().getName());
|
||||
FMLLog.info(e.getMessage());
|
||||
}
|
||||
|
||||
if (done)
|
||||
{
|
||||
logicObjects.remove(i);
|
||||
logicObjects.add(logic);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEffectLogic(ITransmutationEffectLogic logic)
|
||||
{
|
||||
if (logic != null && !logicObjects.contains(logic))
|
||||
{
|
||||
logicObjects.add(logic);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+36
-41
@@ -1,41 +1,40 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.BeeManager;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectCrumbling extends AlleleEffect
|
||||
{
|
||||
public class AlleleEffectCrumbling extends AlleleEffect {
|
||||
private static HashMap<ItemStack, ItemStack> crumbleMap = new HashMap<ItemStack, ItemStack>();
|
||||
|
||||
public static void addPairToMap(ItemStack source, ItemStack target)
|
||||
{
|
||||
public static void addPairToMap(ItemStack source, ItemStack target) {
|
||||
boolean add = true;
|
||||
for (ItemStack i : crumbleMap.keySet())
|
||||
{
|
||||
if (OreDictionary.itemMatches(i, source, false))
|
||||
{
|
||||
for (ItemStack i : crumbleMap.keySet()) {
|
||||
if (OreDictionary.itemMatches(i, source, false)) {
|
||||
add = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (add)
|
||||
{
|
||||
if (add) {
|
||||
crumbleMap.put(source, target);
|
||||
}
|
||||
}
|
||||
|
||||
public AlleleEffectCrumbling(String id, boolean isDominant)
|
||||
{
|
||||
|
||||
public AlleleEffectCrumbling(String id, boolean isDominant) {
|
||||
super(id, isDominant, 600);
|
||||
|
||||
|
||||
addPairToMap(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
|
||||
addPairToMap(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone));
|
||||
addPairToMap(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 2));
|
||||
@@ -45,47 +44,43 @@ public class AlleleEffectCrumbling extends AlleleEffect
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||
{
|
||||
storedData = new magicbees.bees.EffectData(1, 0, 0);
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
|
||||
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
// Get random coords within territory
|
||||
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
|
||||
// Get random coords within territory
|
||||
int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
|
||||
int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2;
|
||||
int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2;
|
||||
int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2;
|
||||
|
||||
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
|
||||
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
|
||||
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
|
||||
|
||||
Block block = world.getBlock(xCoord, yCoord, zCoord);
|
||||
if (block != null)
|
||||
{
|
||||
if (block != null) {
|
||||
ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord));
|
||||
for (ItemStack key : crumbleMap.keySet())
|
||||
{
|
||||
if (OreDictionary.itemMatches(source, key, false))
|
||||
{
|
||||
for (ItemStack key : crumbleMap.keySet()) {
|
||||
if (OreDictionary.itemMatches(source, key, false)) {
|
||||
ItemStack target = crumbleMap.get(key);
|
||||
world.setBlock(xCoord, yCoord, zCoord, Block.getBlockFromItem(target.getItem()),
|
||||
target.getItemDamage(), 2);
|
||||
|
||||
world.setBlock(xCoord, yCoord, zCoord, Block.getBlockFromItem(target.getItem()), target.getItemDamage(), 2);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectCure extends AlleleEffect {
|
||||
|
||||
public AlleleEffectCure(String id, boolean isDominant) {
|
||||
super(id, isDominant, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null) {
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
List<EntityPlayer> entityList = this.getEntitiesWithinRange(genome, housing, EntityPlayer.class);
|
||||
|
||||
for (EntityPlayer player : entityList) {
|
||||
player.curePotionEffects(new ItemStack(Items.milk_bucket));
|
||||
}
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.BeeManager;
|
||||
import magicbees.main.utils.BlockUtil;
|
||||
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
|
||||
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectEmpowering extends AlleleEffect {
|
||||
|
||||
public AlleleEffectEmpowering(String id, boolean isDominant) {
|
||||
super(id, isDominant, 200);
|
||||
combinable = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
|
||||
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
int range = Math.max((int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1);
|
||||
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
|
||||
|
||||
if (NodeHelper.growNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
|
||||
storedData.setInteger(0, storedData.getInteger(0) - throttle);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.BeeManager;
|
||||
import magicbees.main.utils.BlockUtil;
|
||||
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import thaumcraft.api.nodes.NodeType;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectNodeConversion extends AlleleEffect {
|
||||
|
||||
private NodeType targetType;
|
||||
|
||||
public AlleleEffectNodeConversion(String id, NodeType targetNodeType, boolean isDominant, int timeout) {
|
||||
super(id, isDominant, timeout);
|
||||
targetType = targetNodeType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
|
||||
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
|
||||
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
|
||||
|
||||
if (NodeHelper.convertNodeInRangeToType(chunks, world, coords.posX, coords.posY, coords.posZ, range, targetType)) {
|
||||
storedData.setInteger(0, storedData.getInteger(0) - throttle);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.BeeManager;
|
||||
import magicbees.main.utils.BlockUtil;
|
||||
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
|
||||
|
||||
public class AlleleEffectNodeRepair extends AlleleEffect {
|
||||
|
||||
public AlleleEffectNodeRepair(String id, boolean isDominant) {
|
||||
super(id, isDominant, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
|
||||
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
|
||||
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
|
||||
|
||||
if (NodeHelper.repairNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
|
||||
storedData.setInteger(0, storedData.getInteger(0) - throttle);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import magicbees.bees.AlleleEffect;
|
||||
|
||||
public class AlleleEffectPlaceholder extends AlleleEffect {
|
||||
|
||||
public AlleleEffectPlaceholder(String id, boolean isDominant) {
|
||||
super(id, isDominant, 100000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome,IEffectData storedData, IBeeHousing housing) {
|
||||
return storedData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectPotion extends AlleleEffect {
|
||||
private int potionId;
|
||||
private int duration;
|
||||
private boolean isMalicious;
|
||||
|
||||
public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant) {
|
||||
super(name, isDominant, 200);
|
||||
this.potionId = potionApplied.id;
|
||||
this.duration = 20 * effectDuration;
|
||||
this.isMalicious = false;
|
||||
}
|
||||
|
||||
public AlleleEffectPotion setMalicious() {
|
||||
this.isMalicious = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null) {
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
List<EntityLivingBase> entityList = this.getEntitiesWithinRange(genome, housing, EntityLivingBase.class);
|
||||
|
||||
for (EntityLivingBase e : entityList) {
|
||||
if (this.isMalicious) {
|
||||
int armorPieces = BeeManager.armorApiaristHelper.wearsItems(e, getUID(), true);
|
||||
int finalDuration = this.duration / 4 * (4 - armorPieces);
|
||||
if (finalDuration > 0) {
|
||||
e.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
|
||||
}
|
||||
} else {
|
||||
if (e instanceof EntityPlayer) {
|
||||
e.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.BeeManager;
|
||||
import magicbees.main.utils.BlockUtil;
|
||||
import magicbees.main.utils.compat.thaumcraft.NodeHelper;
|
||||
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectRecharge extends AlleleEffect {
|
||||
|
||||
public AlleleEffectRecharge(String id, boolean isDominant) {
|
||||
super(id, isDominant, 20);
|
||||
combinable = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
|
||||
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
|
||||
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
|
||||
|
||||
if (NodeHelper.rechargeNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
|
||||
storedData.setInteger(0, storedData.getInteger(0) - throttle);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.BeeManager;
|
||||
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectSpawnMob extends AlleleEffect {
|
||||
protected boolean aggosOnPlayer;
|
||||
protected boolean spawnsWhilePlayerNear;
|
||||
protected String alternateMob;
|
||||
protected String mobName;
|
||||
protected String mobSound;
|
||||
protected int chanceToSpawn;
|
||||
protected int maxMobsInArea;
|
||||
|
||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn) {
|
||||
this(id, isDominant, mobToSpawn, null);
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx) {
|
||||
super(id, isDominant, 200);
|
||||
this.aggosOnPlayer = false;
|
||||
this.mobName = mobToSpawn;
|
||||
this.chanceToSpawn = 100;
|
||||
this.maxMobsInArea = 6;
|
||||
this.mobSound = mobSoundFx;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
|
||||
// Throttle; Ready to spawn
|
||||
storedData = new EffectData(1, 1, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
// Check if we're ready to spawn the mob.
|
||||
boolean didSpawn = false;
|
||||
if (storedData.getBoolean(0)) {
|
||||
World w = housing.getWorld();
|
||||
|
||||
int roll = w.rand.nextInt(100);
|
||||
|
||||
if (roll <= chanceToSpawn) {
|
||||
if (spawnsWhilePlayerNear) {
|
||||
EntityPlayer target = findPlayerTarget(genome, housing);
|
||||
|
||||
// Let's spawn a mob. =D
|
||||
if (target != null) {
|
||||
didSpawn = spawnMob(genome, target, w, housing, false);
|
||||
} else if (alternateMob != null) {
|
||||
didSpawn = spawnMob(genome, null, w, housing, true);
|
||||
}
|
||||
} else {
|
||||
storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
|
||||
}
|
||||
} else {
|
||||
playMobLiveSound(genome, housing, w);
|
||||
didSpawn = true;
|
||||
}
|
||||
|
||||
if (didSpawn) {
|
||||
storedData.setBoolean(0, !didSpawn);
|
||||
storedData.setInteger(0, storedData.getInteger(0) - throttle);
|
||||
}
|
||||
}
|
||||
else {
|
||||
storedData.setBoolean(0, true);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
private void playMobLiveSound(IBeeGenome genome, IBeeHousing housing, World w) {
|
||||
if (mobSound != null && w.rand.nextInt(100) < 35) {
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
|
||||
int range = genome.getTerritory()[0];
|
||||
double x = coords.posX + w.rand.nextDouble() * (range * 2) - range;
|
||||
range = genome.getTerritory()[1];
|
||||
double y = coords.posY + w.rand.nextDouble() * (range * 2) - range;
|
||||
range = genome.getTerritory()[2];
|
||||
double z = coords.posZ + w.rand.nextDouble() * (range * 2) - range;
|
||||
w.playSoundEffect(x, y, z, this.mobSound, 0.5f, (w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
private EntityPlayer findPlayerTarget(IBeeGenome genome, IBeeHousing housing) {
|
||||
List<EntityPlayer> entities = getEntitiesWithinRange(genome, housing, EntityPlayer.class);
|
||||
for (EntityPlayer e : entities) {
|
||||
// Check for wearing armor & cancel
|
||||
// Full armor suit is treated as "invisible."
|
||||
if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) e, getUID(), true) < 4) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) {
|
||||
boolean spawnedFlag = false;
|
||||
|
||||
EntityLiving mob;
|
||||
if (spawnAlternate && alternateMob != null) {
|
||||
mob = (EntityLiving) EntityList.createEntityByName(alternateMob, world);
|
||||
} else {
|
||||
mob = (EntityLiving) EntityList.createEntityByName(mobName, world);
|
||||
}
|
||||
|
||||
if (mob != null) {
|
||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||
|
||||
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
||||
AxisAlignedBB.getBoundingBox((int) pos[0], (int) pos[1], (int) pos[2],
|
||||
(int) pos[0] + 1, (int) pos[1] + 1, (int) pos[2] + 1)
|
||||
.expand(8.0D,4.0D, 8.0D)).size();
|
||||
|
||||
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
||||
|
||||
if (entitiesCount < maxMobsInArea && mob.getCanSpawnHere()) {
|
||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||
if (aggosOnPlayer && player != null) {
|
||||
if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) {
|
||||
// Protect fully suited player from initial murder intent.
|
||||
mob.setAttackTarget(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return spawnedFlag;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn) {
|
||||
spawnsWhilePlayerNear = true;
|
||||
alternateMob = alternateMobToSpawn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setAggrosPlayerOnSpawn() {
|
||||
aggosOnPlayer = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setThrottle(int val) {
|
||||
throttle = val;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setChanceToSpawn(int value) {
|
||||
chanceToSpawn = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value) {
|
||||
maxMobsInArea = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) {
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
|
||||
double pos[] = new double[3];
|
||||
pos[0] = coords.posX + (world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2);
|
||||
pos[1] = coords.posY + world.rand.nextInt(3) - 1;
|
||||
pos[2] = coords.posZ + (world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2);
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.BeeManager;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectSpawnMobWeighted extends AlleleEffect {
|
||||
private String[] entityNames;
|
||||
private int[] spawnChance;
|
||||
|
||||
public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance) {
|
||||
super(id, isDominant, throttle);
|
||||
if (mobs.length != chance.length) {
|
||||
throw new IllegalArgumentException("Array lengths must be equal!");
|
||||
}
|
||||
this.entityNames = mobs;
|
||||
this.spawnChance = chance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
if (this.spawnMob(genome, housing)) {
|
||||
storedData.setInteger(0, 0);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing) {
|
||||
boolean flag = false;
|
||||
|
||||
World w = housing.getWorld();
|
||||
int roll = 0;
|
||||
|
||||
for (int i = 0; i < this.spawnChance.length && !flag; ++i) {
|
||||
roll = 100 - w.rand.nextInt(100) + 1;
|
||||
if (roll < this.spawnChance[i]) {
|
||||
Entity mob = EntityList.createEntityByName(this.entityNames[i], w);
|
||||
if (mob != null) {
|
||||
flag = true;
|
||||
double[] coords = this.randomMobSpawnCoords(w, genome, housing);
|
||||
|
||||
mob.setPositionAndRotation(coords[0], coords[1], coords[2], w.rand.nextFloat() * 360f, 0f);
|
||||
if (mob instanceof EntityLiving) {
|
||||
if (((EntityLiving) mob).getCanSpawnHere()) {
|
||||
w.spawnEntityInWorld(mob);
|
||||
}
|
||||
} else {
|
||||
w.spawnEntityInWorld(mob);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) {
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
|
||||
double pos[] = new double[3];
|
||||
pos[0] = coords.posX + world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2;
|
||||
pos[1] = coords.posY + world.rand.nextDouble() * (bee.getTerritory()[1] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[1] / 2;
|
||||
pos[2] = coords.posZ + world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2;
|
||||
return pos;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
|
||||
public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob {
|
||||
|
||||
private byte[] wispTypes = {
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||
21, 23, 24, 25, 26, 27, 28, 29, 30,
|
||||
31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
41, 42, 43, 44, 45, 46, 47
|
||||
};
|
||||
|
||||
public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay) {
|
||||
super(id, isDominant, mobToSpawn, soundToPlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) {
|
||||
boolean spawnedFlag = false;
|
||||
|
||||
EntityLiving mob;
|
||||
if (spawnAlternate && this.alternateMob != null) {
|
||||
mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world);
|
||||
} else {
|
||||
mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world);
|
||||
}
|
||||
|
||||
if (mob != null) {
|
||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||
|
||||
int entitiesCount = world.getEntitiesWithinAABB(
|
||||
mob.getClass(),
|
||||
AxisAlignedBB.getBoundingBox((int) pos[0], (int) pos[1], (int) pos[2], (int) pos[0] + 1, (int) pos[1] + 1, (int) pos[2] + 1).expand(8.0D,
|
||||
4.0D, 8.0D)).size();
|
||||
|
||||
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
||||
|
||||
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere()) {
|
||||
// Try some Reflection on TC code. This could be dangerous.
|
||||
try {
|
||||
Class<?> wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName());
|
||||
Field type = wispEntity.getDeclaredField("type");
|
||||
type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]);
|
||||
} catch (Exception e) { /*
|
||||
* Last time I had a request to post
|
||||
* error messages, I regretted it.
|
||||
*/
|
||||
}
|
||||
|
||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||
if (this.aggosOnPlayer && player != null) {
|
||||
if (BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) {
|
||||
// Protect fully suited player from initial murder
|
||||
// intent.
|
||||
mob.setAttackTarget(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return spawnedFlag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.BeeManager;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectTransmuting extends AlleleEffect {
|
||||
|
||||
private TransmutationEffectController transmutationController;
|
||||
|
||||
public AlleleEffectTransmuting(String id, boolean isDominant, TransmutationEffectController effectController, int timeoutBeeTicks) {
|
||||
super(id, isDominant, timeoutBeeTicks);
|
||||
this.transmutationController = effectController;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
|
||||
storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
ChunkCoordinates coords = housing.getCoordinates();
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
|
||||
|
||||
// Get random coords within territory
|
||||
int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
|
||||
int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2;
|
||||
int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2;
|
||||
int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2;
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
|
||||
transmutationController.attemptTransmutations(world, biome,
|
||||
new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)), xCoord, yCoord, zCoord);
|
||||
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
@@ -0,0 +1,46 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.api.bees.ITransmutationEffectController;
|
||||
import magicbees.api.bees.ITransmutationEffectLogic;
|
||||
import magicbees.main.utils.LogHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
public class TransmutationEffectController implements ITransmutationEffectController {
|
||||
private List<ITransmutationEffectLogic> logicObjects;
|
||||
|
||||
public TransmutationEffectController(ITransmutationEffectLogic... effectLogic) {
|
||||
logicObjects = new ArrayList<ITransmutationEffectLogic>();
|
||||
for (ITransmutationEffectLogic logic : effectLogic) {
|
||||
logicObjects.add(logic);
|
||||
}
|
||||
}
|
||||
|
||||
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
Collections.shuffle(logicObjects);
|
||||
for (ITransmutationEffectLogic logic : logicObjects) {
|
||||
try {
|
||||
if (logic.tryTransmutation(world, biome, sourceBlock, x, y, z)) {
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogHelper.warn(String.format("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.",
|
||||
logic.getClass().getName()));
|
||||
LogHelper.info(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEffectLogic(ITransmutationEffectLogic logic) {
|
||||
if (logic != null && !logicObjects.contains(logic)) {
|
||||
logicObjects.add(logic);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import magicbees.api.bees.ITransmutationEffectLogic;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TransmutationEffectLBotaniaLiving implements ITransmutationEffectLogic {
|
||||
|
||||
@Override
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
int[] oreIDs = OreDictionary.getOreIDs(sourceBlock);
|
||||
for (int oreId : oreIDs) {
|
||||
if (oreId == OreDictionary.getOreID("logWood")) {
|
||||
world.setBlock(x, y, z, BotaniaHelper.blockLivingWood);
|
||||
return true;
|
||||
}
|
||||
else if (oreId == OreDictionary.getOreID("stone")) {
|
||||
world.setBlock(x, y, z, BotaniaHelper.blockLivingRock);
|
||||
return true;
|
||||
}
|
||||
else if (oreId == OreDictionary.getOreID("livingwood")) {
|
||||
world.setBlock(x, y, z, BotaniaHelper.blockDreamWood);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+13
-25
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -12,30 +12,22 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TransmutationEffectRailcraft implements ITransmutationEffectLogic
|
||||
{
|
||||
public class TransmutationEffectRailcraft implements ITransmutationEffectLogic {
|
||||
@Override
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false) ||
|
||||
OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false))
|
||||
{
|
||||
flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z) ||
|
||||
trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z);
|
||||
if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false)
|
||||
|| OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false)) {
|
||||
flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z) || trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
|
||||
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) &&
|
||||
!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY))
|
||||
{
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) && !BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) {
|
||||
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1);
|
||||
if (item != null)
|
||||
{
|
||||
if (item != null) {
|
||||
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
|
||||
flag = true;
|
||||
}
|
||||
@@ -43,15 +35,11 @@ public class TransmutationEffectRailcraft implements ITransmutationEffectLogic
|
||||
return flag;
|
||||
}
|
||||
|
||||
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) &&
|
||||
!biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river"))
|
||||
{
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) && !biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river")) {
|
||||
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.abyssal", 1);
|
||||
if (item != null)
|
||||
{
|
||||
if (item != null) {
|
||||
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
|
||||
flag = true;
|
||||
}
|
||||
+5
-10
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import magicbees.api.bees.ITransmutationEffectLogic;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -8,20 +8,15 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TransmutationEffectVanilla implements ITransmutationEffectLogic
|
||||
{
|
||||
public class TransmutationEffectVanilla implements ITransmutationEffectLogic {
|
||||
@Override
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
return trySpawnSandstone(world, biome, sourceBlock, x, y, z);
|
||||
}
|
||||
|
||||
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) &&
|
||||
OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false))
|
||||
{
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) && OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false)) {
|
||||
world.setBlock(x, y, z, Blocks.sandstone);
|
||||
flag = true;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.genetics.IFlower;
|
||||
import forestry.api.genetics.IFlowerGrowthRule;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
|
||||
public abstract class FlowerProvider implements IFlowerProvider {
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public Set<IFlower> getFlowers() {
|
||||
return FlowerManager.flowerRegistry.getAcceptableFlowers(getFlowerType());
|
||||
}
|
||||
|
||||
protected void registerPlantableFlower(Block block, int meta, int weight) {
|
||||
FlowerManager.flowerRegistry.registerPlantableFlower(block, meta, weight, getFlowerType());
|
||||
}
|
||||
|
||||
protected void registerAcceptableFlower(Block block, int meta) {
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(block, meta, getFlowerType());
|
||||
}
|
||||
|
||||
protected void registerGrowthRule(IFlowerGrowthRule growthRule) {
|
||||
FlowerManager.flowerRegistry.registerGrowthRule(growthRule, getFlowerType());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
import forestry.api.genetics.IFlowerGrowthRule;
|
||||
import forestry.api.genetics.IFlowerRegistry;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderArsMagicaFlower extends FlowerProvider implements IFlowerGrowthRule {
|
||||
|
||||
public FlowerProviderArsMagicaFlower() {
|
||||
registerPlantableFlower(ArsMagicaHelper.blackOrchid, 0, 1);
|
||||
registerPlantableFlower(ArsMagicaHelper.desertNova, 0, 1);
|
||||
registerPlantableFlower(ArsMagicaHelper.aum, 0, 1);
|
||||
registerPlantableFlower(ArsMagicaHelper.wakebloom, 0, 1);
|
||||
registerPlantableFlower(ArsMagicaHelper.tarmaRoot, 0, 1);
|
||||
registerGrowthRule(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return "flowersArsMagica";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.arsmagica");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
private boolean growFlower(World world, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass) {
|
||||
int dart = world.rand.nextInt(100);
|
||||
Block block;
|
||||
if (dart > 60) {
|
||||
block = ArsMagicaHelper.blackOrchid;
|
||||
} else if (dart > 30) {
|
||||
block = ArsMagicaHelper.aum;
|
||||
} else {
|
||||
block = ArsMagicaHelper.tarmaRoot;
|
||||
}
|
||||
world.setBlock(x, y, z, block);
|
||||
flag = true;
|
||||
} else if (blockDown == Blocks.sand) {
|
||||
world.setBlock(x, y, z, ArsMagicaHelper.desertNova);
|
||||
flag = true;
|
||||
} else if (blockDown == Blocks.stone) {
|
||||
world.setBlock(x, y, z, ArsMagicaHelper.tarmaRoot);
|
||||
flag = true;
|
||||
} else if (blockDown == Blocks.water || blockDown == Blocks.water) {
|
||||
world.setBlock(x, y, z, ArsMagicaHelper.wakebloom);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderAuraNode extends FlowerProvider {
|
||||
|
||||
public FlowerProviderAuraNode() {
|
||||
registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.ordinal());
|
||||
registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.ENERGIZED_NODE.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return "flowersThaumcraftAuraNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.node");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack) {
|
||||
for (ItemStack stack : products) {
|
||||
if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage()) {
|
||||
if (stack.stackSize < stack.getItem().getItemStackLimit(stack)) {
|
||||
stack.stackSize += itemStack.stackSize;
|
||||
itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemStack.stackSize > 0) {
|
||||
ItemStack[] newProducts = new ItemStack[products.length + 1];
|
||||
for (int i = 0; i < products.length; ++i) {
|
||||
newProducts[i] = products[i];
|
||||
}
|
||||
newProducts[products.length] = itemStack;
|
||||
products = newProducts;
|
||||
}
|
||||
|
||||
return products;
|
||||
}
|
||||
|
||||
}
|
||||
+25
-34
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
@@ -7,49 +7,40 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderBookshelf implements IFlowerProvider
|
||||
{
|
||||
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int i, int j)
|
||||
{
|
||||
boolean flag = false;
|
||||
if (world.getBlock(x, i, j) == Blocks.bookshelf)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int i, int j)
|
||||
{
|
||||
// Always return true so the system thinks we grew a flower.
|
||||
// Bees can't grow bookshelves! Are you crazy?!
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[])
|
||||
{
|
||||
return products;
|
||||
}
|
||||
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
|
||||
public class FlowerProviderBookshelf extends FlowerProvider {
|
||||
|
||||
public FlowerProviderBookshelf() {
|
||||
registerAcceptableFlower(Blocks.bookshelf, OreDictionary.WILDCARD_VALUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int i, int j) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return "flowersBookshelf";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[]) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
EnumSet<EnumPlantType> types = pollinatable.getPlantType();
|
||||
return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water);
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.book");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
import forestry.api.genetics.IFlowerGrowthRule;
|
||||
import forestry.api.genetics.IFlowerRegistry;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderBotania extends FlowerProvider implements IFlowerGrowthRule {
|
||||
|
||||
public FlowerProviderBotania() {
|
||||
registerPlantableFlower(BotaniaHelper.blockMysticalFlower, OreDictionary.WILDCARD_VALUE, 1);
|
||||
registerGrowthRule(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual individual, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
private boolean growFlower(World world, int x, int y, int z) {
|
||||
if (world.isAirBlock(x, y, z) && BotaniaHelper.blockMysticalFlower.canPlaceBlockAt(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, BotaniaHelper.blockMysticalFlower);
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.rand.nextInt(16), 2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.botania");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return "flowersBotania";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 0;
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IFlowerGrowthHelper;
|
||||
import forestry.api.genetics.IFlowerGrowthRule;
|
||||
import forestry.api.genetics.IFlowerRegistry;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderThaumcraftFlower extends FlowerProvider implements IFlowerGrowthRule {
|
||||
|
||||
public FlowerProviderThaumcraftFlower() {
|
||||
registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 1);
|
||||
registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 1);
|
||||
registerGrowthRule(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return "flowersThaumcraft";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.magic");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return 0 < pollinatable.getPlantType().size();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) {
|
||||
return growFlower(world, x, y, z);
|
||||
}
|
||||
|
||||
private boolean growFlower(World world, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass) {
|
||||
world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2);
|
||||
flag = true;
|
||||
} else if (blockDown == Blocks.sand) {
|
||||
world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -71,8 +71,8 @@ public class BlockEffectJar extends BlockContainer
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
this.dropInventory(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
private void dropInventory(World world, int x, int y, int z)
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package magicbees.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.utils.TabMagicBees;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockEnchantedEarth extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon top;
|
||||
|
||||
public BlockEnchantedEarth() {
|
||||
super(Material.ground);
|
||||
setCreativeTab(TabMagicBees.tabMagicBees);
|
||||
setBlockName("enchantedEarth");
|
||||
setBlockTextureName(CommonProxy.DOMAIN + ":enchantedEarth");
|
||||
setTickRandomly(true);
|
||||
setStepSound(soundTypeGravel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||
for (int height = y + 1; height <= 256; ++height) {
|
||||
Block b = world.getBlock(x, height, z);
|
||||
if (b == this) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if (b.getTickRandomly()) {
|
||||
world.scheduleBlockUpdate(x, height, z, b, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (y < 256 && random.nextInt(2) == 0) {
|
||||
int newX = x + (random.nextInt(3) - 1);
|
||||
int newZ = z + (random.nextInt(3) - 1);
|
||||
int newY = y + 1;
|
||||
Block b = world.getBlock(newX, newY, newZ);
|
||||
if (b.getTickRandomly()) {
|
||||
world.scheduleBlockUpdate(newX, newY, newZ, b, random.nextInt(5) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (side == 1) {
|
||||
return top;
|
||||
}
|
||||
return super.getIcon(side, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
top = iconRegister.registerIcon(textureName + "_top");
|
||||
super.registerBlockIcons(iconRegister);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package magicbees.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import magicbees.client.gui.UIScreens;
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.MagicBees;
|
||||
@@ -18,8 +16,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.swing.*;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMagicApiary extends BlockContainer
|
||||
{
|
||||
@@ -61,7 +59,7 @@ public class BlockMagicApiary extends BlockContainer
|
||||
}else if (side == 2 || side == 3){
|
||||
return icons[2];
|
||||
}else{
|
||||
return icons[4];
|
||||
return icons[3];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,12 +67,12 @@ public class BlockMagicApiary extends BlockContainer
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
icons = new IIcon[5];
|
||||
icons = new IIcon[4];
|
||||
|
||||
icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.0");
|
||||
icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.1");
|
||||
icons[2] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.2");
|
||||
icons[4] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.4");
|
||||
icons[3] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.4");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package magicbees.block;
|
||||
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.utils.TabMagicBees;
|
||||
import magicbees.tileentity.TileEntityManaAuraProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockManaAuraProvider extends Block implements ITileEntityProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon topIcon;
|
||||
|
||||
public BlockManaAuraProvider() {
|
||||
super(Material.rock);
|
||||
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||
this.setBlockName("manaAuraProvider");
|
||||
this.setHardness(2f);
|
||||
this.setResistance(3f);
|
||||
this.setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityManaAuraProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster0");
|
||||
this.topIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster1");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
return (side == 0 || side == 1) ? this.topIcon : this.blockIcon;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package magicbees.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import magicbees.block.types.PlankType;
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.Config;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockPlanks extends Block
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] IIcons;
|
||||
|
||||
public BlockPlanks()
|
||||
{
|
||||
super(Material.wood);
|
||||
this.setHardness(2.5f);
|
||||
this.setResistance(6.0f);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
if (Config.areMagicPlanksFlammable)
|
||||
{
|
||||
Blocks.fire.setFireInfo(this, 5, 20);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
|
||||
{
|
||||
for (PlankType type : PlankType.values())
|
||||
{
|
||||
itemsList.add(new ItemStack(this, 1, type.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
return this.IIcons[Math.max(0, Math.min(meta & 7, IIcons.length - 1))];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister par1IIconRegister)
|
||||
{
|
||||
this.IIcons = new IIcon[PlankType.values().length];
|
||||
for (PlankType t : PlankType.values())
|
||||
{
|
||||
this.IIcons[t.ordinal()] = par1IIconRegister.registerIcon(CommonProxy.DOMAIN + ":" + t.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package magicbees.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import magicbees.block.types.PlankType;
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.Config;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockWoodSlab extends BlockSlab
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public BlockWoodSlab(boolean doubleSlab)
|
||||
{
|
||||
super(doubleSlab, Material.wood);
|
||||
this.setHardness(2.5f);
|
||||
this.setResistance(6.0f);
|
||||
this.setBlockName("tb.slab.wood");
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
this.setLightOpacity(doubleSlab ? 255 : 0);
|
||||
if (Config.areMagicPlanksFlammable)
|
||||
{
|
||||
Blocks.fire.setFireInfo(this, 5, 20);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int id, Random rand, int par3)
|
||||
{
|
||||
return Item.getItemFromBlock(Config.slabWoodHalf);
|
||||
}
|
||||
|
||||
protected ItemStack createStackedBlock(int meta)
|
||||
{
|
||||
return new ItemStack(Config.planksWood, 1, meta & 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String func_150002_b(int meta)
|
||||
{
|
||||
return this.getUnlocalizedName() + "." + PlankType.getType(meta).name;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
|
||||
{
|
||||
for (PlankType type : PlankType.values())
|
||||
{
|
||||
itemsList.add(new ItemStack(this, 1, type.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
return this.icons[Math.max(0, Math.min(meta & 7, icons.length - 1))];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
this.icons = new IIcon[PlankType.values().length];
|
||||
for (PlankType t : PlankType.values())
|
||||
{
|
||||
this.icons[t.ordinal()] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":" + t.name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if (block.isAir(world, x, y, z))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Item item = Item.getItemFromBlock(block);
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package magicbees.block.types;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
import magicbees.bees.BeeGenomeManager;
|
||||
import magicbees.bees.BeeSpecies;
|
||||
@@ -127,14 +128,16 @@ public enum HiveType
|
||||
ArrayList<ItemStack> hiveDrops = new ArrayList<ItemStack>();
|
||||
int dart;
|
||||
|
||||
Collections.shuffle(this.drops);
|
||||
|
||||
// Get a princess.
|
||||
int throttle = 0;
|
||||
while (hiveDrops.size() <= 0 && throttle < 10)
|
||||
{
|
||||
++throttle;
|
||||
dart = world.rand.nextInt(100);
|
||||
for (IHiveDrop drop : drops)
|
||||
{
|
||||
dart = world.rand.nextInt(100);
|
||||
if (dart <= drop.getChance(world, x, y, z))
|
||||
{
|
||||
hiveDrops.add(drop.getPrincess(world, x, y, z, fortune));
|
||||
@@ -144,9 +147,9 @@ public enum HiveType
|
||||
}
|
||||
|
||||
// Get a drone, maybe.
|
||||
dart = world.rand.nextInt(100);
|
||||
for (IHiveDrop drop : drops)
|
||||
{
|
||||
dart = world.rand.nextInt(100);
|
||||
if (dart <= drop.getChance(world, x, y, z))
|
||||
{
|
||||
hiveDrops.addAll(drop.getDrones(world, x, y, z, fortune));
|
||||
@@ -155,9 +158,9 @@ public enum HiveType
|
||||
}
|
||||
|
||||
// Get additional drops.
|
||||
dart = world.rand.nextInt(100);
|
||||
for (IHiveDrop drop : drops)
|
||||
{
|
||||
dart = world.rand.nextInt(100);
|
||||
if (dart <= drop.getChance(world, x, y, z))
|
||||
{
|
||||
hiveDrops.addAll(drop.getAdditional(world, x, y, z, fortune));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package magicbees.client.gui;
|
||||
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
import magicbees.bees.BeeManager;
|
||||
import magicbees.main.utils.ItemInterface;
|
||||
import magicbees.tileentity.TileEntityMagicApiary;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -19,7 +19,7 @@ public class ContainerMagicApiary extends ContainerMB {
|
||||
private static final int SLOT_QUEEN = 0;
|
||||
private static final int SLOT_DRONE = 1;
|
||||
private static final int SLOT_FRAME_START = 2;
|
||||
private static final int SLOT_INVENTORY_START = 5;
|
||||
private static final int SLOT_INVENTORY_START = 5;
|
||||
private static final int SLOT_FRAME_COUNT = 3;
|
||||
private static final int SLOT_INVENTORY_COUNT = 7;
|
||||
|
||||
@@ -74,14 +74,14 @@ public class ContainerMagicApiary extends ContainerMB {
|
||||
clearSlot = this.mergeItemStack(srcStack, maxSlot + 1, maxSlot + 36, false);
|
||||
}else{
|
||||
if (slotIndex > maxSlot && srcStack != null){
|
||||
if (PluginApiculture.beeInterface.isMember(srcStack)){
|
||||
if (!PluginApiculture.beeInterface.isDrone(srcStack)){
|
||||
if (BeeManager.beeRoot.isMember(srcStack)){
|
||||
if (!BeeManager.beeRoot.isDrone(srcStack)){
|
||||
if (this.getSlot(SLOT_QUEEN).getHasStack() == false) {
|
||||
clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN, false);
|
||||
clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN + 1, false);
|
||||
}
|
||||
}else{
|
||||
if (this.getSlot(SLOT_DRONE).isItemValid(srcStack)){
|
||||
clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE, false);
|
||||
clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE + 1, false);
|
||||
}
|
||||
}
|
||||
}else if(srcStack.getItem() instanceof IHiveFrame){
|
||||
|
||||
@@ -31,18 +31,16 @@ public class GUIHandler implements IGuiHandler
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
Object value = null;
|
||||
|
||||
if (ID == UIScreens.EFFECT_JAR.ordinal())
|
||||
{
|
||||
value = new GUIEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player);
|
||||
return new GUIEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player);
|
||||
}else if (ID == UIScreens.THAUMIC_APIARY.ordinal())
|
||||
{
|
||||
TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z);
|
||||
value = new GuiMagicApiary(player.inventory, tileEntityThaumicApiary);
|
||||
}
|
||||
|
||||
return value;
|
||||
return new GuiMagicApiary(player.inventory, tileEntityThaumicApiary);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,13 +2,11 @@ package magicbees.client.gui;
|
||||
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.tileentity.TileEntityMagicApiary;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -1,21 +1,38 @@
|
||||
package magicbees.client.gui;
|
||||
|
||||
import cpw.mods.fml.client.config.GuiConfig;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.VersionInfo;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import cpw.mods.fml.client.config.DummyConfigElement;
|
||||
import cpw.mods.fml.client.config.GuiConfig;
|
||||
import cpw.mods.fml.client.config.IConfigElement;
|
||||
|
||||
public class ModGuiConfig extends GuiConfig
|
||||
{
|
||||
public ModGuiConfig(GuiScreen guiScreen)
|
||||
{
|
||||
super(guiScreen,
|
||||
new ConfigElement(Config.configuration.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
|
||||
VersionInfo.ModName,
|
||||
false,
|
||||
false,
|
||||
super(guiScreen, configElements(), VersionInfo.ModName, false, false,
|
||||
GuiConfig.getAbridgedConfigPath(Config.configuration.toString()));
|
||||
}
|
||||
|
||||
private static List<IConfigElement> configElements() {
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
|
||||
list.add(categoryElement(Config.CATEGORY_GENERAL, "General", "magicbees.config.category.general"));
|
||||
list.add(categoryElement(Config.CATEGORY_DEBUG, "Debug", "magicbees.config.category.debug"));
|
||||
list.add(categoryElement(Config.CATEGORY_MODULES, "Modules", "magicbees.config.category.modules"));
|
||||
list.add(categoryElement(Config.CATEGORY_BOTANIA, "Botania Plugin", "magicbees.config.category.botania"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private static IConfigElement categoryElement(String category, String name, String tooltip_key) {
|
||||
return new DummyConfigElement.DummyCategoryElement(name, tooltip_key,
|
||||
new ConfigElement(Config.configuration.getCategory(category)).getChildElements());
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package magicbees.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
|
||||
public class ItemArmorApiarist extends Item implements IArmorApiarist
|
||||
{
|
||||
|
||||
public ItemArmorApiarist()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static int getNumberPiecesWorn(EntityPlayer player)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
if (wearsHelmet(player))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if (wearsChest(player))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if (wearsLegs(player))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if (wearsBoots(player))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
public static boolean wearsHelmet(EntityPlayer player)
|
||||
{
|
||||
ItemStack armorItem = player.inventory.armorInventory[3];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsChest(EntityPlayer player)
|
||||
{
|
||||
ItemStack armorItem = player.inventory.armorInventory[2];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsLegs(EntityPlayer player)
|
||||
{
|
||||
ItemStack armorItem = player.inventory.armorInventory[1];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsBoots(EntityPlayer player)
|
||||
{
|
||||
ItemStack armorItem = player.inventory.armorInventory[0];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean protectPlayer(EntityPlayer player, ItemStack armor, String cause, boolean doProtect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,6 @@ package magicbees.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import magicbees.item.types.CapsuleType;
|
||||
import magicbees.item.types.FluidType;
|
||||
import magicbees.main.CommonProxy;
|
||||
@@ -14,6 +11,9 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemCapsule extends Item
|
||||
{
|
||||
@@ -46,6 +46,7 @@ public class ItemCapsule extends Item
|
||||
return new ItemStack(this, 1, l.ordinal());
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List itemList)
|
||||
@@ -67,15 +68,15 @@ public class ItemCapsule extends Item
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule" + this.capsuleType.getName().substring(0, 1).toUpperCase()
|
||||
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule" + this.capsuleType.getName().substring(0, 1).toUpperCase()
|
||||
+ this.capsuleType.getName().substring(1));
|
||||
for (FluidType t : FluidType.values())
|
||||
{
|
||||
if (t != FluidType.EMPTY && t.liquidIcon == null)
|
||||
if (t != FluidType.EMPTY)
|
||||
{
|
||||
t.liquidIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID.toLowerCase());
|
||||
t.liquidIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,7 +88,7 @@ public class ItemCapsule extends Item
|
||||
IIcon i = this.itemIcon;
|
||||
if (metadata != 0 && pass == 0)
|
||||
{
|
||||
i = FluidType.values()[Math.max(0, Math.min(metadata, FluidType.values().length - 1))].liquidIcon;
|
||||
i = FluidType.values()[metadata % FluidType.values().length].liquidIcon;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@ package magicbees.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import magicbees.item.types.CombType;
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.compat.ForestryHelper;
|
||||
@@ -13,10 +10,13 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
public class ItemComb extends Item
|
||||
{
|
||||
{
|
||||
public ItemComb()
|
||||
{
|
||||
super();
|
||||
@@ -36,6 +36,7 @@ public class ItemComb extends Item
|
||||
return new ItemStack(this, count, type.ordinal());
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||
@@ -99,4 +100,13 @@ public class ItemComb extends Item
|
||||
return CombType.values()[stack.getItemDamage()].getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamage(ItemStack stack) {
|
||||
if (CombType.values().length < super.getDamage(stack)) {
|
||||
stack.setItemDamage(0);
|
||||
}
|
||||
return super.getDamage(stack);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package magicbees.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.TabMagicBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemCrystalAspect extends Item
|
||||
{
|
||||
public ItemCrystalAspect()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||
this.setHasSubtypes(true);
|
||||
this.setUnlocalizedName("crystalAspect");
|
||||
GameRegistry.registerItem(this, "crystalAspect");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
/*for (EnumTag tag : EnumTag.values())
|
||||
{
|
||||
if (tag == EnumTag.UNKNOWN)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
list.add(new ItemStack(this.itemID, 1, tag.id));
|
||||
}*/
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":crystalAspect");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int pass)
|
||||
{
|
||||
return 0;
|
||||
//return EnumTag.get(stack.getItemDamage()).color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
return LocalizationManager.getLocalizedString("resource.crystalAspect");
|
||||
//return String.format(LocalizationManager.getLocalizedString("resource.crystalAspect"), EnumTag.get(stack.getItemDamage()).name);
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ public class ItemDrop extends Item
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
for (DropType type : DropType.values())
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package magicbees.item;
|
||||
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.arboriculture.IToolGrafter;
|
||||
|
||||
public class ItemGrafter extends Item implements IToolGrafter {
|
||||
|
||||
public ItemGrafter() {
|
||||
super();
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture);
|
||||
this.setHarvestLevel("grafter", 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z) {
|
||||
return 100f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) {
|
||||
int damage = 1;
|
||||
if (ThaumcraftHelper.isActive()) {
|
||||
if (block == ThaumcraftHelper.leaf)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z) & 1;
|
||||
if (meta == 0 || meta == 1)
|
||||
{
|
||||
double chance = Math.random();
|
||||
if (chance <= Config.thaumcraftSaplingDroprate)
|
||||
{
|
||||
this.dropItem(world, x, y, z, new ItemStack(ThaumcraftHelper.plant, 1, meta));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
itemstack.damageItem(damage, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void dropItem(World world, int x, int y, int z, ItemStack item) {
|
||||
if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops")) {
|
||||
float f = 0.7F;
|
||||
double d0 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
EntityItem entityitem = new EntityItem(world, (double)x + d0, (double)y + d1, (double)z + d2, item);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,18 +2,37 @@ package magicbees.item;
|
||||
|
||||
import magicbees.block.types.HiveType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import forestry.core.items.ItemForestryBlock;
|
||||
import net.minecraft.util.IIcon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by Allen on 7/29/2014.
|
||||
*/
|
||||
public class ItemMagicHive extends ItemForestryBlock
|
||||
public class ItemMagicHive extends ItemBlock
|
||||
{
|
||||
public ItemMagicHive(Block block)
|
||||
{
|
||||
super(block);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Block getBlock() {
|
||||
return field_150939_a;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
return this.getBlock().getIcon(1, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -21,10 +40,4 @@ public class ItemMagicHive extends ItemForestryBlock
|
||||
{
|
||||
return getBlock().getUnlocalizedName() + "." + HiveType.getHiveFromMeta(itemstack.getItemDamage()).name().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack p_77653_1_)
|
||||
{
|
||||
return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(p_77653_1_) + ".name")).trim();
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@ import magicbees.main.utils.TabMagicBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
|
||||
public class ItemMagicHiveFrame extends Item implements IHiveFrame
|
||||
@@ -39,91 +39,26 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame
|
||||
// --------- IHiveFrame functions -----------------------------------------
|
||||
|
||||
@Override
|
||||
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
|
||||
{
|
||||
return this.doWear(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(), frame, wear);
|
||||
}
|
||||
|
||||
private ItemStack doWear(World w, int x, int y, int z, ItemStack frame, int wear)
|
||||
{
|
||||
int damage = wear;
|
||||
|
||||
frame.setItemDamage(frame.getItemDamage() + damage);
|
||||
|
||||
if (frame.getItemDamage() >= frame.getMaxDamage())
|
||||
{
|
||||
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) {
|
||||
frame.setItemDamage(frame.getItemDamage() + wear);
|
||||
|
||||
if (frame.getItemDamage() >= frame.getMaxDamage()) {
|
||||
// Break the frame.
|
||||
frame = null;
|
||||
}
|
||||
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeModifier getBeeModifier() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier)
|
||||
{
|
||||
return this.type.territoryMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
|
||||
{
|
||||
return this.type.mutationMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier)
|
||||
{
|
||||
return this.type.lifespanMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier)
|
||||
{
|
||||
return this.type.productionMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier)
|
||||
{
|
||||
return this.type.floweringMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed()
|
||||
{
|
||||
return this.type.isSealed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted()
|
||||
{
|
||||
return this.type.isLit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated()
|
||||
{
|
||||
return this.type.isSunlit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish()
|
||||
{
|
||||
return this.type.isHellish;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier)
|
||||
{
|
||||
return this.type.geneticDecayMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package magicbees.item;
|
||||
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(iface = "vazkii.botania.api.mana.IManaUsingItem", modid = BotaniaHelper.Name, striprefs = true)
|
||||
})
|
||||
public class ItemManasteelGrafter extends ItemGrafter implements IManaUsingItem {
|
||||
|
||||
public static final int MANA_PER_DAMAGE = 90;
|
||||
|
||||
public ItemManasteelGrafter() {
|
||||
super();
|
||||
this.setMaxDamage(15);
|
||||
this.setUnlocalizedName("manasteelGrafter");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = BotaniaHelper.Name)
|
||||
public boolean getIsRepairable(ItemStack toolStack, ItemStack material) {
|
||||
return (material.getItem() == BotaniaHelper.itemManaResource && material.getItemDamage() == BotaniaHelper.ManaResource.MANASTEEL.ordinal()) || super.getIsRepairable(toolStack, material);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manasteelGrafter");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) {
|
||||
// Unsure if the server-side exclusion is necessary, but boy it looks disconcerting on the client if it's in.
|
||||
if (/*!world.isRemote && */stack.getItemDamage() > 0 && player instanceof EntityPlayer) {
|
||||
if (BotaniaHelper.requestMana(stack, (EntityPlayer)player, MANA_PER_DAMAGE, 1)) {
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack arg0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package magicbees.item;
|
||||
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.IToolScoop;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(iface = "vazkii.botania.api.mana.IManaUsingItem", modid = BotaniaHelper.Name, striprefs = true)
|
||||
})
|
||||
public class ItemManasteelScoop extends Item implements IManaUsingItem, IToolScoop {
|
||||
|
||||
public static final int MANA_PER_DAMAGE = 30;
|
||||
|
||||
public ItemManasteelScoop() {
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(20);
|
||||
this.setCreativeTab(forestry.api.core.Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("manasteelScoop");
|
||||
this.setHarvestLevel("scoop", 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase player) {
|
||||
stack.damageItem(1, player);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = BotaniaHelper.Name)
|
||||
public boolean getIsRepairable(ItemStack toolStack, ItemStack material) {
|
||||
return (material.getItem() == BotaniaHelper.itemManaResource && material.getItemDamage() == BotaniaHelper.ManaResource.MANASTEEL.ordinal()) || super.getIsRepairable(toolStack, material);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manasteelScoop");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) {
|
||||
// Unsure if the server-side exclusion is necessary, but boy it looks disconcerting on the client if it's in.
|
||||
if (/*!world.isRemote && */stack.getItemDamage() > 0 && player instanceof EntityPlayer) {
|
||||
if (BotaniaHelper.requestMana(stack, (EntityPlayer)player, MANA_PER_DAMAGE, 1)) {
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ public class ItemMiscResources extends Item
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
for (ResourceType type : ResourceType.values())
|
||||
|
||||
@@ -48,6 +48,7 @@ public class ItemMoonDial extends Item
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List infoList, boolean par4)
|
||||
{
|
||||
if (Config.moonDialShowsPhaseInText &&
|
||||
|
||||
@@ -2,15 +2,19 @@ package magicbees.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import magicbees.main.CommonProxy;
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.TabMagicBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
@@ -20,128 +24,152 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
public class ItemMysteriousMagnet extends Item
|
||||
{
|
||||
@Optional.Interface(modid="Baubles", iface="baubles.api.IBauble")
|
||||
public class ItemMysteriousMagnet extends Item implements IBauble {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon activeIcon;
|
||||
|
||||
private float rangeBase;
|
||||
private float multiplier;
|
||||
private int maxLevel;
|
||||
private final float fudgeFactor = 0.2f;
|
||||
private final float FUDGE_FACTOR = 0.2f;
|
||||
|
||||
public ItemMysteriousMagnet()
|
||||
{
|
||||
public ItemMysteriousMagnet() {
|
||||
super();
|
||||
this.setNoRepair();
|
||||
this.setHasSubtypes(true);
|
||||
this.rangeBase = 3f;
|
||||
this.multiplier = 0.75f;
|
||||
this.maxLevel = 8;
|
||||
this.setUnlocalizedName(CommonProxy.DOMAIN + ":mysteriousMagnet");
|
||||
this.setCreativeTab(TabMagicBees.tabMagicBees);
|
||||
}
|
||||
|
||||
public void setBaseRange(float value)
|
||||
{
|
||||
this.rangeBase = value;
|
||||
}
|
||||
|
||||
public void setLevelMultiplier(float value)
|
||||
{
|
||||
this.multiplier = value;
|
||||
}
|
||||
|
||||
public void setMaximumLevel(int value)
|
||||
{
|
||||
this.maxLevel = value;
|
||||
}
|
||||
|
||||
public int getMaximumLevel()
|
||||
{
|
||||
return this.maxLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
String s = LocalizationManager.getLocalizedString("misc.level", itemStack.getItemDamage() >> 1);
|
||||
if (isMagnetActive(itemStack))
|
||||
{
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
|
||||
String s = LocalizationManager.getLocalizedString("misc.level", getMagnetLevel(itemStack));
|
||||
if (isMagnetActive(itemStack)) {
|
||||
list.add(LocalizationManager.getLocalizedString("misc.magnetActive", s));
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
list.add(LocalizationManager.getLocalizedString("misc.magnetInactive", s));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) {
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
onWornTick(itemStack, (EntityLivingBase) entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
for (int i = 0; i <= this.maxLevel; i++)
|
||||
{
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list) {
|
||||
for (int i = 0; i <= getMaximumLevel(); i++) {
|
||||
list.add(new ItemStack(this, 1, i * 2));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetInactive");
|
||||
this.activeIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetActive");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage)
|
||||
{
|
||||
return isMagnetActive(damage) ? this.activeIcon : this.itemIcon;
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
return isMagnetActive(meta) ? this.activeIcon : this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack itemStack, int pass)
|
||||
{
|
||||
public boolean hasEffect(ItemStack itemStack, int pass) {
|
||||
return isMagnetActive(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
|
||||
{
|
||||
if (player.isSneaking())
|
||||
{
|
||||
itemStack.setItemDamage(itemStack.getItemDamage() ^ 1);
|
||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
||||
if (player.isSneaking()) {
|
||||
toggleActive(itemStack);
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public void toggleActive(ItemStack itemStack) {
|
||||
itemStack.setItemDamage(itemStack.getItemDamage() ^ 1);
|
||||
}
|
||||
|
||||
public boolean isMagnetActive(ItemStack itemStack) {
|
||||
return isMagnetActive(itemStack.getItemDamage());
|
||||
}
|
||||
|
||||
private boolean isMagnetActive(int damage) {
|
||||
return (damage & 0x01) == 1;
|
||||
}
|
||||
|
||||
public int getMaximumLevel() {
|
||||
return Config.magnetMaxLevel;
|
||||
}
|
||||
|
||||
public int getMagnetLevel(ItemStack itemStack) {
|
||||
return itemStack.getItemDamage() >> 1;
|
||||
}
|
||||
|
||||
private float getRadius(ItemStack itemStack) {
|
||||
return Config.magnetBaseRange + (Config.magnetLevelMultiplier * getMagnetLevel(itemStack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
|
||||
{
|
||||
if (isMagnetActive(itemStack) && entity instanceof EntityPlayer)
|
||||
{
|
||||
public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid="Baubles")
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.AMULET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEquipped(ItemStack itemStack, EntityLivingBase entity) {
|
||||
if (!isMagnetActive(itemStack)) {
|
||||
toggleActive(itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnequipped(ItemStack itemStack, EntityLivingBase entity) {
|
||||
if (isMagnetActive(itemStack)) {
|
||||
toggleActive(itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onWornTick(ItemStack itemStack, EntityLivingBase entity) {
|
||||
if (isMagnetActive(itemStack) && entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer)entity;
|
||||
int dragCount = player.getCommandSenderName().hashCode();
|
||||
float radius = getRadius(itemStack.getItemDamage()) - fudgeFactor;
|
||||
World world = entity.worldObj;
|
||||
float radius = getRadius(itemStack) - FUDGE_FACTOR;
|
||||
AxisAlignedBB bounds = player.boundingBox.expand(radius, radius, radius);
|
||||
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
|
||||
{
|
||||
bounds.expand(fudgeFactor, fudgeFactor, fudgeFactor);
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
|
||||
bounds.expand(FUDGE_FACTOR, FUDGE_FACTOR, FUDGE_FACTOR);
|
||||
|
||||
if ((itemStack.getItemDamage() >> 1) >= 7)
|
||||
{
|
||||
if (7 <= getMagnetLevel(itemStack)) {
|
||||
List<EntityArrow> arrows = world.getEntitiesWithinAABB(EntityArrow.class, bounds);
|
||||
|
||||
for (EntityArrow arrow : arrows)
|
||||
{
|
||||
if (arrow.canBePickedUp == 1 && world.rand.nextInt(6) == 0)
|
||||
{
|
||||
for (EntityArrow arrow : arrows) {
|
||||
if ((arrow.canBePickedUp == 1 || world.rand.nextFloat() < 0.3f)
|
||||
&& arrow.shootingEntity != entity) {
|
||||
EntityItem replacement = new EntityItem(world, arrow.posX, arrow.posY, arrow.posZ,
|
||||
new ItemStack(Items.arrow));
|
||||
world.spawnEntityInWorld(replacement);
|
||||
@@ -153,15 +181,16 @@ public class ItemMysteriousMagnet extends Item
|
||||
|
||||
List<EntityItem> list = world.getEntitiesWithinAABB(EntityItem.class, bounds);
|
||||
|
||||
for (EntityItem e : list)
|
||||
{
|
||||
if (e.age >= 10)
|
||||
{
|
||||
for (EntityItem e : list) {
|
||||
if (e.age >= 10) {
|
||||
double x = player.posX - e.posX;
|
||||
double y = player.posY - e.posY;
|
||||
double y = player.posY - e.posY - 1.f;
|
||||
double z = player.posZ - e.posZ;
|
||||
|
||||
double length = Math.sqrt(x * x + y * y + z * z) * 2;
|
||||
|
||||
if (length < 1.2f)
|
||||
continue;
|
||||
|
||||
x = x / length + player.motionX / 2;
|
||||
y = y / length + player.motionY / 2;
|
||||
@@ -172,34 +201,17 @@ public class ItemMysteriousMagnet extends Item
|
||||
e.motionZ = z;
|
||||
e.isAirBorne = true;
|
||||
|
||||
if (e.isCollidedHorizontally)
|
||||
{
|
||||
if (e.isCollidedHorizontally) {
|
||||
e.motionY += 1;
|
||||
}
|
||||
|
||||
if (world.rand.nextInt(20) == 0)
|
||||
{
|
||||
if (world.rand.nextFloat() < 0.2f) {
|
||||
float pitch = 0.85f - world.rand.nextFloat() * 3f / 10f;
|
||||
world.playSoundEffect(e.posX, e.posY, e.posZ, "mob.endermen.portal", 0.6f, pitch);
|
||||
if(!Config.disableMagnetSound)
|
||||
world.playSoundEffect(e.posX, e.posY, e.posZ, "mob.endermen.portal", 0.6f, pitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isMagnetActive(ItemStack itemStack)
|
||||
{
|
||||
return isMagnetActive(itemStack.getItemDamage());
|
||||
}
|
||||
|
||||
private boolean isMagnetActive(int damage)
|
||||
{
|
||||
return (damage & 0x01) == 1;
|
||||
}
|
||||
|
||||
private float getRadius(int damageValue)
|
||||
{
|
||||
return this.rangeBase + (multiplier * (damageValue >> 1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,6 +37,7 @@ public class ItemNugget extends Item
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list)
|
||||
{
|
||||
for (NuggetType type : NuggetType.values())
|
||||
|
||||
Loaded 100 of 197 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user