mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-14 09:14:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00c214ee5d | ||
|
|
e497b9505a | ||
|
|
b5ac446e55 | ||
|
|
c00e1b39da | ||
|
|
6e6e806476 | ||
|
|
ef877e2f7d | ||
|
|
669aee5ba6 | ||
|
|
ef468097d0 | ||
|
|
22f2eebbd3 | ||
|
|
f658e9ec57 | ||
|
|
ddf93bc425 | ||
|
|
503361d6d1 | ||
|
|
77edab1ba7 | ||
|
|
7760c556a7 | ||
|
|
5a9c7fb027 | ||
|
|
1f3bcbc746 | ||
|
|
d0cdc58b5a | ||
|
|
91bf137a94 | ||
|
|
07f445757b | ||
|
|
f2f1dd1195 | ||
|
|
c70a3448e5 | ||
|
|
65c6f2b591 | ||
|
|
350c7ed1af | ||
|
|
8b07f1ff4f | ||
|
|
09b631faee | ||
|
|
d1d09c3bfb | ||
|
|
1189f1ccb2 | ||
|
|
bf12c01b96 | ||
|
|
f28ae4b8e4 | ||
|
|
d9f5acd98a | ||
|
|
4f3c73ee98 | ||
|
|
a14ed03d5e | ||
|
|
a80a7429b1 | ||
|
|
8541ba8e53 | ||
|
|
3d65061055 | ||
|
|
41d1e97d7c | ||
|
|
a811e2b5e4 | ||
|
|
4ba17bf8f3 | ||
|
|
0ae7dcefa3 | ||
|
|
bc95495504 | ||
|
|
004c540346 | ||
|
|
c43f1f05c5 | ||
|
|
3ce7424abc | ||
|
|
5cafd12ce8 | ||
|
|
9a423c4bfd | ||
|
|
e4d248b5a9 | ||
|
|
4520180638 | ||
|
|
7d14960a72 | ||
|
|
66bb31bfa8 | ||
|
|
37bb054dd3 |
No files matched your search
@@ -0,0 +1,2 @@
|
||||
# Ignore spotlessApply reformat
|
||||
91bf137a94d1207f943929e0881750a1b8c4f3bf
|
||||
@@ -0,0 +1,44 @@
|
||||
* text eol=lf
|
||||
|
||||
*.[jJ][aA][rR] binary
|
||||
|
||||
*.[pP][nN][gG] binary
|
||||
*.[jJ][pP][gG] binary
|
||||
*.[jJ][pP][eE][gG] binary
|
||||
*.[gG][iI][fF] binary
|
||||
*.[tT][iI][fF] binary
|
||||
*.[tT][iI][fF][fF] binary
|
||||
*.[iI][cC][oO] binary
|
||||
*.[sS][vV][gG] text
|
||||
*.[eE][pP][sS] binary
|
||||
*.[xX][cC][fF] binary
|
||||
|
||||
*.[kK][aA][rR] binary
|
||||
*.[mM]4[aA] binary
|
||||
*.[mM][iI][dD] binary
|
||||
*.[mM][iI][dD][iI] binary
|
||||
*.[mM][pP]3 binary
|
||||
*.[oO][gG][gG] binary
|
||||
*.[rR][aA] binary
|
||||
|
||||
*.7[zZ] binary
|
||||
*.[gG][zZ] binary
|
||||
*.[tT][aA][rR] binary
|
||||
*.[tT][gG][zZ] binary
|
||||
*.[zZ][iI][pP] binary
|
||||
|
||||
*.[tT][cC][nN] binary
|
||||
*.[sS][oO] binary
|
||||
*.[dD][lL][lL] binary
|
||||
*.[dD][yY][lL][iI][bB] binary
|
||||
*.[pP][sS][dD] binary
|
||||
*.[tT][tT][fF] binary
|
||||
*.[oO][tT][fF] binary
|
||||
|
||||
*.[pP][aA][tT][cC][hH] -text
|
||||
|
||||
*.[bB][aA][tT] text eol=crlf
|
||||
*.[cC][mM][dD] text eol=crlf
|
||||
*.[pP][sS]1 text eol=crlf
|
||||
|
||||
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RUNDIR="run"
|
||||
CRASH="crash-reports"
|
||||
SERVERLOG="server.log"
|
||||
|
||||
if [[ -d $RUNDIR/$CRASH ]]; then
|
||||
echo "Crash reports detected:"
|
||||
cat $RUNDIR/$CRASH/crash*.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "Fatal errors were detected" $SERVERLOG; then
|
||||
echo "Fatal errors detected:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
|
||||
echo "Server force stopped:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
|
||||
echo "Server didn't finish startup:"
|
||||
cat server.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "No crash reports detected"
|
||||
exit 0
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Build and test
|
||||
|
||||
@@ -11,35 +9,5 @@ on:
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Setup the workspace
|
||||
run: ./gradlew setupCIWorkspace
|
||||
|
||||
- name: Build the mod
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Run server for 1.5 minutes
|
||||
run: |
|
||||
mkdir run
|
||||
echo "eula=true" > run/eula.txt
|
||||
timeout 90 ./gradlew runServer 2>&1 | tee -a server.log || true
|
||||
|
||||
- name: Test no errors reported during server run
|
||||
run: |
|
||||
chmod +x .github/scripts/test-no-error-reports.sh
|
||||
.github/scripts/test-no-error-reports.sh
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
|
||||
secrets: inherit
|
||||
@@ -1,51 +1,14 @@
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Release tagged build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
tags: [ '*' ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set release version
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Setup the workspace
|
||||
run: ./gradlew setupCIWorkspace
|
||||
|
||||
- name: Build the mod
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Release under current tag
|
||||
uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
|
||||
prerelease: false
|
||||
title: "${{ env.RELEASE_VERSION }}"
|
||||
files: build/libs/*.jar
|
||||
|
||||
- name: Publish to Maven
|
||||
run: ./gradlew publish
|
||||
env:
|
||||
MAVEN_USER: ${{ secrets.MAVEN_USER }}
|
||||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
||||
release-tags:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
|
||||
secrets: inherit
|
||||
+7
-1
@@ -26,7 +26,13 @@ whitelist.json
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
src/main/resources/mixins.*([!.]).json
|
||||
*.bat
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
.factorypath
|
||||
addon.local.gradle
|
||||
addon.local.gradle.kts
|
||||
addon.late.local.gradle
|
||||
addon.late.local.gradle.kts
|
||||
layout.json
|
||||
+1236
-544
File diff suppressed because it is too large.
Load diff
+6
-5
@@ -1,11 +1,12 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:ForestryMC:4.4.6:dev')
|
||||
compile('com.github.GTNewHorizons:NotEnoughItems:2.2.17-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.6.14:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.0.13:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.27:api')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.4.5-GTNH:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.36:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly('curse.maven:cofh-lib-220333:2388748')
|
||||
}
|
||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||
}
|
||||
+53
-1
@@ -15,6 +15,13 @@ autoUpdateBuildScript = false
|
||||
minecraftVersion = 1.7.10
|
||||
forgeVersion = 10.13.4.1614
|
||||
|
||||
# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task.
|
||||
channel = stable
|
||||
mappingsVersion = 12
|
||||
|
||||
# Define other MCP mappings for dependency deobfuscation
|
||||
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
|
||||
|
||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username 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
|
||||
@@ -43,6 +50,8 @@ accessTransformersFile =
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
# Adds some debug arguments like verbose output and export
|
||||
usesMixinDebug = 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!
|
||||
@@ -55,10 +64,53 @@ coreModClass =
|
||||
# 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 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
||||
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
|
||||
forceEnableMixins = 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
|
||||
|
||||
|
||||
# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token.
|
||||
|
||||
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||
# Leave this empty if you don't want to publish on Modrinth.
|
||||
modrinthProjectId =
|
||||
|
||||
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||
# Where scope can be one of [required, optional, incompatible, embedded],
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
modrinthRelations =
|
||||
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
|
||||
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId =
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
# and the name is the CurseForge project slug of the other mod.
|
||||
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
curseForgeRelations =
|
||||
|
||||
|
||||
# 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 = binnie-mods
|
||||
|
||||
# Optional parameter to prevent the source code from being published
|
||||
# noPublishedSources =
|
||||
|
||||
# Uncomment this to disable spotless checks
|
||||
# This should only be uncommented to keep it easier to sync with upstream/other forks.
|
||||
# That is, if there is no other active fork/upstream, NEVER change this.
|
||||
# disableSpotless = true
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,5 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -17,78 +17,110 @@
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -97,7 +129,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
@@ -105,84 +137,109 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin 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`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# 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"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
# 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")"
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# 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"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+92
-100
@@ -1,100 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
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
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,26 +1,4 @@
|
||||
// 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 'http://maven.ic2.player.to/'
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://cursemaven.com'
|
||||
content {
|
||||
includeGroup 'curse.maven'
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url 'https://jitpack.io'
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
// RetroFuturaGradle
|
||||
name "GTNH Maven"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
mavenContent {
|
||||
includeGroup("com.gtnewhorizons.retrofuturagradle")
|
||||
}
|
||||
}
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.diffplug.blowdryerSetup' version '1.6.0'
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
|
||||
}
|
||||
|
||||
blowdryerSetup {
|
||||
repoSubfolder 'gtnhShared'
|
||||
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
|
||||
//devLocal '.' // Use this when testing config updates locally
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package binnie;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.core.ManagerBase;
|
||||
import binnie.core.genetics.ManagerGenetics;
|
||||
import binnie.core.item.ManagerItem;
|
||||
@@ -7,10 +10,9 @@ import binnie.core.liquid.ManagerLiquid;
|
||||
import binnie.core.machines.ManagerMachine;
|
||||
import binnie.core.mod.config.ManagerConfig;
|
||||
import binnie.core.resource.ManagerResource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public final class Binnie {
|
||||
|
||||
public static List<ManagerBase> Managers = new ArrayList<>();
|
||||
public static ManagerGenetics Genetics = new ManagerGenetics();
|
||||
public static ManagerConfig Configuration = new ManagerConfig();
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
package binnie.botany;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.api.IFlower;
|
||||
@@ -42,15 +52,6 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
|
||||
@Mod(
|
||||
modid = "Botany",
|
||||
@@ -59,6 +60,7 @@ import net.minecraftforge.event.world.BlockEvent;
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore")
|
||||
public class Botany extends AbstractMod {
|
||||
|
||||
@Mod.Instance("Botany")
|
||||
public static Botany instance;
|
||||
|
||||
@@ -155,8 +157,7 @@ public class Botany extends AbstractMod {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.entityPlayer != null
|
||||
&& event.entityPlayer.getHeldItem() != null
|
||||
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null
|
||||
&& event.entityPlayer.getHeldItem().getItem() == Items.shears) {
|
||||
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
||||
if (tile instanceof TileEntityFlower) {
|
||||
@@ -166,8 +167,7 @@ public class Botany extends AbstractMod {
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityPlayer != null
|
||||
&& event.entityPlayer.getHeldItem() != null
|
||||
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null
|
||||
&& event.entityPlayer.getHeldItem().getItem() == Botany.pollen) {
|
||||
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
||||
if (tile instanceof TileEntityFlower) {
|
||||
@@ -291,8 +291,7 @@ public class Botany extends AbstractMod {
|
||||
}
|
||||
|
||||
IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.entityPlayer.getHeldItem());
|
||||
if (flower != null
|
||||
&& Gardening.plant(world, x, y + py, z, flower, event.entityPlayer.getGameProfile())
|
||||
if (flower != null && Gardening.plant(world, x, y + py, z, flower, event.entityPlayer.getGameProfile())
|
||||
&& !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||
heldItem.stackSize--;
|
||||
@@ -345,6 +344,7 @@ public class Botany extends AbstractMod {
|
||||
}
|
||||
|
||||
public static class PacketHandler extends BinniePacketHandler {
|
||||
|
||||
public PacketHandler() {
|
||||
super(Botany.instance);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package binnie.botany;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class CreativeTabBotany extends CreativeTabs {
|
||||
|
||||
public static CreativeTabs instance = new CreativeTabBotany();
|
||||
|
||||
public CreativeTabBotany() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.botany.api;
|
||||
|
||||
public enum EnumAcidity {
|
||||
|
||||
ACID,
|
||||
NEUTRAL,
|
||||
ALKALINE;
|
||||
|
||||
@@ -10,6 +10,7 @@ import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
public enum EnumFlowerChromosome implements IChromosomeType {
|
||||
|
||||
SPECIES(IAlleleFlowerSpecies.class),
|
||||
PRIMARY(IAlleleInteger.class),
|
||||
SECONDARY(IAlleleInteger.class),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.botany.api;
|
||||
|
||||
public enum EnumFlowerStage {
|
||||
|
||||
FLOWER("Flower"),
|
||||
SEED("Seed"),
|
||||
POLLEN("Pollen"),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.botany.api;
|
||||
|
||||
public enum EnumMoisture {
|
||||
|
||||
DRY,
|
||||
NORMAL,
|
||||
DAMP;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.botany.api;
|
||||
|
||||
public enum EnumSoilType {
|
||||
|
||||
SOIL,
|
||||
LOAM,
|
||||
FLOWERBED;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package binnie.botany.api;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IAlleleFlowerEffect extends IAlleleEffect {
|
||||
|
||||
IEffectData doEffect(IFlowerGenome genome, IEffectData storedData, World world, int x, int y, int z);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package binnie.botany.api;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public interface IAlleleFlowerSpecies extends IAlleleSpecies {
|
||||
|
||||
IFlowerType getType();
|
||||
|
||||
EnumAcidity getPH();
|
||||
|
||||
@@ -2,4 +2,5 @@ package binnie.botany.api;
|
||||
|
||||
import forestry.api.genetics.IBreedingTracker;
|
||||
|
||||
public interface IBotanistTracker extends IBreedingTracker {}
|
||||
public interface IBotanistTracker extends IBreedingTracker {
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.botany.api;
|
||||
|
||||
public interface IColourMix {
|
||||
|
||||
IFlowerColor getColor1();
|
||||
|
||||
IFlowerColor getColor2();
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package binnie.botany.api;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
public interface IFlower extends IIndividual {
|
||||
|
||||
@Override
|
||||
IFlowerGenome getGenome();
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.botany.api;
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
|
||||
public interface IFlowerColor {
|
||||
|
||||
int getColor(boolean dis);
|
||||
|
||||
IAlleleInteger getAllele();
|
||||
|
||||
@@ -5,6 +5,7 @@ import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IGenome;
|
||||
|
||||
public interface IFlowerGenome extends IGenome {
|
||||
|
||||
@Override
|
||||
IAlleleFlowerSpecies getPrimary();
|
||||
|
||||
|
||||
@@ -5,5 +5,6 @@ import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IMutation;
|
||||
|
||||
public interface IFlowerMutation extends IMutation {
|
||||
|
||||
float getChance(IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1);
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
package binnie.botany.api;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
public interface IFlowerRoot extends ISpeciesRoot {
|
||||
|
||||
@Override
|
||||
IFlower getMember(ItemStack stack);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.botany.api;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public interface IFlowerType {
|
||||
|
||||
IIcon getStem(EnumFlowerStage stage, boolean flowered, int section);
|
||||
|
||||
IIcon getPetalIcon(EnumFlowerStage stage, boolean flowered, int section);
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package binnie.botany.api.gardening;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IBlockSoil {
|
||||
|
||||
EnumAcidity getPH(World world, int x, int y, int z);
|
||||
|
||||
EnumMoisture getMoisture(World world, int x, int y, int z);
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -26,7 +18,18 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCeramic extends Block implements IBlockMetadata {
|
||||
|
||||
public BlockCeramic() {
|
||||
super(Material.rock);
|
||||
setHardness(1.0f);
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.botany.items.BotanyItems;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.IMultipassBlock;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -30,7 +18,22 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.botany.items.BotanyItems;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.IMultipassBlock;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipassBlock {
|
||||
|
||||
public BlockCeramicBrick() {
|
||||
super(Material.rock);
|
||||
setHardness(1.0f);
|
||||
@@ -190,6 +193,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
}
|
||||
|
||||
public enum TileType {
|
||||
|
||||
Tile("tile", "ceramicTile"),
|
||||
Brick("brick", "ceramicBricks"),
|
||||
StripeBrick("brickstripe", "strippedCeramicBricks"),
|
||||
@@ -284,7 +288,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
return null;
|
||||
}
|
||||
|
||||
int[] colors = {-1, -1};
|
||||
int[] colors = { -1, -1 };
|
||||
int altCounter = 0;
|
||||
for (ItemStack stack : stacks) {
|
||||
int alt = (altCounter != 0 && altCounter != 3) ? 1 : 0;
|
||||
@@ -314,7 +318,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
return null;
|
||||
}
|
||||
|
||||
int[] colors = {-1, -1};
|
||||
int[] colors = { -1, -1 };
|
||||
for (ItemStack stack : stacks) {
|
||||
if (stack.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) {
|
||||
return null;
|
||||
@@ -343,7 +347,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
return null;
|
||||
}
|
||||
|
||||
int[] colors = {-1, -1};
|
||||
int[] colors = { -1, -1 };
|
||||
for (ItemStack stack : stacks) {
|
||||
if (stack.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) {
|
||||
return null;
|
||||
@@ -395,7 +399,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
return null;
|
||||
}
|
||||
|
||||
int[] colors = {-1, -1};
|
||||
int[] colors = { -1, -1 };
|
||||
for (ItemStack stack4 : stacks) {
|
||||
if (stack4.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) {
|
||||
return null;
|
||||
@@ -443,7 +447,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
return null;
|
||||
}
|
||||
|
||||
int[] colors = {-1, -1};
|
||||
int[] colors = { -1, -1 };
|
||||
for (int index2 = 0; index2 < stacks.size(); ++index2) {
|
||||
ItemStack stack = stacks.get(index2);
|
||||
if (stack.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) {
|
||||
@@ -502,6 +506,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
}
|
||||
|
||||
public static class BlockType {
|
||||
|
||||
protected EnumFlowerColor color1;
|
||||
protected EnumFlowerColor color2;
|
||||
protected TileType type;
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
@@ -8,12 +14,9 @@ import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.carpentry.BlockDesign;
|
||||
import binnie.extratrees.carpentry.DesignBlock;
|
||||
import binnie.extratrees.carpentry.ModuleCarpentry;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class BlockCeramicPatterned extends BlockDesign {
|
||||
|
||||
public BlockCeramicPatterned() {
|
||||
super(CeramicDesignSystem.instance, Material.rock);
|
||||
setHardness(1.0f);
|
||||
@@ -25,7 +28,10 @@ public class BlockCeramicPatterned extends BlockDesign {
|
||||
@Override
|
||||
public ItemStack getCreativeStack(IDesign design) {
|
||||
return ModuleCarpentry.getItemStack(
|
||||
this, CeramicColor.get(EnumFlowerColor.WHITE), CeramicColor.get(EnumFlowerColor.BLACK), design);
|
||||
this,
|
||||
CeramicColor.get(EnumFlowerColor.WHITE),
|
||||
CeramicColor.get(EnumFlowerColor.BLACK),
|
||||
design);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -28,7 +19,19 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockStained extends Block implements IBlockMetadata {
|
||||
|
||||
public BlockStained() {
|
||||
super(Material.glass);
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
@@ -59,7 +62,7 @@ public class BlockStained extends Block implements IBlockMetadata {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
// Block block2 = world.getBlock(x - Facing.offsetsXForSide[side], y - Facing.offsetsYForSide[side], z -
|
||||
// Block block2 = world.getBlock(x - Facing.offsetsXForSide[side], y - Facing.offsetsYForSide[side], z -
|
||||
// Facing.offsetsZForSide[side]);
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block != this && block != ExtraTrees.blockStained && super.shouldSideBeRendered(world, x, y, z, side);
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CeramicColor implements IDesignMaterial {
|
||||
|
||||
private static Map<EnumFlowerColor, CeramicColor> map;
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.botany.items.BotanyItems;
|
||||
@@ -10,14 +18,9 @@ import binnie.extratrees.api.IDesignSystem;
|
||||
import binnie.extratrees.api.IPattern;
|
||||
import binnie.extratrees.carpentry.DesignerManager;
|
||||
import binnie.extratrees.carpentry.EnumPattern;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class CeramicDesignSystem implements IDesignSystem {
|
||||
|
||||
public static CeramicDesignSystem instance = new CeramicDesignSystem();
|
||||
|
||||
protected Map<Integer, IIcon> primary;
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
|
||||
public class CeramicTileRecipe implements IRecipe {
|
||||
|
||||
protected ItemStack cached;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IFlower;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IFlower;
|
||||
|
||||
public class PigmentRecipe implements IRecipe {
|
||||
|
||||
protected ItemStack cached;
|
||||
|
||||
private ItemStack unknown;
|
||||
@@ -45,10 +47,7 @@ public class PigmentRecipe implements IRecipe {
|
||||
|
||||
IFlower flower = Binnie.Genetics.getFlowerRoot().getMember(crafting.getStackInSlot(i));
|
||||
if (flower.getAge() >= 1) {
|
||||
stack = new ItemStack(
|
||||
Botany.pigment,
|
||||
1,
|
||||
flower.getGenome().getPrimaryColor().getID());
|
||||
stack = new ItemStack(Botany.pigment, 1, flower.getGenome().getPrimaryColor().getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import binnie.botany.api.IFlowerRoot;
|
||||
import binnie.botany.genetics.FlowerHelper;
|
||||
|
||||
public class BotanyCore {
|
||||
|
||||
public static IFlowerRoot speciesRoot = new FlowerHelper();
|
||||
|
||||
public static IFlowerRoot getFlowerRoot() {
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package binnie.botany.core;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.craftgui.WindowBotanistDatabase;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public enum BotanyGUI implements IBinnieGUID {
|
||||
|
||||
Database,
|
||||
DatabaseNEI;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.botany.core;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleCore implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// ignored
|
||||
|
||||
@@ -11,6 +11,7 @@ import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
|
||||
public class ControlColorDisplay extends Control implements IControlValue<IFlowerColor>, ITooltip {
|
||||
|
||||
private IFlowerColor value;
|
||||
|
||||
public ControlColorDisplay(IWidget parent, float x, float y) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.listbox.ControlListBox;
|
||||
|
||||
public class ControlColorMixBox extends ControlListBox<IColourMix> {
|
||||
|
||||
private Type type;
|
||||
|
||||
public ControlColorMixBox(IWidget parent, int x, int y, int width, int height, Type type) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import binnie.core.craftgui.controls.listbox.ControlList;
|
||||
import binnie.core.craftgui.controls.listbox.ControlOption;
|
||||
|
||||
public class ControlColorMixItem extends ControlOption<IColourMix> {
|
||||
|
||||
protected ControlColorDisplay itemWidget1;
|
||||
protected ControlColorDisplay itemWidget2;
|
||||
protected ControlColorDisplay itemWidget3;
|
||||
|
||||
@@ -9,6 +9,7 @@ import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
|
||||
public class ControlColorOption extends ControlTextOption<IFlowerColor> {
|
||||
|
||||
protected ControlColorDisplay controlBee;
|
||||
protected IPoint boxPosition;
|
||||
|
||||
@@ -19,8 +20,7 @@ public class ControlColorOption extends ControlTextOption<IFlowerColor> {
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
|
||||
int th = (int) CraftGUI.render.textHeight(
|
||||
textWidget.getValue(), textWidget.getSize().x());
|
||||
int th = (int) CraftGUI.render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
int height = Math.max(20, th + 6);
|
||||
setSize(new IPoint(size().x(), height));
|
||||
textWidget.setSize(new IPoint(textWidget.getSize().x(), height));
|
||||
|
||||
@@ -14,6 +14,7 @@ import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ControlColourMixSymbol extends Control implements ITooltip {
|
||||
|
||||
protected static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2);
|
||||
protected static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2);
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.botany.api.IColourMix;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
@@ -9,10 +12,9 @@ import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.core.craftgui.database.PageAbstract;
|
||||
import binnie.core.util.I18N;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageColorMix extends PageAbstract<IFlowerColor> {
|
||||
|
||||
ControlText title;
|
||||
ControlColorMixBox list;
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.botany.api.IColourMix;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
@@ -9,10 +12,9 @@ import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.core.craftgui.database.PageAbstract;
|
||||
import binnie.core.util.I18N;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageColorMixResultant extends PageAbstract<IFlowerColor> {
|
||||
|
||||
protected ControlText title;
|
||||
protected ControlColorMixBox list;
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
@@ -22,9 +24,9 @@ import binnie.genetics.genetics.AlleleHelper;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||
|
||||
public PageSpeciesFlowerGenome(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
@@ -103,7 +105,10 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||
I18N.localise("botany.gui.database.tab.genome.fertility"),
|
||||
TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(
|
||||
contents, new IArea(valueX, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFT);
|
||||
contents,
|
||||
new IArea(valueX, y, w3, th),
|
||||
genome.getFertility() + "x",
|
||||
TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
|
||||
float lifespan = genome.getLifespan() * 68.27f / genome.getAgeChance() / 24000.0f;
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
@@ -21,12 +27,9 @@ import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
|
||||
public WindowBotanistDatabase(EntityPlayer player, Side side, boolean nei) {
|
||||
super(player, side, nei, Binnie.Genetics.flowerBreedingSystem, 130.0f);
|
||||
}
|
||||
@@ -40,7 +43,8 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.overview"));
|
||||
new PageSpeciesFlowerGenome(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "genome"));
|
||||
new PageSpeciesClassification(
|
||||
getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.classification"));
|
||||
getInfoPages(Mode.Species),
|
||||
new DatabaseTab(Botany.instance, "species.classification"));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.resultant"));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.further"));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.overview"));
|
||||
@@ -62,6 +66,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
}
|
||||
|
||||
enum FlowerMode implements IDatabaseMode {
|
||||
|
||||
COLOR;
|
||||
|
||||
@Override
|
||||
@@ -71,6 +76,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
}
|
||||
|
||||
private class ColorModeWidget extends ModeWidgets {
|
||||
|
||||
public ColorModeWidget() {
|
||||
super(FlowerMode.COLOR, WindowBotanistDatabase.this);
|
||||
}
|
||||
@@ -78,6 +84,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
listBox = new ControlListBox<IFlowerColor>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
|
||||
@Override
|
||||
public IWidget createOption(IFlowerColor value, int y) {
|
||||
return new ControlColorOption(getContent(), value, y);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.core.circuits.BinnieCircuit;
|
||||
@@ -7,29 +10,24 @@ import binnie.core.util.I18N;
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class CircuitGarden extends BinnieCircuit {
|
||||
|
||||
private boolean isManual;
|
||||
private boolean isFertilised;
|
||||
private ItemStack icon;
|
||||
private EnumMoisture moisture;
|
||||
private EnumAcidity acidity;
|
||||
|
||||
public CircuitGarden(
|
||||
EnumMoisture moisture,
|
||||
EnumAcidity ph,
|
||||
boolean manual,
|
||||
boolean fertilised,
|
||||
ItemStack recipe,
|
||||
public CircuitGarden(EnumMoisture moisture, EnumAcidity ph, boolean manual, boolean fertilised, ItemStack recipe,
|
||||
ItemStack icon) {
|
||||
super(
|
||||
"garden." + moisture.getID() + ((ph != null) ? ("." + ph.getID()) : "") + (manual ? ".manual" : "")
|
||||
"garden." + moisture.getID()
|
||||
+ ((ph != null) ? ("." + ph.getID()) : "")
|
||||
+ (manual ? ".manual" : "")
|
||||
+ (fertilised ? ".fert" : ""),
|
||||
4,
|
||||
manual
|
||||
? ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual")
|
||||
manual ? ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual")
|
||||
: ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed"),
|
||||
recipe);
|
||||
this.moisture = moisture;
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.api.farming.IFarmLogic;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.api.farming.IFarmLogic;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
|
||||
public abstract class FarmLogic implements IFarmLogic {
|
||||
|
||||
protected World world;
|
||||
protected IFarmHousing housing;
|
||||
protected boolean isManual;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IFlower;
|
||||
@@ -7,11 +11,9 @@ import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.gardening.Gardening;
|
||||
import forestry.api.farming.ICrop;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class FarmableFlower implements IFarmable {
|
||||
|
||||
@Override
|
||||
public boolean isSaplingAt(World world, int x, int y, int z) {
|
||||
return world.getBlock(x, y, z) == Botany.flower;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.gardening.Gardening;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.gardening.Gardening;
|
||||
|
||||
public class FarmableVanillaFlower extends FarmableFlower {
|
||||
|
||||
@Override
|
||||
public boolean isGermling(ItemStack itemstack) {
|
||||
return BotanyCore.getFlowerRoot().getConversion(itemstack) != null;
|
||||
|
||||
@@ -1,25 +1,9 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import binnie.botany.flower.TileEntityFlower;
|
||||
import binnie.botany.gardening.Gardening;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.ICrop;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.access.IOwnable;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -31,7 +15,27 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import binnie.botany.flower.TileEntityFlower;
|
||||
import binnie.botany.gardening.Gardening;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.ICrop;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.access.IOwnable;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
|
||||
public class GardenLogic extends FarmLogic {
|
||||
|
||||
protected EnumMoisture moisture;
|
||||
protected EnumAcidity acidity;
|
||||
protected boolean fertilised;
|
||||
@@ -62,8 +66,7 @@ public class GardenLogic extends FarmLogic {
|
||||
@Override
|
||||
public boolean isAcceptedResource(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
return Gardening.isSoil(item)
|
||||
|| item == Item.getItemFromBlock(Blocks.sand)
|
||||
return Gardening.isSoil(item) || item == Item.getItemFromBlock(Blocks.sand)
|
||||
|| item == Item.getItemFromBlock(Blocks.dirt)
|
||||
|| Gardening.isAcidFertiliser(stack)
|
||||
|| Gardening.isAlkalineFertiliser(stack);
|
||||
@@ -79,8 +82,7 @@ public class GardenLogic extends FarmLogic {
|
||||
@Override
|
||||
public boolean cultivate(int x, int y, int z, FarmDirection direction, int extent) {
|
||||
world = housing.getWorld();
|
||||
return maintainSoil(x, y, z, direction, extent)
|
||||
|| !isManual && maintainWater(x, y, z, direction, extent)
|
||||
return maintainSoil(x, y, z, direction, extent) || !isManual && maintainWater(x, y, z, direction, extent)
|
||||
|| maintainCrops(x, y + 1, z, direction, extent);
|
||||
}
|
||||
|
||||
@@ -126,36 +128,25 @@ public class GardenLogic extends FarmLogic {
|
||||
EnumAcidity pH = soil.getPH(world, position.x, position.y, position.z);
|
||||
if (pH.ordinal() < acidity.ordinal()) {
|
||||
ItemStack stack = getAvailableAlkaline();
|
||||
if (stack != null
|
||||
&& soil.setPH(
|
||||
world,
|
||||
position.x,
|
||||
position.y,
|
||||
position.z,
|
||||
EnumAcidity.values()[pH.ordinal() + 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] {stack});
|
||||
if (stack != null && soil
|
||||
.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() + 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (pH.ordinal() > acidity.ordinal()) {
|
||||
ItemStack stack = getAvailableAcid();
|
||||
if (stack != null
|
||||
&& soil.setPH(
|
||||
world,
|
||||
position.x,
|
||||
position.y,
|
||||
position.z,
|
||||
EnumAcidity.values()[pH.ordinal() - 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] {stack});
|
||||
if (stack != null && soil
|
||||
.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() - 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAirBlock(position)
|
||||
&& !world.getBlock(position.x, position.y, position.z)
|
||||
.isReplaceable(world, position.x, position.y, position.z)) {
|
||||
if (!isAirBlock(position) && !world.getBlock(position.x, position.y, position.z)
|
||||
.isReplaceable(world, position.x, position.y, position.z)) {
|
||||
ItemStack block = getAsItemStack(position);
|
||||
ItemStack loam = getAvailableLoam();
|
||||
if (isWaste(block) && loam != null) {
|
||||
@@ -224,20 +215,20 @@ public class GardenLogic extends FarmLogic {
|
||||
private ItemStack getAvailableLoam() {
|
||||
EnumMoisture[] moistures;
|
||||
if (moisture == EnumMoisture.DAMP) {
|
||||
moistures = new EnumMoisture[] {EnumMoisture.DAMP, EnumMoisture.NORMAL, EnumMoisture.DRY};
|
||||
moistures = new EnumMoisture[] { EnumMoisture.DAMP, EnumMoisture.NORMAL, EnumMoisture.DRY };
|
||||
} else if (moisture == EnumMoisture.DRY) {
|
||||
moistures = new EnumMoisture[] {EnumMoisture.DRY, EnumMoisture.DAMP, EnumMoisture.DRY};
|
||||
moistures = new EnumMoisture[] { EnumMoisture.DRY, EnumMoisture.DAMP, EnumMoisture.DRY };
|
||||
} else {
|
||||
moistures = new EnumMoisture[] {EnumMoisture.DRY, EnumMoisture.NORMAL, EnumMoisture.DAMP};
|
||||
moistures = new EnumMoisture[] { EnumMoisture.DRY, EnumMoisture.NORMAL, EnumMoisture.DAMP };
|
||||
}
|
||||
|
||||
EnumAcidity[] acidities = {EnumAcidity.NEUTRAL, EnumAcidity.ACID, EnumAcidity.ALKALINE};
|
||||
EnumAcidity[] acidities = { EnumAcidity.NEUTRAL, EnumAcidity.ACID, EnumAcidity.ALKALINE };
|
||||
|
||||
for (EnumMoisture moist : moistures) {
|
||||
for (EnumAcidity acid : acidities) {
|
||||
for (Block type : new Block[] {Botany.flowerbed, Botany.loam, Botany.soil}) {
|
||||
for (Block type : new Block[] { Botany.flowerbed, Botany.loam, Botany.soil }) {
|
||||
int meta = acid.ordinal() * 3 + moist.ordinal();
|
||||
ItemStack[] resource = {new ItemStack(type, 1, meta)};
|
||||
ItemStack[] resource = { new ItemStack(type, 1, meta) };
|
||||
if (housing.getFarmInventory().hasResources(resource)) {
|
||||
return resource[0];
|
||||
}
|
||||
@@ -245,7 +236,7 @@ public class GardenLogic extends FarmLogic {
|
||||
}
|
||||
}
|
||||
|
||||
if (housing.getFarmInventory().hasResources(new ItemStack[] {new ItemStack(Blocks.dirt)})) {
|
||||
if (housing.getFarmInventory().hasResources(new ItemStack[] { new ItemStack(Blocks.dirt) })) {
|
||||
return new ItemStack(Blocks.dirt);
|
||||
}
|
||||
return null;
|
||||
@@ -266,7 +257,7 @@ public class GardenLogic extends FarmLogic {
|
||||
}
|
||||
|
||||
setBlock(position, ((ItemBlock) loam.getItem()).field_150939_a, loam.getItemDamage());
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] {copy});
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] { copy });
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -286,7 +277,7 @@ public class GardenLogic extends FarmLogic {
|
||||
return trySetSoil(position);
|
||||
}
|
||||
|
||||
ItemStack[] sand = {new ItemStack(Blocks.sand, 1)};
|
||||
ItemStack[] sand = { new ItemStack(Blocks.sand, 1) };
|
||||
if (!housing.getFarmInventory().hasResources(sand)) {
|
||||
return false;
|
||||
}
|
||||
@@ -368,8 +359,7 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
try {
|
||||
IOwnable housing2 = (IOwnable) housing;
|
||||
GameProfile prof = (GameProfile) IOwnable.class
|
||||
.getMethod("getOwnerProfile", new Class[0])
|
||||
GameProfile prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0])
|
||||
.invoke(housing2);
|
||||
((TileEntityFlower) tile).setOwner(prof);
|
||||
} catch (Exception ex) {
|
||||
@@ -382,9 +372,8 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
public ItemStack getAvailableAcid() {
|
||||
for (ItemStack stack : Gardening.getAcidFertilisers()) {
|
||||
if (stack != null
|
||||
&& stack.getItem() != null
|
||||
&& housing.getFarmInventory().hasResources(new ItemStack[] {stack})) {
|
||||
if (stack != null && stack.getItem() != null
|
||||
&& housing.getFarmInventory().hasResources(new ItemStack[] { stack })) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
@@ -393,22 +382,16 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
public ItemStack getAvailableAlkaline() {
|
||||
for (ItemStack stack : Gardening.getAlkalineFertilisers()) {
|
||||
if (stack != null
|
||||
&& stack.getItem() != null
|
||||
&& housing.getFarmInventory().hasResources(new ItemStack[] {stack})) {
|
||||
if (stack != null && stack.getItem() != null
|
||||
&& housing.getFarmInventory().hasResources(new ItemStack[] { stack })) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setData(
|
||||
EnumMoisture moisture,
|
||||
EnumAcidity acidity,
|
||||
boolean isManual,
|
||||
boolean fertilised,
|
||||
ItemStack icon,
|
||||
String name) {
|
||||
public void setData(EnumMoisture moisture, EnumAcidity acidity, boolean isManual, boolean fertilised,
|
||||
ItemStack icon, String name) {
|
||||
this.moisture = moisture;
|
||||
this.acidity = acidity;
|
||||
this.isManual = isManual;
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.botany.api.IFlowerType;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.gardening.Gardening;
|
||||
import binnie.botany.genetics.EnumFlowerType;
|
||||
import binnie.core.BinnieCore;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -28,7 +18,21 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.botany.api.IFlowerType;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.gardening.Gardening;
|
||||
import binnie.botany.genetics.EnumFlowerType;
|
||||
import binnie.core.BinnieCore;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockFlower extends BlockContainer {
|
||||
|
||||
public BlockFlower() {
|
||||
super(Material.plants);
|
||||
float f = 0.2f;
|
||||
@@ -117,8 +121,7 @@ public class BlockFlower extends BlockContainer {
|
||||
return flower.getStem(stage, flowered, section);
|
||||
}
|
||||
|
||||
return (RendererBotany.pass == 1)
|
||||
? flower.getPetalIcon(stage, flowered, section)
|
||||
return (RendererBotany.pass == 1) ? flower.getPetalIcon(stage, flowered, section)
|
||||
: flower.getVariantIcon(stage, flowered, section);
|
||||
}
|
||||
|
||||
@@ -155,8 +158,7 @@ public class BlockFlower extends BlockContainer {
|
||||
}
|
||||
|
||||
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||
if (flower.getSection() == 0
|
||||
&& flower.getFlower() != null
|
||||
if (flower.getSection() == 0 && flower.getFlower() != null
|
||||
&& flower.getFlower().getAge() > 0
|
||||
&& flower.getFlower().getGenome().getPrimary().getType().getSections() > 1
|
||||
&& world.getBlock(x, y + 1, z) != Botany.flower) {
|
||||
@@ -209,8 +211,7 @@ public class BlockFlower extends BlockContainer {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
List<ItemStack> drops = getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
boolean hasBeenBroken = world.setBlockToAir(x, y, z);
|
||||
if (hasBeenBroken
|
||||
&& BinnieCore.proxy.isSimulating(world)
|
||||
if (hasBeenBroken && BinnieCore.proxy.isSimulating(world)
|
||||
&& drops.size() > 0
|
||||
&& (player == null || !player.capabilities.isCreativeMode)) {
|
||||
for (ItemStack drop : drops) {
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
@@ -18,20 +32,9 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
import forestry.core.config.Config;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class ItemBotany extends Item {
|
||||
|
||||
public ItemBotany(String name) {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName(name);
|
||||
@@ -86,11 +89,12 @@ public abstract class ItemBotany extends Item {
|
||||
IFlowerColor stemColor = genome.getStemColor();
|
||||
|
||||
if (primaryColor == secondColor) {
|
||||
tooltip.add(EnumChatFormatting.YELLOW
|
||||
+ I18N.localise("botany.item.tooltip.flowerColor1", primaryColor.getName(), stemColor.getName()));
|
||||
tooltip.add(
|
||||
EnumChatFormatting.YELLOW + I18N
|
||||
.localise("botany.item.tooltip.flowerColor1", primaryColor.getName(), stemColor.getName()));
|
||||
} else {
|
||||
tooltip.add(EnumChatFormatting.YELLOW
|
||||
+ I18N.localise(
|
||||
tooltip.add(
|
||||
EnumChatFormatting.YELLOW + I18N.localise(
|
||||
"botany.item.tooltip.flowerColor2",
|
||||
primaryColor.getName(),
|
||||
secondColor.getName(),
|
||||
@@ -143,8 +147,7 @@ public abstract class ItemBotany extends Item {
|
||||
if (hideSecrets && individual.isSecret() && !Config.isDebug) {
|
||||
continue;
|
||||
}
|
||||
itemList.add(BotanyCore.speciesRoot.getMemberStack(
|
||||
individual.copy(), getStage().ordinal()));
|
||||
itemList.add(BotanyCore.speciesRoot.getMemberStack(individual.copy(), getStage().ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,8 +161,7 @@ public abstract class ItemBotany extends Item {
|
||||
if (renderPass == 0) {
|
||||
return flower.getGenome().getStemColor().getColor(flower.isWilted());
|
||||
}
|
||||
return (renderPass == 1)
|
||||
? flower.getGenome().getPrimaryColor().getColor(flower.isWilted())
|
||||
return (renderPass == 1) ? flower.getGenome().getPrimaryColor().getColor(flower.isWilted())
|
||||
: flower.getGenome().getSecondaryColor().getColor(flower.isWilted());
|
||||
}
|
||||
|
||||
@@ -192,17 +194,8 @@ public abstract class ItemBotany extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack itemstack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float px,
|
||||
float py,
|
||||
float pz) {
|
||||
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float px, float py, float pz) {
|
||||
if (getStage() == EnumFlowerStage.POLLEN) {
|
||||
IFlower flower = Binnie.Genetics.getFlowerRoot().getMember(itemstack);
|
||||
TileEntity target = world.getTileEntity(x, y, z);
|
||||
@@ -224,24 +217,23 @@ public abstract class ItemBotany extends Item {
|
||||
Block blockAlreadyThere = world.getBlock(x, y, z);
|
||||
if (blockAlreadyThere == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 0x7) < 1) {
|
||||
side = 1;
|
||||
} else if (blockAlreadyThere != Blocks.vine
|
||||
&& blockAlreadyThere != Blocks.tallgrass
|
||||
} else if (blockAlreadyThere != Blocks.vine && blockAlreadyThere != Blocks.tallgrass
|
||||
&& blockAlreadyThere != Blocks.deadbush
|
||||
&& !blockAlreadyThere.isReplaceable(world, x, y, z)) {
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
}
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
||||
if (itemstack.stackSize == 0 || !player.canPlayerEdit(x, y, z, side, itemstack)) {
|
||||
return false;
|
||||
@@ -274,39 +266,28 @@ public abstract class ItemBotany extends Item {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block == Blocks.snow_layer) {
|
||||
side = 1;
|
||||
} else if (block != Blocks.vine
|
||||
&& block != Blocks.tallgrass
|
||||
} else if (block != Blocks.vine && block != Blocks.tallgrass
|
||||
&& block != Blocks.deadbush
|
||||
&& !block.isReplaceable(world, x, y, z)) {
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
}
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
}
|
||||
return world.canPlaceEntityOnSide(field_150939_a, x, y, z, false, side, null, stack);
|
||||
}
|
||||
|
||||
public boolean placeBlockAt(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ,
|
||||
int metadata) {
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float hitX, float hitY, float hitZ, int metadata) {
|
||||
Block block = Botany.flower;
|
||||
if (!world.setBlock(x, y, z, block, metadata, 3)) {
|
||||
return false;
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.botany.flower;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
|
||||
public class ItemFlower extends ItemBotany {
|
||||
|
||||
public ItemFlower() {
|
||||
super("itemFlower");
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -14,7 +10,14 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemInsulatedTube extends Item {
|
||||
|
||||
IIcon[] icons;
|
||||
|
||||
public ItemInsulatedTube() {
|
||||
@@ -52,8 +55,7 @@ public class ItemInsulatedTube extends Item {
|
||||
if (pass == 0) {
|
||||
return 0xffffff;
|
||||
}
|
||||
return (pass == 1)
|
||||
? Material.get(stack.getItemDamage()).getColor()
|
||||
return (pass == 1) ? Material.get(stack.getItemDamage()).getColor()
|
||||
: Insulate.get(stack.getItemDamage()).getColor();
|
||||
}
|
||||
|
||||
@@ -85,7 +87,8 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
enum Material {
|
||||
Copper(0xe3b78e, "cooper"),
|
||||
|
||||
Copper(0xe3b78e, "copper"),
|
||||
Tin(0xe1eef4, "tin"),
|
||||
Bronze(0xddc276, "bronze"),
|
||||
Iron(0xd8d8d8, "iron");
|
||||
@@ -112,6 +115,7 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
enum Insulate {
|
||||
|
||||
Clay(0xa1aacc, "clay"),
|
||||
Cobble(0x7b7b7b, "cobblestone"),
|
||||
Sand(0xefeab5, "sand"),
|
||||
|
||||
@@ -4,6 +4,7 @@ import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ItemPollen extends ItemBotany {
|
||||
|
||||
public ItemPollen() {
|
||||
super("pollen");
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ItemSeed extends ItemBotany {
|
||||
|
||||
public ItemSeed() {
|
||||
super("seed");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -8,7 +7,10 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RendererBotany implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static int renderID;
|
||||
public static int pass;
|
||||
|
||||
@@ -18,8 +20,8 @@ public class RendererBotany implements ISimpleBlockRenderingHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
|
||||
double d1 = x;
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
@@ -17,7 +35,6 @@ import binnie.botany.genetics.EnumFlowerType;
|
||||
import binnie.botany.genetics.Flower;
|
||||
import binnie.botany.network.MessageFlowerUpdate;
|
||||
import binnie.core.BinnieCore;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
@@ -25,22 +42,9 @@ import forestry.api.genetics.IPollinatable;
|
||||
import forestry.api.lepidopterology.IButterfly;
|
||||
import forestry.api.lepidopterology.IButterflyNursery;
|
||||
import forestry.lepidopterology.entities.EntityButterfly;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
public class TileEntityFlower extends TileEntity implements IPollinatable, IButterflyNursery {
|
||||
|
||||
protected IFlower flower;
|
||||
protected GameProfile owner;
|
||||
protected int section;
|
||||
@@ -119,8 +123,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
|
||||
@Override
|
||||
public boolean canMateWith(IIndividual individual) {
|
||||
return isBreeding()
|
||||
&& individual instanceof IFlower
|
||||
return isBreeding() && individual instanceof IFlower
|
||||
&& getFlower() != null
|
||||
&& getFlower().getMate() == null
|
||||
&& getFlower().hasFlowered()
|
||||
@@ -133,8 +136,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
return;
|
||||
}
|
||||
|
||||
IAlleleFlowerSpecies primary =
|
||||
(IAlleleFlowerSpecies) individual.getGenome().getPrimary();
|
||||
IAlleleFlowerSpecies primary = (IAlleleFlowerSpecies) individual.getGenome().getPrimary();
|
||||
IAlleleFlowerSpecies primary2 = getFlower().getGenome().getPrimary();
|
||||
if (primary == primary2 || worldObj.rand.nextInt(4) == 0) {
|
||||
getFlower().mate((IFlower) individual);
|
||||
@@ -283,9 +285,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
|
||||
Gardening.onGrowFromSeed(worldObj, xCoord, yCoord, zCoord);
|
||||
if (getOwner() != null && getFlower() != null) {
|
||||
BotanyCore.getFlowerRoot()
|
||||
.getBreedingTracker(getWorldObj(), getOwner())
|
||||
.registerBirth(getFlower());
|
||||
BotanyCore.getFlowerRoot().getBreedingTracker(getWorldObj(), getOwner()).registerBirth(getFlower());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,11 +294,8 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
if (renderInfo == null && getFlower() != null && getFlower().getGenome() != null) {
|
||||
renderInfo = new RenderInfo(getFlower(), this);
|
||||
}
|
||||
return (renderInfo != null)
|
||||
? Botany.instance
|
||||
.getNetworkWrapper()
|
||||
.getPacketFrom(new MessageFlowerUpdate(xCoord, yCoord, zCoord, renderInfo).getMessage())
|
||||
: null;
|
||||
return (renderInfo != null) ? Botany.instance.getNetworkWrapper()
|
||||
.getPacketFrom(new MessageFlowerUpdate(xCoord, yCoord, zCoord, renderInfo).getMessage()) : null;
|
||||
}
|
||||
|
||||
public void updateRender(boolean update) {
|
||||
@@ -454,11 +451,8 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
return;
|
||||
}
|
||||
|
||||
IButterfly spawn = Binnie.Genetics.getButterflyRoot()
|
||||
.getIndividualTemplates()
|
||||
.get(worldObj.rand.nextInt(Binnie.Genetics.getButterflyRoot()
|
||||
.getIndividualTemplates()
|
||||
.size()));
|
||||
IButterfly spawn = Binnie.Genetics.getButterflyRoot().getIndividualTemplates()
|
||||
.get(worldObj.rand.nextInt(Binnie.Genetics.getButterflyRoot().getIndividualTemplates().size()));
|
||||
if (worldObj.rand.nextFloat() >= spawn.getGenome().getPrimary().getRarity() * 0.5f) {
|
||||
return;
|
||||
}
|
||||
@@ -528,9 +522,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
}
|
||||
|
||||
matureTime++;
|
||||
if (matureTime
|
||||
>= caterpillar.getGenome().getLifespan()
|
||||
/ (caterpillar.getGenome().getFertility() * 2)
|
||||
if (matureTime >= caterpillar.getGenome().getLifespan() / (caterpillar.getGenome().getFertility() * 2)
|
||||
&& caterpillar.canTakeFlight(worldObj, xCoord, yCoord, zCoord)) {
|
||||
if (worldObj.isAirBlock(xCoord, yCoord + 1, zCoord)) {
|
||||
attemptButterflySpawn(worldObj, caterpillar, xCoord, yCoord + 1, zCoord);
|
||||
@@ -601,6 +593,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
}
|
||||
|
||||
public static class RenderInfo {
|
||||
|
||||
public IFlowerColor primary;
|
||||
public IFlowerColor secondary;
|
||||
public IFlowerColor stem;
|
||||
@@ -627,8 +620,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof RenderInfo) {
|
||||
RenderInfo o = (RenderInfo) obj;
|
||||
return o.age == age
|
||||
&& o.wilted == wilted
|
||||
return o.age == age && o.wilted == wilted
|
||||
&& o.flowered == flowered
|
||||
&& o.primary == primary
|
||||
&& o.secondary == secondary
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -20,7 +14,16 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockPlant extends BlockBush {
|
||||
|
||||
public BlockPlant() {
|
||||
setBlockName("plant");
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
@@ -125,6 +128,7 @@ public class BlockPlant extends BlockBush {
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
|
||||
Weeds("weeds"),
|
||||
WeedsLong("longWeeds"),
|
||||
WeedsVeryLong("veryLongWeeds"),
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -24,7 +17,17 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockSoil extends Block implements IBlockSoil {
|
||||
|
||||
protected boolean weedKilled;
|
||||
protected IIcon[] iconsTop;
|
||||
protected IIcon[] iconsSide;
|
||||
@@ -115,8 +118,7 @@ public class BlockSoil extends Block implements IBlockSoil {
|
||||
if (meta != meta2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta2, 2);
|
||||
}
|
||||
if (!weedKilled
|
||||
&& random.nextInt(5 - getType(world, x, y, z).ordinal()) == 0
|
||||
if (!weedKilled && random.nextInt(5 - getType(world, x, y, z).ordinal()) == 0
|
||||
&& world.getBlock(x, y + 1, z) == Blocks.air) {
|
||||
world.setBlock(x, y + 1, z, Botany.plant, BlockPlant.Type.Weeds.ordinal(), 2);
|
||||
}
|
||||
@@ -195,8 +197,8 @@ public class BlockSoil extends Block implements IBlockSoil {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(
|
||||
IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction,
|
||||
IPlantable plantable) {
|
||||
Block plant = plantable.getPlant(world, x, y + 1, z);
|
||||
if (plant == Botany.flower) {
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
@@ -9,21 +24,10 @@ import binnie.botany.api.gardening.IBlockSoil;
|
||||
import binnie.botany.flower.TileEntityFlower;
|
||||
import binnie.botany.items.BotanyItems;
|
||||
import binnie.core.BinnieCore;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
public class Gardening {
|
||||
|
||||
public static Map<ItemStack, Integer> fertiliserAcid = new LinkedHashMap<>();
|
||||
public static Map<ItemStack, Integer> fertiliserAlkaline = new LinkedHashMap<>();
|
||||
public static Map<ItemStack, Integer> fertiliserNutrient = new LinkedHashMap<>();
|
||||
@@ -81,8 +85,10 @@ public class Gardening {
|
||||
public static float getBiomeMoisture(BiomeGenBase biome, int H) {
|
||||
double R = biome.rainfall;
|
||||
double T = biome.temperature;
|
||||
double m =
|
||||
3.2 * (R - 0.5) - 0.4 * (1.0 + T + 0.5 * T * T) + 1.1 - 1.6 * (T - 0.9) * (T - 0.9) - 0.002 * (H - 64);
|
||||
double m = 3.2 * (R - 0.5) - 0.4 * (1.0 + T + 0.5 * T * T)
|
||||
+ 1.1
|
||||
- 1.6 * (T - 0.9) * (T - 0.9)
|
||||
- 0.002 * (H - 64);
|
||||
if (m == 0.0) {
|
||||
return (float) m;
|
||||
}
|
||||
@@ -95,14 +101,13 @@ public class Gardening {
|
||||
public static float getBiomePH(BiomeGenBase biome, int H) {
|
||||
double R = biome.rainfall;
|
||||
double T = biome.temperature;
|
||||
return (float) (-3.0 * (R - 0.5)
|
||||
+ 0.5 * (T - 0.699999988079071) * (T - 0.699999988079071)
|
||||
return (float) (-3.0 * (R - 0.5) + 0.5 * (T - 0.699999988079071) * (T - 0.699999988079071)
|
||||
+ 0.02f * (H - 64)
|
||||
- 0.15000000596046448);
|
||||
}
|
||||
|
||||
public static void createSoil(
|
||||
World world, int x, int y, int z, EnumSoilType soil, EnumMoisture moisture, EnumAcidity acidity) {
|
||||
public static void createSoil(World world, int x, int y, int z, EnumSoilType soil, EnumMoisture moisture,
|
||||
EnumAcidity acidity) {
|
||||
int meta = moisture.ordinal() + acidity.ordinal() * 3;
|
||||
world.setBlock(x, y, z, getSoilBlock(soil), meta, 2);
|
||||
}
|
||||
@@ -139,8 +144,7 @@ public class Gardening {
|
||||
|
||||
IFlower iflower = ((TileEntityFlower) flower).getFlower();
|
||||
int section = ((TileEntityFlower) flower).getSection();
|
||||
if (iflower == null
|
||||
|| section >= iflower.getGenome().getPrimary().getType().getSections() - 1
|
||||
if (iflower == null || section >= iflower.getGenome().getPrimary().getType().getSections() - 1
|
||||
|| iflower.getAge() <= 0) {
|
||||
return;
|
||||
}
|
||||
@@ -257,8 +261,7 @@ public class Gardening {
|
||||
}
|
||||
|
||||
public static boolean canTolerate(IFlower flower, EnumAcidity ePH, EnumMoisture eMoisture, EnumTemperature eTemp) {
|
||||
return flower.getGenome().canTolerate(ePH)
|
||||
&& flower.getGenome().canTolerate(eMoisture)
|
||||
return flower.getGenome().canTolerate(ePH) && flower.getGenome().canTolerate(eMoisture)
|
||||
&& flower.getGenome().canTolerate(eTemp);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class ItemSoil extends ItemBlock {
|
||||
|
||||
protected EnumSoilType type;
|
||||
|
||||
private boolean noWeed;
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
@@ -11,17 +21,9 @@ import binnie.core.util.I18N;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemSoilMeter extends Item {
|
||||
|
||||
public ItemSoilMeter() {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName("soilMeter");
|
||||
@@ -29,17 +31,8 @@ public class ItemSoilMeter extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float blockX,
|
||||
float blockY,
|
||||
float blockZ) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float blockX, float blockY, float blockZ) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (!Gardening.isSoil(block)) {
|
||||
y--;
|
||||
@@ -52,21 +45,18 @@ public class ItemSoilMeter extends Item {
|
||||
EnumMoisture moisture = soil.getMoisture(world, x, y, z);
|
||||
EnumAcidity pH = soil.getPH(world, x, y, z);
|
||||
|
||||
EnumChatFormatting[] colors = new EnumChatFormatting[] {
|
||||
EnumChatFormatting.DARK_GRAY, EnumChatFormatting.GOLD, EnumChatFormatting.LIGHT_PURPLE,
|
||||
};
|
||||
EnumChatFormatting[] colors = new EnumChatFormatting[] { EnumChatFormatting.DARK_GRAY,
|
||||
EnumChatFormatting.GOLD, EnumChatFormatting.LIGHT_PURPLE, };
|
||||
String info = I18N.localise("botany.soil.tooltip.type") + " ";
|
||||
info += colors[type.ordinal()] + AlleleHelper.toDisplay(type) + EnumChatFormatting.RESET;
|
||||
|
||||
colors = new EnumChatFormatting[] {
|
||||
EnumChatFormatting.YELLOW, EnumChatFormatting.GRAY, EnumChatFormatting.BLUE,
|
||||
};
|
||||
colors = new EnumChatFormatting[] { EnumChatFormatting.YELLOW, EnumChatFormatting.GRAY,
|
||||
EnumChatFormatting.BLUE, };
|
||||
info += ", " + I18N.localise("botany.soil.tooltip.moisture") + " ";
|
||||
info += colors[moisture.ordinal()] + AlleleHelper.toDisplay(moisture) + EnumChatFormatting.RESET;
|
||||
|
||||
colors = new EnumChatFormatting[] {
|
||||
EnumChatFormatting.RED, EnumChatFormatting.GREEN, EnumChatFormatting.AQUA,
|
||||
};
|
||||
colors = new EnumChatFormatting[] { EnumChatFormatting.RED, EnumChatFormatting.GREEN,
|
||||
EnumChatFormatting.AQUA, };
|
||||
info += ", " + I18N.localise("botany.soil.tooltip.pH") + " ";
|
||||
info += colors[pH.ordinal()] + AlleleHelper.toDisplay(pH) + EnumChatFormatting.RESET;
|
||||
IChatComponent chat = new ChatComponentText(info);
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,7 +8,16 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemTrowel extends Item {
|
||||
|
||||
protected Item.ToolMaterial theToolMaterial;
|
||||
String locName;
|
||||
|
||||
@@ -35,17 +37,8 @@ public class ItemTrowel extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float blockX,
|
||||
float blockY,
|
||||
float blockZ) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float blockX, float blockY, float blockZ) {
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemWeed extends ItemBlock {
|
||||
|
||||
public ItemWeed(Block block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
@@ -26,18 +38,9 @@ import binnie.core.block.ItemMetadataRenderer;
|
||||
import binnie.core.block.MultipassItemRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
public class ModuleGardening implements IInitializable {
|
||||
|
||||
public static HashMap<ItemStack, Integer> queuedAcidFertilisers = new HashMap<>();
|
||||
public static HashMap<ItemStack, Integer> queuedAlkalineFertilisers = new HashMap<>();
|
||||
public static HashMap<ItemStack, Integer> queuedNutrientFertilisers = new HashMap<>();
|
||||
@@ -86,13 +89,13 @@ public class ModuleGardening implements IInitializable {
|
||||
|
||||
Botany.ceramicTile = new BlockCeramicPatterned();
|
||||
GameRegistry.registerBlock(Botany.ceramicTile, ItemMetadata.class, "ceramicPattern");
|
||||
BinnieCore.proxy.registerCustomItemRenderer(
|
||||
Item.getItemFromBlock(Botany.ceramicTile), new MultipassItemRenderer());
|
||||
BinnieCore.proxy
|
||||
.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramicTile), new MultipassItemRenderer());
|
||||
|
||||
Botany.ceramicBrick = new BlockCeramicBrick();
|
||||
GameRegistry.registerBlock(Botany.ceramicBrick, ItemMetadata.class, "ceramicBrick");
|
||||
BinnieCore.proxy.registerCustomItemRenderer(
|
||||
Item.getItemFromBlock(Botany.ceramicBrick), new MultipassItemRenderer());
|
||||
BinnieCore.proxy
|
||||
.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramicBrick), new MultipassItemRenderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,11 +107,11 @@ public class ModuleGardening implements IInitializable {
|
||||
ItemStack red = new ItemStack(Blocks.red_flower, 1);
|
||||
ItemStack blue = new ItemStack(Blocks.red_flower, 1, 7);
|
||||
|
||||
for (boolean manual : new boolean[] {true, false}) {
|
||||
for (boolean fertilised : new boolean[] {true, false}) {
|
||||
for (boolean manual : new boolean[] { true, false }) {
|
||||
for (boolean fertilised : new boolean[] { true, false }) {
|
||||
for (EnumMoisture moist : EnumMoisture.values()) {
|
||||
ItemStack icon =
|
||||
(moist == EnumMoisture.DRY) ? yellow : ((moist == EnumMoisture.NORMAL) ? red : blue);
|
||||
ItemStack icon = (moist == EnumMoisture.DRY) ? yellow
|
||||
: ((moist == EnumMoisture.NORMAL) ? red : blue);
|
||||
int insulate = 2 - moist.ordinal();
|
||||
if (fertilised) {
|
||||
insulate += 3;
|
||||
@@ -159,36 +162,48 @@ public class ModuleGardening implements IInitializable {
|
||||
}
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(Blocks.dirt), new ItemStack(Botany.soil, 1, OreDictionary.WILDCARD_VALUE));
|
||||
new ItemStack(Blocks.dirt),
|
||||
new ItemStack(Botany.soil, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(Blocks.dirt), new ItemStack(Botany.loam, 1, OreDictionary.WILDCARD_VALUE));
|
||||
new ItemStack(Blocks.dirt),
|
||||
new ItemStack(Botany.loam, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(Blocks.dirt), new ItemStack(Botany.flowerbed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
new ItemStack(Blocks.dirt),
|
||||
new ItemStack(Botany.flowerbed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(Blocks.dirt), new ItemStack(Botany.soilNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
new ItemStack(Blocks.dirt),
|
||||
new ItemStack(Botany.soilNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(Blocks.dirt), new ItemStack(Botany.loamNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
new ItemStack(Blocks.dirt),
|
||||
new ItemStack(Botany.loamNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(Blocks.dirt), new ItemStack(Botany.flowerbedNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
new ItemStack(Blocks.dirt),
|
||||
new ItemStack(Botany.flowerbedNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
Botany.trowelWood,
|
||||
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "plankWood"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
Botany.trowelStone,
|
||||
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "cobblestone"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
Botany.trowelIron,
|
||||
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "ingotIron"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
Botany.trowelGold,
|
||||
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "ingotGold"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
Botany.trowelDiamond,
|
||||
new Object[] {"d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "gemDiamond"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
Botany.soilMeter,
|
||||
new Object[] {" gg", " rg", "i ", 'g', "ingotGold", 'r', "dustRedstone", 'i', "ingotIron"}));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
Botany.trowelWood,
|
||||
new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "plankWood" }));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
Botany.trowelStone,
|
||||
new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "cobblestone" }));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
Botany.trowelIron,
|
||||
new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "ingotIron" }));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
Botany.trowelGold,
|
||||
new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "ingotGold" }));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
Botany.trowelDiamond,
|
||||
new Object[] { "d ", " x ", " s", 'd', Blocks.dirt, 's', "stickWood", 'x', "gemDiamond" }));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
Botany.soilMeter,
|
||||
new Object[] { " gg", " rg", "i ", 'g', "ingotGold", 'r', "dustRedstone", 'i', "ingotIron" }));
|
||||
GameRegistry.addShapelessRecipe(
|
||||
BotanyItems.Weedkiller.get(4),
|
||||
new ItemStack(Items.spider_eye),
|
||||
@@ -201,11 +216,13 @@ public class ModuleGardening implements IInitializable {
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), Mods.forestry.stack("fertilizerBio"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.FertiliserPowder.get(4), Mods.forestry.stack("fertilizerCompound"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.PulpPowder.get(4), Mods.forestry.stack("woodPulp"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(BotanyItems.SulphurPowder.get(4), new Object[] {"dustSulphur"}));
|
||||
GameRegistry
|
||||
.addRecipe(new ShapelessOreRecipe(BotanyItems.SulphurPowder.get(4), new Object[] { "dustSulphur" }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
new ItemStack(Botany.pigment, 2, EnumFlowerColor.BLACK.ordinal()),
|
||||
new Object[] {"pigment", "pigment", "dyeBlack"}));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapelessOreRecipe(
|
||||
new ItemStack(Botany.pigment, 2, EnumFlowerColor.BLACK.ordinal()),
|
||||
new Object[] { "pigment", "pigment", "dyeBlack" }));
|
||||
|
||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
|
||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
|
||||
@@ -221,10 +238,10 @@ public class ModuleGardening implements IInitializable {
|
||||
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "woodPulp")), 2);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.CompostPowder.get(1), 1);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.FertiliserPowder.get(1), 1);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(
|
||||
new ItemStack(GameRegistry.findItem("Forestry", "fertilizerBio")), 2);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(
|
||||
new ItemStack(GameRegistry.findItem("Forestry", "fertilizerCompound")), 2);
|
||||
ModuleGardening.queuedNutrientFertilisers
|
||||
.put(new ItemStack(GameRegistry.findItem("Forestry", "fertilizerBio")), 2);
|
||||
ModuleGardening.queuedNutrientFertilisers
|
||||
.put(new ItemStack(GameRegistry.findItem("Forestry", "fertilizerCompound")), 2);
|
||||
|
||||
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAcidFertilisers.entrySet()) {
|
||||
addAcidFertiliser(entry.getKey(), entry.getValue());
|
||||
@@ -238,8 +255,8 @@ public class ModuleGardening implements IInitializable {
|
||||
addNutrientFertiliser(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
BotanyItems.Mortar.get(6), " c ", "cgc", " c ", 'c', Items.clay_ball, 'g', Blocks.gravel);
|
||||
GameRegistry
|
||||
.addRecipe(BotanyItems.Mortar.get(6), " c ", "cgc", " c ", 'c', Items.clay_ball, 'g', Blocks.gravel);
|
||||
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal());
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.botany.genetics;
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
|
||||
public class AlleleColor implements IAlleleInteger {
|
||||
|
||||
private String uid;
|
||||
private int value;
|
||||
private EnumFlowerColor color;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.api.IAlleleFlowerEffect;
|
||||
import binnie.botany.api.IFlowerGenome;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AlleleEffectNone implements IAlleleFlowerEffect {
|
||||
|
||||
@Override
|
||||
public boolean isCombinable() {
|
||||
return true;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.api.IBotanistTracker;
|
||||
import forestry.api.genetics.IBreedingTracker;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.core.genetics.BreedingTracker;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class BotanistTracker extends BreedingTracker implements IBotanistTracker {
|
||||
|
||||
public BotanistTracker(String s) {
|
||||
super(s);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import binnie.botany.api.IColourMix;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
|
||||
public class ColorMix implements IColourMix {
|
||||
|
||||
protected IFlowerColor color1;
|
||||
protected IFlowerColor color2;
|
||||
protected IFlowerColor result;
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
import java.util.Locale;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public enum EnumFlowerColor implements IFlowerColor {
|
||||
|
||||
AQUAMARINE("aquamarine", 0x7fffd4),
|
||||
BLACK("black", 0x282828),
|
||||
BLUE("blue", 0x0000ff),
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IFlowerType;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum EnumFlowerType implements IFlowerType {
|
||||
|
||||
DANDELION,
|
||||
POPPY,
|
||||
ORCHID,
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
import binnie.botany.api.IColourMix;
|
||||
@@ -15,12 +21,9 @@ import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosome;
|
||||
import forestry.core.genetics.Chromosome;
|
||||
import forestry.core.genetics.Individual;
|
||||
import java.util.List;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class Flower extends Individual implements IFlower {
|
||||
|
||||
public IFlowerGenome genome;
|
||||
public IFlowerGenome mate;
|
||||
|
||||
@@ -56,23 +59,24 @@ public class Flower extends Individual implements IFlower {
|
||||
IAlleleFlowerSpecies primary = genome.getPrimary();
|
||||
IAlleleFlowerSpecies secondary = genome.getSecondary();
|
||||
if (!isPureBred(EnumFlowerChromosome.SPECIES)) {
|
||||
list.add(EnumChatFormatting.BLUE
|
||||
+ I18N.localise("botany.item.tooltip.hybrid", primary.getName(), secondary.getName()));
|
||||
list.add(
|
||||
EnumChatFormatting.BLUE
|
||||
+ I18N.localise("botany.item.tooltip.hybrid", primary.getName(), secondary.getName()));
|
||||
}
|
||||
|
||||
list.add(EnumChatFormatting.GRAY + I18N.localise("botany.item.tooltip.age", getAge()));
|
||||
list.add(EnumChatFormatting.GREEN
|
||||
+ I18N.localise(
|
||||
list.add(
|
||||
EnumChatFormatting.GREEN + I18N.localise(
|
||||
"botany.item.tooltip.temperature",
|
||||
AlleleHelper.toDisplay(primary.getTemperature()),
|
||||
AlleleHelper.toDisplay(genome.getToleranceTemperature())));
|
||||
list.add(EnumChatFormatting.GREEN
|
||||
+ I18N.localise(
|
||||
list.add(
|
||||
EnumChatFormatting.GREEN + I18N.localise(
|
||||
"botany.item.tooltip.moisture",
|
||||
AlleleHelper.toDisplay(primary.getMoisture()),
|
||||
AlleleHelper.toDisplay(genome.getToleranceMoisture())));
|
||||
list.add(EnumChatFormatting.GREEN
|
||||
+ I18N.localise(
|
||||
list.add(
|
||||
EnumChatFormatting.GREEN + I18N.localise(
|
||||
"botany.item.tooltip.pH",
|
||||
AlleleHelper.toDisplay(primary.getHumidity()),
|
||||
AlleleHelper.toDisplay(genome.getTolerancePH())));
|
||||
@@ -88,8 +92,7 @@ public class Flower extends Individual implements IFlower {
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
if (nbttagcompound == null) {
|
||||
genome = BotanyCore.getFlowerRoot()
|
||||
.templateAsGenome(BotanyCore.getFlowerRoot().getDefaultTemplate());
|
||||
genome = BotanyCore.getFlowerRoot().templateAsGenome(BotanyCore.getFlowerRoot().getDefaultTemplate());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -235,8 +238,7 @@ public class Flower extends Individual implements IFlower {
|
||||
if (colour1 != colour2) {
|
||||
for (IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
||||
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
||||
parent1[EnumFlowerChromosome.PRIMARY.ordinal()] =
|
||||
new Chromosome(mutation.getResult().getAllele());
|
||||
parent1[EnumFlowerChromosome.PRIMARY.ordinal()] = new Chromosome(mutation.getResult().getAllele());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -246,8 +248,8 @@ public class Flower extends Individual implements IFlower {
|
||||
if (colour1 != colour2) {
|
||||
for (IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
||||
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
||||
parent1[EnumFlowerChromosome.SECONDARY.ordinal()] =
|
||||
new Chromosome(mutation.getResult().getAllele());
|
||||
parent1[EnumFlowerChromosome.SECONDARY.ordinal()] = new Chromosome(
|
||||
mutation.getResult().getAllele());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,8 +259,7 @@ public class Flower extends Individual implements IFlower {
|
||||
if (colour1 != colour2) {
|
||||
for (IColourMix mutation : BotanyCore.getFlowerRoot().getColourMixes(true)) {
|
||||
if (mutation.isMutation(colour1, colour2) && world.rand.nextFloat() * 100.0f < mutation.getChance()) {
|
||||
parent1[EnumFlowerChromosome.STEM.ordinal()] =
|
||||
new Chromosome(mutation.getResult().getAllele());
|
||||
parent1[EnumFlowerChromosome.STEM.ordinal()] = new Chromosome(mutation.getResult().getAllele());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
@@ -16,9 +18,9 @@ import forestry.api.genetics.IAlleleTolerance;
|
||||
import forestry.api.genetics.IChromosome;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.core.genetics.Genome;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class FlowerGenome extends Genome implements IFlowerGenome {
|
||||
|
||||
public FlowerGenome(NBTTagCompound nbttagcompound) {
|
||||
super(nbttagcompound);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
@@ -10,7 +24,6 @@ import binnie.botany.api.IFlower;
|
||||
import binnie.botany.api.IFlowerGenome;
|
||||
import binnie.botany.api.IFlowerMutation;
|
||||
import binnie.botany.api.IFlowerRoot;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
@@ -18,18 +31,9 @@ import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.genetics.ISpeciesType;
|
||||
import forestry.core.genetics.SpeciesRoot;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class FlowerHelper extends SpeciesRoot implements IFlowerRoot {
|
||||
|
||||
public static int flowerSpeciesCount = -1;
|
||||
public static ArrayList<IFlower> flowerTemplates = new ArrayList<>();
|
||||
|
||||
@@ -53,8 +57,7 @@ public class FlowerHelper extends SpeciesRoot implements IFlowerRoot {
|
||||
public int getSpeciesCount() {
|
||||
if (FlowerHelper.flowerSpeciesCount < 0) {
|
||||
FlowerHelper.flowerSpeciesCount = 0;
|
||||
for (Map.Entry<String, IAllele> entry :
|
||||
AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) {
|
||||
for (Map.Entry<String, IAllele> entry : AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) {
|
||||
if (entry.getValue() instanceof IAlleleFlowerSpecies
|
||||
&& ((IAlleleFlowerSpecies) entry.getValue()).isCounted()) {
|
||||
FlowerHelper.flowerSpeciesCount++;
|
||||
@@ -185,9 +188,7 @@ public class FlowerHelper extends SpeciesRoot implements IFlowerRoot {
|
||||
|
||||
@Override
|
||||
public IAllele[] getRandomTemplate(Random rand) {
|
||||
return speciesTemplates.values()
|
||||
.toArray(new IAllele[0][])[
|
||||
rand.nextInt(speciesTemplates.values().size())];
|
||||
return speciesTemplates.values().toArray(new IAllele[0][])[rand.nextInt(speciesTemplates.values().size())];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -201,10 +202,8 @@ public class FlowerHelper extends SpeciesRoot implements IFlowerRoot {
|
||||
@Override
|
||||
public void registerMutation(IMutation mutation) {
|
||||
if (AlleleManager.alleleRegistry.isBlacklisted(mutation.getTemplate()[0].getUID())
|
||||
|| AlleleManager.alleleRegistry.isBlacklisted(
|
||||
mutation.getAllele0().getUID())
|
||||
|| AlleleManager.alleleRegistry.isBlacklisted(
|
||||
mutation.getAllele1().getUID())) {
|
||||
|| AlleleManager.alleleRegistry.isBlacklisted(mutation.getAllele0().getUID())
|
||||
|| AlleleManager.alleleRegistry.isBlacklisted(mutation.getAllele1().getUID())) {
|
||||
return;
|
||||
}
|
||||
FlowerHelper.flowerMutations.add((IFlowerMutation) mutation);
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
import binnie.botany.api.IFlowerMutation;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
public class FlowerMutation implements IFlowerMutation {
|
||||
|
||||
protected IAlleleFlowerSpecies allele0;
|
||||
protected IAlleleFlowerSpecies allele1;
|
||||
protected IAllele[] template;
|
||||
@@ -62,12 +64,10 @@ public class FlowerMutation implements IFlowerMutation {
|
||||
if (allele0 == null || allele1 == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (this.allele0.getUID().equals(allele0.getUID())
|
||||
&& this.allele1.getUID().equals(allele1.getUID())) {
|
||||
if (this.allele0.getUID().equals(allele0.getUID()) && this.allele1.getUID().equals(allele1.getUID())) {
|
||||
return getBaseChance();
|
||||
}
|
||||
if (this.allele1.getUID().equals(allele0.getUID())
|
||||
&& this.allele0.getUID().equals(allele1.getUID())) {
|
||||
if (this.allele1.getUID().equals(allele0.getUID()) && this.allele0.getUID().equals(allele1.getUID())) {
|
||||
return getBaseChance();
|
||||
}
|
||||
return 0.0f;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
@@ -9,7 +18,6 @@ import binnie.botany.api.IFlowerType;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
@@ -22,13 +30,9 @@ import forestry.api.genetics.IClassification;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.core.genetics.alleles.EnumAllele;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
|
||||
DANDELION("dandelion", "taraxacum", "officinale", EnumFlowerType.DANDELION, EnumFlowerColor.YELLOW),
|
||||
POPPY("poppy", "papaver", "rhoeas", EnumFlowerType.POPPY, EnumFlowerColor.RED),
|
||||
ORCHID("orchid", "vanda", "coerulea", EnumFlowerType.ORCHID, EnumFlowerColor.DEEP_SKY_BLUE),
|
||||
@@ -41,123 +45,53 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
IRIS("iris", "iris", "germanica", EnumFlowerType.IRIS, EnumFlowerColor.LIGHT_GRAY, EnumFlowerColor.PURPLE),
|
||||
LAVENDER("lavender", "Lavandula", "angustifolia", EnumFlowerType.LAVENDER, EnumFlowerColor.MEDIUM_ORCHID),
|
||||
VIOLA("viola", "viola", "odorata", EnumFlowerType.VIOLA, EnumFlowerColor.MEDIUM_PURPLE, EnumFlowerColor.SLATE_BLUE),
|
||||
DAFFODIL(
|
||||
"daffodil",
|
||||
"narcissus",
|
||||
"pseudonarcissus",
|
||||
EnumFlowerType.DAFFODIL,
|
||||
EnumFlowerColor.YELLOW,
|
||||
DAFFODIL("daffodil", "narcissus", "pseudonarcissus", EnumFlowerType.DAFFODIL, EnumFlowerColor.YELLOW,
|
||||
EnumFlowerColor.GOLD),
|
||||
DAHLIA(
|
||||
"dahlia",
|
||||
"dahlia",
|
||||
"variabilis",
|
||||
EnumFlowerType.DAHLIA,
|
||||
EnumFlowerColor.HOT_PINK,
|
||||
DAHLIA("dahlia", "dahlia", "variabilis", EnumFlowerType.DAHLIA, EnumFlowerColor.HOT_PINK,
|
||||
EnumFlowerColor.DEEP_PINK),
|
||||
PEONY("peony", "paeonia", "suffruticosa", EnumFlowerType.PEONY, EnumFlowerColor.THISTLE),
|
||||
ROSE("rose", "rosa", "rubiginosa", EnumFlowerType.ROSE, EnumFlowerColor.RED),
|
||||
LILAC("lilac", "syringa", "vulgaris", EnumFlowerType.LILAC, EnumFlowerColor.PLUM),
|
||||
HYDRANGEA("hydrangea", "hydrangea", "macrophylla", EnumFlowerType.HYDRANGEA, EnumFlowerColor.DEEP_SKY_BLUE),
|
||||
FOXGLOVE("foxglove", "digitalis", "purpurea", EnumFlowerType.FOXGLOVE, EnumFlowerColor.HOT_PINK),
|
||||
ZINNIA(
|
||||
"zinnia",
|
||||
"zinnia",
|
||||
"elegans",
|
||||
EnumFlowerType.ZINNIA,
|
||||
EnumFlowerColor.MEDIUM_VIOLET_RED,
|
||||
ZINNIA("zinnia", "zinnia", "elegans", EnumFlowerType.ZINNIA, EnumFlowerColor.MEDIUM_VIOLET_RED,
|
||||
EnumFlowerColor.YELLOW),
|
||||
CHRYSANTHEMUM(
|
||||
"chrysanthemum", "chrysanthemum", "\u00ef?? grandiflorum", EnumFlowerType.MUMS, EnumFlowerColor.VIOLET),
|
||||
MARIGOLD(
|
||||
"marigold",
|
||||
"calendula",
|
||||
"officinalis",
|
||||
EnumFlowerType.MARIGOLD,
|
||||
EnumFlowerColor.GOLD,
|
||||
CHRYSANTHEMUM("chrysanthemum", "chrysanthemum", "\u00ef?? grandiflorum", EnumFlowerType.MUMS,
|
||||
EnumFlowerColor.VIOLET),
|
||||
MARIGOLD("marigold", "calendula", "officinalis", EnumFlowerType.MARIGOLD, EnumFlowerColor.GOLD,
|
||||
EnumFlowerColor.DARK_ORANGE),
|
||||
GERANIUM("geranium", "geranium", "maderense", EnumFlowerType.GERANIUM, EnumFlowerColor.DEEP_PINK),
|
||||
AZALEA("azalea", "rhododendrons", "aurigeranum", EnumFlowerType.AZALEA, EnumFlowerColor.HOT_PINK),
|
||||
PRIMROSE("primrose", "primula", "vulgaris", EnumFlowerType.PRIMROSE, EnumFlowerColor.RED, EnumFlowerColor.GOLD),
|
||||
ASTER("aster", "aster", "amellus", EnumFlowerType.ASTER, EnumFlowerColor.MEDIUM_PURPLE, EnumFlowerColor.GOLDENROD),
|
||||
CARNATION(
|
||||
"carnation",
|
||||
"dianthus",
|
||||
"caryophyllus",
|
||||
EnumFlowerType.CARNATION,
|
||||
EnumFlowerColor.CRIMSON,
|
||||
CARNATION("carnation", "dianthus", "caryophyllus", EnumFlowerType.CARNATION, EnumFlowerColor.CRIMSON,
|
||||
EnumFlowerColor.WHITE),
|
||||
LILY("lily", "lilium", "auratum", EnumFlowerType.LILY, EnumFlowerColor.PINK, EnumFlowerColor.GOLD),
|
||||
YARROW("yarrow", "achillea", "millefolium", EnumFlowerType.YARROW, EnumFlowerColor.YELLOW),
|
||||
PETUNIA(
|
||||
"petunia",
|
||||
"petunia",
|
||||
"\u00ef?? atkinsiana",
|
||||
EnumFlowerType.PETUNIA,
|
||||
EnumFlowerColor.MEDIUM_VIOLET_RED,
|
||||
PETUNIA("petunia", "petunia", "\u00ef?? atkinsiana", EnumFlowerType.PETUNIA, EnumFlowerColor.MEDIUM_VIOLET_RED,
|
||||
EnumFlowerColor.THISTLE),
|
||||
AGAPANTHUS("agapanthus", "agapanthus", "praecox", EnumFlowerType.AGAPANTHUS, EnumFlowerColor.DEEP_SKY_BLUE),
|
||||
FUCHSIA(
|
||||
"fuchsia",
|
||||
"fuchsia",
|
||||
"magellanica",
|
||||
EnumFlowerType.FUCHSIA,
|
||||
EnumFlowerColor.DEEP_PINK,
|
||||
FUCHSIA("fuchsia", "fuchsia", "magellanica", EnumFlowerType.FUCHSIA, EnumFlowerColor.DEEP_PINK,
|
||||
EnumFlowerColor.MEDIUM_ORCHID),
|
||||
DIANTHUS(
|
||||
"dianthus",
|
||||
"dianthus",
|
||||
"barbatus",
|
||||
EnumFlowerType.DIANTHUS,
|
||||
EnumFlowerColor.CRIMSON,
|
||||
DIANTHUS("dianthus", "dianthus", "barbatus", EnumFlowerType.DIANTHUS, EnumFlowerColor.CRIMSON,
|
||||
EnumFlowerColor.HOT_PINK),
|
||||
FORGET("forget-me-nots", "myosotis", "arvensis", EnumFlowerType.FORGET, EnumFlowerColor.LIGHT_STEEL_BLUE),
|
||||
ANEMONE("anemone", "anemone", "coronaria", EnumFlowerType.ANEMONE, EnumFlowerColor.RED, EnumFlowerColor.MISTY_ROSE),
|
||||
AQUILEGIA(
|
||||
"aquilegia",
|
||||
"aquilegia",
|
||||
"vulgaris",
|
||||
EnumFlowerType.AQUILEGIA,
|
||||
EnumFlowerColor.SLATE_BLUE,
|
||||
AQUILEGIA("aquilegia", "aquilegia", "vulgaris", EnumFlowerType.AQUILEGIA, EnumFlowerColor.SLATE_BLUE,
|
||||
EnumFlowerColor.THISTLE),
|
||||
EDELWEISS(
|
||||
"edelweiss",
|
||||
"leontopodium",
|
||||
"alpinum",
|
||||
EnumFlowerType.EDELWEISS,
|
||||
EnumFlowerColor.WHITE,
|
||||
EDELWEISS("edelweiss", "leontopodium", "alpinum", EnumFlowerType.EDELWEISS, EnumFlowerColor.WHITE,
|
||||
EnumFlowerColor.KHAKI),
|
||||
SCABIOUS("scabious", "scabiosa", "columbaria", EnumFlowerType.SCABIOUS, EnumFlowerColor.ROYAL_BLUE),
|
||||
CONEFLOWER(
|
||||
"coneflower",
|
||||
"echinacea",
|
||||
"purpurea",
|
||||
EnumFlowerType.CONEFLOWER,
|
||||
EnumFlowerColor.VIOLET,
|
||||
CONEFLOWER("coneflower", "echinacea", "purpurea", EnumFlowerType.CONEFLOWER, EnumFlowerColor.VIOLET,
|
||||
EnumFlowerColor.DARK_ORANGE),
|
||||
GAILLARDIA(
|
||||
"gaillardia",
|
||||
"gaillardia",
|
||||
"aristata",
|
||||
EnumFlowerType.GAILLARDIA,
|
||||
EnumFlowerColor.DARK_ORANGE,
|
||||
GAILLARDIA("gaillardia", "gaillardia", "aristata", EnumFlowerType.GAILLARDIA, EnumFlowerColor.DARK_ORANGE,
|
||||
EnumFlowerColor.YELLOW),
|
||||
AURICULA("auricula", "primula", "auricula", EnumFlowerType.AURICULA, EnumFlowerColor.RED, EnumFlowerColor.YELLOW),
|
||||
CAMELLIA("camellia", "camellia", "japonica", EnumFlowerType.CAMELLIA, EnumFlowerColor.CRIMSON),
|
||||
GOLDENROD("goldenrod", "solidago", "canadensis", EnumFlowerType.GOLDENROD, EnumFlowerColor.GOLD),
|
||||
ALTHEA(
|
||||
"althea",
|
||||
"althaea",
|
||||
"officinalis",
|
||||
EnumFlowerType.ALTHEA,
|
||||
EnumFlowerColor.THISTLE,
|
||||
ALTHEA("althea", "althaea", "officinalis", EnumFlowerType.ALTHEA, EnumFlowerColor.THISTLE,
|
||||
EnumFlowerColor.MEDIUM_ORCHID),
|
||||
PENSTEMON(
|
||||
"penstemon",
|
||||
"penstemon",
|
||||
"digitalis",
|
||||
EnumFlowerType.PENSTEMON,
|
||||
EnumFlowerColor.MEDIUM_ORCHID,
|
||||
PENSTEMON("penstemon", "penstemon", "digitalis", EnumFlowerType.PENSTEMON, EnumFlowerColor.MEDIUM_ORCHID,
|
||||
EnumFlowerColor.THISTLE),
|
||||
DELPHINIUM("delphinium", "delphinium", "staphisagria", EnumFlowerType.DELPHINIUM, EnumFlowerColor.DARK_SLATE_BLUE),
|
||||
HOLLYHOCK("hollyhock", "Alcea", "rosea", EnumFlowerType.HOLLYHOCK, EnumFlowerColor.BLACK, EnumFlowerColor.GOLD);
|
||||
@@ -185,12 +119,7 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
this(name, branch, binomial, type, colour, colour);
|
||||
}
|
||||
|
||||
FlowerSpecies(
|
||||
String name,
|
||||
String branch,
|
||||
String binomial,
|
||||
IFlowerType type,
|
||||
EnumFlowerColor primaryColor,
|
||||
FlowerSpecies(String name, String branch, String binomial, IFlowerType type, EnumFlowerColor primaryColor,
|
||||
EnumFlowerColor secondaryColor) {
|
||||
this.name = name;
|
||||
this.binomial = binomial;
|
||||
@@ -211,21 +140,16 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
public static void setupVariants() {
|
||||
FlowerSpecies.DANDELION
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.SHORTENED, EnumAllele.Sappiness.LOWER)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.BOTH_1)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.POPPY
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.SHORTER, EnumAllele.Sappiness.AVERAGE)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_2)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_2).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.ORCHID
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.LOW)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.BOTH_1)
|
||||
FlowerSpecies.ORCHID.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.LOW)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE).setMoisture(EnumMoisture.NORMAL, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.ALLIUM
|
||||
@@ -233,224 +157,175 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
.setPH(EnumAcidity.ALKALINE, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1);
|
||||
|
||||
FlowerSpecies.BLUET
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOWER)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.DAMP, EnumTolerance.NONE)
|
||||
FlowerSpecies.BLUET.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOWER)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.DAMP, EnumTolerance.NONE)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.TULIP
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.BOTH_1).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.DAISY
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOW)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_2)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
FlowerSpecies.DAISY.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOW)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_2).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.CORNFLOWER
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.SHORTER, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.DANDELION, FlowerSpecies.TULIP, 10)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.PANSY
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.SHORTENED, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.TULIP, FlowerSpecies.VIOLA, 5)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.SEA_GREEN);
|
||||
.setMutation(FlowerSpecies.TULIP, FlowerSpecies.VIOLA, 5).setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.DOWN_1).setStemColor(EnumFlowerColor.SEA_GREEN);
|
||||
|
||||
FlowerSpecies.IRIS
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.ORCHID, FlowerSpecies.VIOLA, 10)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.SEA_GREEN);
|
||||
.setMutation(FlowerSpecies.ORCHID, FlowerSpecies.VIOLA, 10).setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.DOWN_1).setStemColor(EnumFlowerColor.SEA_GREEN);
|
||||
|
||||
FlowerSpecies.LAVENDER
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.ALLIUM, FlowerSpecies.VIOLA, 10)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.UP_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.UP_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.DOWN_1).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.VIOLA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.SHORTENED, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.ORCHID, FlowerSpecies.POPPY, 15)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setMutation(FlowerSpecies.ORCHID, FlowerSpecies.POPPY, 15).setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.DAFFODIL
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.ELONGATED, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.DANDELION, FlowerSpecies.POPPY, 10)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.ASTER
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.HIGHER)
|
||||
.setMutation(FlowerSpecies.DAISY, FlowerSpecies.TULIP, 10)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.LILAC
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONGER, EnumAllele.Sappiness.AVERAGE)
|
||||
.setPH(EnumAcidity.ALKALINE, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setPH(EnumAcidity.ALKALINE, EnumTolerance.DOWN_1).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.ROSE
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONGER, EnumAllele.Sappiness.HIGH)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
FlowerSpecies.ROSE.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONGER, EnumAllele.Sappiness.HIGH)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.UP_1).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.PEONY
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.AVERAGE)
|
||||
.setPH(EnumAcidity.ALKALINE, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
FlowerSpecies.PEONY.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.AVERAGE)
|
||||
.setPH(EnumAcidity.ALKALINE, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_GREEN);
|
||||
|
||||
FlowerSpecies.MARIGOLD
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.SHORTER, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.DAISY, FlowerSpecies.DANDELION, 10)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_2)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_2).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.HYDRANGEA
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONGER, EnumAllele.Sappiness.HIGH)
|
||||
.setMutation(FlowerSpecies.PEONY, FlowerSpecies.BLUET, 10)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setMoisture(EnumMoisture.DAMP, EnumTolerance.NONE)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setMoisture(EnumMoisture.DAMP, EnumTolerance.NONE)
|
||||
.setStemColor(EnumFlowerColor.DARK_GREEN);
|
||||
|
||||
FlowerSpecies.FOXGLOVE
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.SHORTENED, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.LILAC, FlowerSpecies.ZINNIA, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_GREEN);
|
||||
|
||||
FlowerSpecies.DAHLIA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.DAISY, FlowerSpecies.ALLIUM, 15)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.BOTH_2)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.BOTH_2).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.CHRYSANTHEMUM
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.HIGH)
|
||||
.setMutation(FlowerSpecies.GERANIUM, FlowerSpecies.ROSE, 10)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.MEDIUM_SEA_GREEN);
|
||||
|
||||
FlowerSpecies.CARNATION
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.HIGH)
|
||||
.setMutation(FlowerSpecies.DIANTHUS, FlowerSpecies.ROSE, 5)
|
||||
.setPH(EnumAcidity.ALKALINE, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.SEA_GREEN);
|
||||
.setPH(EnumAcidity.ALKALINE, EnumTolerance.DOWN_1).setStemColor(EnumFlowerColor.SEA_GREEN);
|
||||
|
||||
FlowerSpecies.ZINNIA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.SHORTER, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.DAHLIA, FlowerSpecies.MARIGOLD, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.BOTH_2)
|
||||
.setStemColor(EnumFlowerColor.MEDIUM_SEA_GREEN);
|
||||
|
||||
FlowerSpecies.PRIMROSE
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.CHRYSANTHEMUM, FlowerSpecies.AURICULA, 5)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.UP_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.UP_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.AZALEA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.ORCHID, FlowerSpecies.GERANIUM, 5)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.GERANIUM
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.LOW)
|
||||
FlowerSpecies.GERANIUM.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.TULIP, FlowerSpecies.ORCHID, 15)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.MEDIUM_SEA_GREEN);
|
||||
|
||||
FlowerSpecies.LILY
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.LOW)
|
||||
FlowerSpecies.LILY.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.TULIP, FlowerSpecies.CHRYSANTHEMUM, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_1).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.YARROW
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOW)
|
||||
FlowerSpecies.YARROW.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.DANDELION, FlowerSpecies.ORCHID, 10)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.UP_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.UP_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_OLIVE_GREEN);
|
||||
|
||||
FlowerSpecies.PETUNIA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.SHORTER, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.TULIP, FlowerSpecies.DAHLIA, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.UP_1).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.AGAPANTHUS
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.ALLIUM, FlowerSpecies.GERANIUM, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_OLIVE_GREEN);
|
||||
|
||||
FlowerSpecies.FUCHSIA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.SHORTENED, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.FOXGLOVE, FlowerSpecies.DAHLIA, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.SEA_GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_1).setStemColor(EnumFlowerColor.SEA_GREEN);
|
||||
|
||||
FlowerSpecies.DIANTHUS
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.SHORT, EnumAllele.Sappiness.HIGH)
|
||||
.setMutation(FlowerSpecies.TULIP, FlowerSpecies.POPPY, 15)
|
||||
.setPH(EnumAcidity.ALKALINE, EnumTolerance.DOWN_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.BOTH_2)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.BOTH_2).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.FORGET
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.SHORT, EnumAllele.Sappiness.LOWER)
|
||||
.setMutation(FlowerSpecies.ORCHID, FlowerSpecies.BLUET, 10)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setMutation(FlowerSpecies.ORCHID, FlowerSpecies.BLUET, 10).setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.UP_1).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
FlowerSpecies.ANEMONE
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOW)
|
||||
FlowerSpecies.ANEMONE.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.AQUILEGIA, FlowerSpecies.ROSE, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_OLIVE_GREEN);
|
||||
|
||||
FlowerSpecies.AQUILEGIA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.AVERAGE)
|
||||
.setMutation(FlowerSpecies.IRIS, FlowerSpecies.POPPY, 5)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.MEDIUM_SEA_GREEN);
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1).setStemColor(EnumFlowerColor.MEDIUM_SEA_GREEN);
|
||||
|
||||
FlowerSpecies.EDELWEISS
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.LOWEST)
|
||||
@@ -464,34 +339,28 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.SHORTENED, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.ALLIUM, FlowerSpecies.CORNFLOWER, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.DOWN_1).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.CONEFLOWER
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.HIGHER)
|
||||
.setMutation(FlowerSpecies.TULIP, FlowerSpecies.CORNFLOWER, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_OLIVE_GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setStemColor(EnumFlowerColor.DARK_OLIVE_GREEN);
|
||||
|
||||
FlowerSpecies.GAILLARDIA
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.HIGHER)
|
||||
.setMutation(FlowerSpecies.DANDELION, FlowerSpecies.MARIGOLD, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setMoisture(EnumMoisture.DAMP, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.BOTH_2)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setMoisture(EnumMoisture.DAMP, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.BOTH_2).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.AURICULA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.ELONGATED, EnumAllele.Sappiness.HIGH)
|
||||
.setMutation(FlowerSpecies.POPPY, FlowerSpecies.GERANIUM, 10)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.UP_1)
|
||||
.setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.UP_1).setMoisture(EnumMoisture.NORMAL, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_OLIVE_GREEN);
|
||||
|
||||
FlowerSpecies.CAMELLIA
|
||||
.setTraits(EnumAllele.Fertility.NORMAL, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.HIGH)
|
||||
.setMutation(FlowerSpecies.HYDRANGEA, FlowerSpecies.ROSE, 5)
|
||||
.setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setMutation(FlowerSpecies.HYDRANGEA, FlowerSpecies.ROSE, 5).setPH(EnumAcidity.ACID, EnumTolerance.NONE)
|
||||
.setMoisture(EnumMoisture.DAMP, EnumTolerance.NONE)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_OLIVE_GREEN);
|
||||
@@ -499,22 +368,18 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
FlowerSpecies.GOLDENROD
|
||||
.setTraits(EnumAllele.Fertility.HIGH, EnumAllele.Lifespan.NORMAL, EnumAllele.Sappiness.HIGHER)
|
||||
.setMutation(FlowerSpecies.LILAC, FlowerSpecies.MARIGOLD, 10)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.MEDIUM_SEA_GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.BOTH_1).setStemColor(EnumFlowerColor.MEDIUM_SEA_GREEN);
|
||||
|
||||
FlowerSpecies.ALTHEA
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.ELONGATED, EnumAllele.Sappiness.HIGH)
|
||||
.setMutation(FlowerSpecies.HYDRANGEA, FlowerSpecies.IRIS, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.DOWN_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_GREEN);
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.BOTH_1).setStemColor(EnumFlowerColor.DARK_GREEN);
|
||||
|
||||
FlowerSpecies.PENSTEMON
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.LOW)
|
||||
FlowerSpecies.PENSTEMON.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.LOW)
|
||||
.setMutation(FlowerSpecies.PEONY, FlowerSpecies.LILAC, 5)
|
||||
.setMoisture(EnumMoisture.DRY, EnumTolerance.UP_1)
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
.setTemperature(EnumTemperature.WARM, EnumTolerance.UP_1).setStemColor(EnumFlowerColor.OLIVE_DRAB);
|
||||
|
||||
FlowerSpecies.DELPHINIUM
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONGER, EnumAllele.Sappiness.LOW)
|
||||
@@ -523,11 +388,9 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
.setTemperature(EnumTemperature.NORMAL, EnumTolerance.DOWN_1)
|
||||
.setStemColor(EnumFlowerColor.DARK_SEA_GREEN);
|
||||
|
||||
FlowerSpecies.HOLLYHOCK
|
||||
.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.HIGH)
|
||||
FlowerSpecies.HOLLYHOCK.setTraits(EnumAllele.Fertility.LOW, EnumAllele.Lifespan.LONG, EnumAllele.Sappiness.HIGH)
|
||||
.setMutation(FlowerSpecies.DELPHINIUM, FlowerSpecies.LAVENDER, 5)
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.UP_1)
|
||||
.setStemColor(EnumFlowerColor.GREEN);
|
||||
.setPH(EnumAcidity.NEUTRAL, EnumTolerance.UP_1).setStemColor(EnumFlowerColor.GREEN);
|
||||
|
||||
IFlowerRoot flowerRoot = BotanyCore.getFlowerRoot();
|
||||
flowerRoot.addConversion(new ItemStack(Blocks.yellow_flower, 1, 0), FlowerSpecies.DANDELION.getTemplate());
|
||||
@@ -541,11 +404,14 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
flowerRoot.addConversion(new ItemStack(Blocks.double_plant, 1, 4), FlowerSpecies.ROSE.getTemplate());
|
||||
flowerRoot.addConversion(new ItemStack(Blocks.double_plant, 1, 5), FlowerSpecies.PEONY.getTemplate());
|
||||
flowerRoot.addConversion(
|
||||
new ItemStack(Blocks.red_flower, 1, 6), FlowerSpecies.TULIP.addVariant(EnumFlowerColor.WHITE));
|
||||
new ItemStack(Blocks.red_flower, 1, 6),
|
||||
FlowerSpecies.TULIP.addVariant(EnumFlowerColor.WHITE));
|
||||
flowerRoot.addConversion(
|
||||
new ItemStack(Blocks.red_flower, 1, 4), FlowerSpecies.TULIP.addVariant(EnumFlowerColor.CRIMSON));
|
||||
new ItemStack(Blocks.red_flower, 1, 4),
|
||||
FlowerSpecies.TULIP.addVariant(EnumFlowerColor.CRIMSON));
|
||||
flowerRoot.addConversion(
|
||||
new ItemStack(Blocks.red_flower, 1, 5), FlowerSpecies.TULIP.addVariant(EnumFlowerColor.DARK_ORANGE));
|
||||
new ItemStack(Blocks.red_flower, 1, 5),
|
||||
FlowerSpecies.TULIP.addVariant(EnumFlowerColor.DARK_ORANGE));
|
||||
|
||||
for (FlowerSpecies species : values()) {
|
||||
String scientific = species.branchName.substring(0, 1).toUpperCase()
|
||||
@@ -553,8 +419,8 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
String uid = "flowers." + species.branchName.toLowerCase();
|
||||
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
if (branch == null) {
|
||||
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(
|
||||
IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
branch = AlleleManager.alleleRegistry
|
||||
.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
}
|
||||
|
||||
species.branch = branch;
|
||||
@@ -567,8 +433,8 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
return this;
|
||||
}
|
||||
|
||||
private FlowerSpecies setTraits(
|
||||
EnumAllele.Fertility fertility, EnumAllele.Lifespan shortened, EnumAllele.Sappiness lower) {
|
||||
private FlowerSpecies setTraits(EnumAllele.Fertility fertility, EnumAllele.Lifespan shortened,
|
||||
EnumAllele.Sappiness lower) {
|
||||
fert = fertility;
|
||||
life = shortened;
|
||||
sap = lower;
|
||||
|
||||
@@ -7,6 +7,7 @@ import forestry.api.genetics.IAllele;
|
||||
import forestry.core.genetics.alleles.EnumAllele;
|
||||
|
||||
public class FlowerTemplates {
|
||||
|
||||
public static IAllele[] getDefaultTemplate() {
|
||||
IAllele[] alleles = new IAllele[EnumFlowerChromosome.values().length];
|
||||
alleles[EnumFlowerChromosome.SPECIES.ordinal()] = FlowerSpecies.POPPY;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.core.BotanyGUI;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,7 +10,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.core.BotanyGUI;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemDictionary extends Item {
|
||||
|
||||
protected IIcon iconMaster;
|
||||
|
||||
public ItemDictionary() {
|
||||
@@ -59,8 +62,7 @@ public class ItemDictionary extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return (stack.getItemDamage() == 0)
|
||||
? I18N.localise("botany.item.database.0.name")
|
||||
return (stack.getItemDamage() == 0) ? I18N.localise("botany.item.database.0.name")
|
||||
: I18N.localise("botany.item.database.1.name");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
@@ -17,11 +21,9 @@ import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ModuleGenetics implements IInitializable {
|
||||
|
||||
static AlleleEffectNone alleleEffectNone = new AlleleEffectNone();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.core.item.IItemMisc;
|
||||
import binnie.core.util.I18N;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.core.item.IItemMisc;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public enum BotanyItems implements IItemMisc {
|
||||
|
||||
AshPowder("powderAsh"),
|
||||
PulpPowder("powderPulp"),
|
||||
MulchPowder("powderMulch"),
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -14,7 +9,15 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemClay extends Item {
|
||||
|
||||
public ItemClay() {
|
||||
setUnlocalizedName("clay");
|
||||
setHasSubtypes(true);
|
||||
@@ -24,8 +27,7 @@ public class ItemClay extends Item {
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
tooltip.add(EnumChatFormatting.GRAY
|
||||
+ EnumFlowerColor.get(stack.getItemDamage()).getName());
|
||||
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(stack.getItemDamage()).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -14,7 +9,15 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemPigment extends Item {
|
||||
|
||||
public ItemPigment() {
|
||||
setUnlocalizedName("pigment");
|
||||
setHasSubtypes(true);
|
||||
@@ -24,8 +27,7 @@ public class ItemPigment extends Item {
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
tooltip.add(EnumChatFormatting.GRAY
|
||||
+ EnumFlowerColor.get(stack.getItemDamage()).getName());
|
||||
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(stack.getItemDamage()).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package binnie.botany.network;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import binnie.botany.flower.TileEntityFlower;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.botany.genetics.EnumFlowerType;
|
||||
import binnie.core.network.packet.MessageBinnie;
|
||||
import binnie.core.network.packet.MessageCoordinates;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.io.IOException;
|
||||
|
||||
public class MessageFlowerUpdate extends MessageCoordinates {
|
||||
|
||||
public TileEntityFlower.RenderInfo render;
|
||||
|
||||
public MessageFlowerUpdate(int posX, int posY, int posZ, TileEntityFlower.RenderInfo render) {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package binnie.botany.network;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
import binnie.botany.flower.TileEntityFlower;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
@@ -10,13 +16,9 @@ import binnie.core.network.packet.MessageNBT;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public enum PacketID implements IPacketID {
|
||||
|
||||
FieldKit,
|
||||
FlowerUpdate;
|
||||
|
||||
@@ -45,10 +47,10 @@ public enum PacketID implements IPacketID {
|
||||
if (data.hasNoTags()) {
|
||||
info += "Flower has not been discovered by you. Breed this flower yourself to discover.";
|
||||
} else {
|
||||
IAlleleFlowerSpecies primary =
|
||||
(IAlleleFlowerSpecies) AlleleManager.alleleRegistry.getAllele(data.getString("Species"));
|
||||
IAlleleFlowerSpecies secondary =
|
||||
(IAlleleFlowerSpecies) AlleleManager.alleleRegistry.getAllele(data.getString("Species2"));
|
||||
IAlleleFlowerSpecies primary = (IAlleleFlowerSpecies) AlleleManager.alleleRegistry
|
||||
.getAllele(data.getString("Species"));
|
||||
IAlleleFlowerSpecies secondary = (IAlleleFlowerSpecies) AlleleManager.alleleRegistry
|
||||
.getAllele(data.getString("Species2"));
|
||||
float age = data.getFloat("Age");
|
||||
EnumFlowerColor color1 = EnumFlowerColor.get(data.getShort("Colour"));
|
||||
EnumFlowerColor color2 = EnumFlowerColor.get(data.getShort("Colour2"));
|
||||
|
||||
@@ -2,4 +2,5 @@ package binnie.botany.proxy;
|
||||
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
|
||||
public interface IBotanyProxy extends IProxyCore {}
|
||||
public interface IBotanyProxy extends IProxyCore {
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import binnie.botany.Botany;
|
||||
import binnie.core.proxy.BinnieModProxy;
|
||||
|
||||
public class Proxy extends BinnieModProxy implements IBotanyProxy {
|
||||
|
||||
public Proxy() {
|
||||
super(Botany.instance);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package binnie.botany.proxy;
|
||||
|
||||
public class ProxyClient extends Proxy implements IBotanyProxy {}
|
||||
public class ProxyClient extends Proxy implements IBotanyProxy {
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
package binnie.botany.proxy;
|
||||
|
||||
public class ProxyServer extends Proxy implements IBotanyProxy {}
|
||||
public class ProxyServer extends Proxy implements IBotanyProxy {
|
||||
}
|
||||
@@ -1,5 +1,13 @@
|
||||
package binnie.core;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.mod.parser.FieldParser;
|
||||
@@ -11,14 +19,9 @@ import binnie.core.proxy.IProxyCore;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
|
||||
private SimpleNetworkWrapper wrapper;
|
||||
private final LinkedHashSet<Field> fields;
|
||||
protected final List<IInitializable> modules;
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
package binnie.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
@@ -38,21 +47,15 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.ForestryEvent;
|
||||
import forestry.plugins.PluginManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
|
||||
@Mod(
|
||||
modid = "BinnieCore",
|
||||
name = "Binnie Core",
|
||||
version = BinnieCore.VERSION,
|
||||
useMetadata = true,
|
||||
dependencies = "after:Forestry@[4.2,)")
|
||||
dependencies = "after:Forestry@[4.2,),required-after:gtnhlib@[0.0.10,)")
|
||||
public class BinnieCore extends AbstractMod {
|
||||
|
||||
@Mod.Instance("BinnieCore")
|
||||
public static BinnieCore instance;
|
||||
|
||||
@@ -171,8 +174,8 @@ public class BinnieCore extends AbstractMod {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void handleSpeciesDiscovered(ForestryEvent.SpeciesDiscovered event) {
|
||||
try {
|
||||
EntityPlayerMP player =
|
||||
MinecraftServer.getServer().getConfigurationManager().func_152612_a(event.username.getName());
|
||||
EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager()
|
||||
.func_152612_a(event.username.getName());
|
||||
if (player == null) {
|
||||
return;
|
||||
}
|
||||
@@ -215,7 +218,7 @@ public class BinnieCore extends AbstractMod {
|
||||
|
||||
@Override
|
||||
public Class<?>[] getConfigs() {
|
||||
return new Class[] {ConfigurationMain.class};
|
||||
return new Class[] { ConfigurationMain.class };
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,6 +232,7 @@ public class BinnieCore extends AbstractMod {
|
||||
}
|
||||
|
||||
public static class PacketHandler extends BinniePacketHandler {
|
||||
|
||||
public PacketHandler() {
|
||||
super(instance);
|
||||
}
|
||||
|
||||
Loaded 100 of 843 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user