mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-15 01:35:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7553983e28 | ||
|
|
d47246adbe | ||
|
|
91446f7c07 | ||
|
|
c84b8ae033 | ||
|
|
a64ac3e19c | ||
|
|
a24d7a339c | ||
|
|
d92cae88e2 | ||
|
|
7b021331bb | ||
|
|
3a1b633044 | ||
|
|
7b744a3e2c | ||
|
|
de53168447 | ||
|
|
18073d2f76 | ||
|
|
87581cd03b | ||
|
|
6facfe5fa8 | ||
|
|
e32e427f93 | ||
|
|
fe35f8e237 | ||
|
|
4836d89ed9 | ||
|
|
d486b30dff | ||
|
|
1b9212786f | ||
|
|
d8bf61a44e | ||
|
|
bce6c26704 | ||
|
|
a9eb396b7e | ||
|
|
92211ddbf4 | ||
|
|
3c6ab0e052 | ||
|
|
16793c2385 | ||
|
|
9c820bd038 | ||
|
|
f12a75a356 | ||
|
|
74d8810684 | ||
|
|
87ccfb36c4 | ||
|
|
765dade9bd | ||
|
|
b535a7ca46 | ||
|
|
0ff171ba5e | ||
|
|
7946203545 | ||
|
|
a2366fee20 | ||
|
|
aeb03873d8 | ||
|
|
25241cb7e9 | ||
|
|
97e808394f | ||
|
|
3de24b0647 | ||
|
|
cf518d19fb | ||
|
|
7a3ef5ecb2 | ||
|
|
14459ad991 | ||
|
|
2c6273c2d9 | ||
|
|
186a136d9d | ||
|
|
05b0532c05 | ||
|
|
045b228020 | ||
|
|
0a08927302 | ||
|
|
ab0122dda2 | ||
|
|
c0bba17d08 | ||
|
|
28869a08df | ||
|
|
ec2bb33ea0 | ||
|
|
008d290136 | ||
|
|
08404a3dd2 | ||
|
|
5378ff34bf | ||
|
|
33573ba463 | ||
|
|
84b120e89d | ||
|
|
add9f4685d | ||
|
|
75d745b7a0 | ||
|
|
e5bf29dd95 | ||
|
|
de5d902139 | ||
|
|
f3c4551f8a | ||
|
|
00dfeac8cb | ||
|
|
e443efcc5a | ||
|
|
f3c067f503 | ||
|
|
46567817e8 | ||
|
|
23742eab03 | ||
|
|
958a76247d | ||
|
|
31803aa092 | ||
|
|
766c0d5fd3 | ||
|
|
6a411bb607 | ||
|
|
0aa95b495a | ||
|
|
86274906eb | ||
|
|
fc7dc2c14d | ||
|
|
807a8e24ed | ||
|
|
2e74ed4645 | ||
|
|
ebdb282c6b | ||
|
|
d60f070e75 | ||
|
|
0b2e47d88d | ||
|
|
6be0719a9f | ||
|
|
e9ad1bda8e | ||
|
|
a15d297f8a | ||
|
|
2883900b1e | ||
|
|
0444201f7a | ||
|
|
3e9965b750 | ||
|
|
e8d843eb89 | ||
|
|
555f44889d | ||
|
|
4bca0f042d | ||
|
|
dc288141ac | ||
|
|
d26f4816e1 | ||
|
|
79b8e3e6a4 | ||
|
|
5e21a29d3f | ||
|
|
f6e2eec09c | ||
|
|
031b077a4b | ||
|
|
49f4c84b5d | ||
|
|
09b4d5a207 | ||
|
|
68f226e07e | ||
|
|
da6ea7048a | ||
|
|
d721a7e98f | ||
|
|
ce050eaa63 | ||
|
|
0133d143f8 | ||
|
|
7cc917ae76 | ||
|
|
6f1d00e4f5 | ||
|
|
2aa0b9bb8c | ||
|
|
d5d8885850 | ||
|
|
cb6cb3a01f | ||
|
|
cd5c2b3406 | ||
|
|
b1b06753ad | ||
|
|
5846f59d64 | ||
|
|
ec790c9333 | ||
|
|
784fa0ad30 | ||
|
|
3bd8c53273 | ||
|
|
bc10e65feb | ||
|
|
3eaf99a4d1 | ||
|
|
7910cff956 |
No files matched your search
@@ -0,0 +1,9 @@
|
||||
directory="run/crash-reports"
|
||||
if [ -d $directory ]; then
|
||||
echo "Crash reports detected:"
|
||||
cat $directory/*
|
||||
exit 1
|
||||
else
|
||||
echo "No crash reports detected"
|
||||
exit 0
|
||||
fi
|
||||
@@ -0,0 +1,45 @@
|
||||
# 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
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
|
||||
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 minute
|
||||
run: |
|
||||
mkdir run
|
||||
echo "eula=true" > run/eula.txt
|
||||
timeout 60 ./gradlew runServer || true
|
||||
|
||||
- name: Test no crashes happend
|
||||
run: |
|
||||
chmod +x .github/scripts/test-no-crash-reports.sh
|
||||
.github/scripts/test-no-crash-reports.sh
|
||||
@@ -0,0 +1,45 @@
|
||||
# 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:
|
||||
- '*'
|
||||
|
||||
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
|
||||
+25
-14
@@ -1,18 +1,29 @@
|
||||
.gradle
|
||||
# IntelliJ
|
||||
/build
|
||||
/run
|
||||
/eclipse
|
||||
/out
|
||||
.idea
|
||||
.settings
|
||||
/.idea/
|
||||
/run/
|
||||
/build/
|
||||
/eclipse/
|
||||
.classpath
|
||||
.project
|
||||
/bin/
|
||||
/config/
|
||||
/crash-reports/
|
||||
/logs/
|
||||
options.txt
|
||||
/saves/
|
||||
usernamecache.json
|
||||
banned-ips.json
|
||||
banned-players.json
|
||||
eula.txt
|
||||
ops.json
|
||||
server.properties
|
||||
servers.dat
|
||||
usercache.json
|
||||
whitelist.json
|
||||
/out/
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
# minecraft
|
||||
/config
|
||||
/logs
|
||||
/saves
|
||||
/options.txt
|
||||
/usernamecache.json
|
||||
|
||||
changelog.html
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
language: java
|
||||
jdk: oraclejdk8
|
||||
|
||||
before_cache:
|
||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||
- rm -f $HOME/.gradle/caches/minecraft/deobfedDeps/providedDummy.jar
|
||||
- rm -f $HOME/.gradle/caches/minecraft/deobfedDeps/compileDummy.jar
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
||||
|
||||
before_install: chmod +x gradlew
|
||||
install:
|
||||
- ./gradlew setupCIWorkspace -S
|
||||
script:
|
||||
- ./gradlew build
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
@@ -1,13 +1,46 @@
|
||||
## Binnie mods
|
||||
[Binnie mods](https://minecraft.curseforge.com/projects/binnies-mods/files)
|
||||
====================================
|
||||
|
||||
This is an official fork of mod.
|
||||
All builds can be found on [Jenkins](https://ci.bymarcin.com/job/Binnie-Mods-MC1.7.10/)
|
||||
### What is it?
|
||||
Binnie’s Mods is a suite of mods designed to expand the [Forestry](https://github.com/ForestryMC/ForestryMC) mod.
|
||||
It both extends the bee and tree breeding aspect by adding many new species with varied products,
|
||||
along with new features such as fully breedable flowers and genetic manipulation.
|
||||
|
||||
### Homepage
|
||||
|
||||
[Wiki](https://binnie.mods.wiki/wiki/Main_Page)
|
||||
|
||||
[Latest Builds for 1.7.10](https://ci.bymarcin.com/job/Binnie-Mods-MC1.7.10/)
|
||||
|
||||
### Mods
|
||||
|
||||
[](https://binnie.mods.wiki/wiki/Extra_Bees)
|
||||
|
||||
Extra Bees expands upon the bee breeding of Forestry by adding 107 new bee species to forestry. These bees cover a large spectrum of different effects and products, giving you the ability to produce everything from dyes to rare metal dusts purely from bees. It also adds the Apiarist Database, a tool to keep track of discovered species, mutations and traits. There are also new alveary components which help improve and streamline bee production.
|
||||
|
||||
|
||||
[](https://binnie.mods.wiki/wiki/Extra_Trees)
|
||||
|
||||
Extra Trees both increases the number of tree species and adds many new aesthetic uses. There are 96 new tree species, such as Banana, Brazil nut and Douglas-fir. This comes with many new fruits as well as 35 new wooden planks. Extra Trees allows these, as well as Forestry and vanilla planks, to be combined to give doors, gates and various designs of fences. The woodworker allows planks to be combined to give patterned tiles, allowing you to build beautiful wooden floors, and the same can be done with stained glass. A group of machines such as the brewery and distillery allow you to use the fruits you grow to make a variety of wines, ciders and spirits.
|
||||
|
||||
|
||||
[](https://binnie.mods.wiki/wiki/Botany)
|
||||
|
||||
Botany adds an entirely new breeding system to Forestry: flowers. There are 46 different species that can be bred, including both vanilla flowers and new ones such as Fuschia and Lilies. The colour of the flowers can be transferred and selectively bred, meaning that each flower can be one of a possible 80 different colours. These new flowers can be bred manually in small gardens using a trowel and fertiliser, with careful care taken to maintain the desired pH or moisture, or grown on the large scale in Forestry farms.
|
||||
|
||||
[](https://binnie.mods.wiki/wiki/Genetics)
|
||||
|
||||
Genetics is for those who want to eschew conventional breeding, and want to enter the realm of genetic manipulation. Here, genes can be isolated, sequenced and then inoculated back into different species, making it easier to obtain the perfect genome. Bees, trees, butterflies and flowers can all be manipulated in this way. They can also be acclimatised to different environments to build tolerance to hostile climates.
|
||||
|
||||
[](https://binnie.mods.wiki/wiki/Binnie_Core)
|
||||
|
||||
Binnie Core is a mod which contains a lot of the core functionality such as networking and GUI's for the other mods. The only in game features it currently contains are the Compartments
|
||||
|
||||
### Warning
|
||||
|
||||
Removed unused (unfinished) items and blocks: Honey Crystal, Alcohol, etc.
|
||||
|
||||
#### Build
|
||||
### Building
|
||||
|
||||
The master branch will always contain the latest released version with possibly some bug fixes for that version that will eventually be released.
|
||||
New versions will be created in branched named like {mc_version}-{mod_version}
|
||||
|
||||
+502
-41
@@ -1,68 +1,529 @@
|
||||
//version: 928ecf7feb33a1149538b0e2cd17e3bc5f281428
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
Please check https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle for updates.
|
||||
*/
|
||||
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
url = "https://maven.minecraftforge.net"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
name = "Scala CI dependencies"
|
||||
url = "https://repo1.maven.org/maven2/"
|
||||
}
|
||||
maven {
|
||||
name = "jitpack"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.47"
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.4'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
|
||||
plugins {
|
||||
id 'idea'
|
||||
id 'scala'
|
||||
id("org.ajoberstar.grgit") version("3.1.1")
|
||||
id("com.github.johnrengelman.shadow") version("4.0.4")
|
||||
id("com.palantir.git-version") version("0.12.3")
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "2.0.17"
|
||||
if (System.getenv("BUILD_NUMBER") != null) {
|
||||
version = version + "-" + System.getenv("BUILD_NUMBER")
|
||||
}
|
||||
group = "binnie" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "binnie-mods-1.7.10"
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
def projectJavaVersion = JavaLanguageVersion.of(8)
|
||||
|
||||
// uncomment this hack if you use old IDEA
|
||||
/*sourceSets {
|
||||
main {
|
||||
output.resourcesDir = output.classesDir
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(projectJavaVersion)
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
inheritOutputDirs = true
|
||||
downloadJavadoc = true
|
||||
downloadSources = true
|
||||
}
|
||||
}
|
||||
|
||||
if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
|
||||
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
|
||||
}
|
||||
|
||||
checkPropertyExists("modName")
|
||||
checkPropertyExists("modId")
|
||||
checkPropertyExists("modGroup")
|
||||
checkPropertyExists("autoUpdateBuildScript")
|
||||
checkPropertyExists("minecraftVersion")
|
||||
checkPropertyExists("forgeVersion")
|
||||
checkPropertyExists("replaceGradleTokenInFile")
|
||||
checkPropertyExists("gradleTokenModId")
|
||||
checkPropertyExists("gradleTokenModName")
|
||||
checkPropertyExists("gradleTokenVersion")
|
||||
checkPropertyExists("gradleTokenGroupName")
|
||||
checkPropertyExists("apiPackage")
|
||||
checkPropertyExists("accessTransformersFile")
|
||||
checkPropertyExists("usesMixins")
|
||||
checkPropertyExists("mixinPlugin")
|
||||
checkPropertyExists("mixinsPackage")
|
||||
checkPropertyExists("coreModClass")
|
||||
checkPropertyExists("containsMixinsAndOrCoreModOnly")
|
||||
checkPropertyExists("usesShadowedDependencies")
|
||||
checkPropertyExists("developmentEnvironmentUserName")
|
||||
|
||||
|
||||
String javaSourceDir = "src/main/java/"
|
||||
String scalaSourceDir = "src/main/scala/"
|
||||
|
||||
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
|
||||
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
|
||||
}
|
||||
|
||||
if(apiPackage) {
|
||||
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
||||
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
|
||||
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
|
||||
}
|
||||
}
|
||||
|
||||
if(accessTransformersFile) {
|
||||
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
|
||||
if(getFile(targetFile).exists() == false) {
|
||||
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
|
||||
}
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) {
|
||||
throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!")
|
||||
}
|
||||
|
||||
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
||||
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
|
||||
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
|
||||
}
|
||||
|
||||
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
|
||||
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
|
||||
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
|
||||
if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava)
|
||||
}
|
||||
}
|
||||
|
||||
if(coreModClass) {
|
||||
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
|
||||
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala"
|
||||
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
|
||||
if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) {
|
||||
throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava)
|
||||
}
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
|
||||
|
||||
// Make sure GregTech build won't time out
|
||||
System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String)
|
||||
System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String)
|
||||
}
|
||||
|
||||
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
|
||||
'git config core.fileMode false'.execute()
|
||||
// Pulls version from git tag
|
||||
try {
|
||||
version = minecraftVersion + "-" + gitVersion()
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!");
|
||||
}
|
||||
|
||||
group = modGroup
|
||||
if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
}
|
||||
else {
|
||||
archivesBaseName = modId
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.4.1614-1.7.10"
|
||||
runDir = "eclipse"
|
||||
}
|
||||
version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion
|
||||
runDir = "run"
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
expand 'version': project.version,
|
||||
'mcversion': project.minecraft.version,
|
||||
'modid': "BinnieMods"
|
||||
}
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
if (replaceGradleTokenInFile) {
|
||||
replaceIn replaceGradleTokenInFile
|
||||
if(gradleTokenModId) {
|
||||
replace gradleTokenModId, modId
|
||||
}
|
||||
if(gradleTokenModName) {
|
||||
replace gradleTokenModName, modName
|
||||
}
|
||||
if(gradleTokenVersion) {
|
||||
replace gradleTokenVersion, versionDetails().lastTag
|
||||
}
|
||||
if(gradleTokenGroupName) {
|
||||
replace gradleTokenGroupName, modGroup
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
|
||||
filePath = "changelog.html"
|
||||
untaggedName = "Current release ${project.version}"
|
||||
fromCommit = "dbc5c1a564c39e4a9c042411d1bdbe450985ce2c"
|
||||
toRef = "HEAD"
|
||||
templateContent = file('changelog.mustache').getText('UTF-8');
|
||||
if(file("addon.gradle").exists()) {
|
||||
apply from: "addon.gradle"
|
||||
}
|
||||
|
||||
apply from: 'repositories.gradle'
|
||||
|
||||
configurations {
|
||||
implementation.extendsFrom(shadowImplementation)
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "Overmind forge repo mirror"
|
||||
url = "https://gregtech.overminddl1.com/"
|
||||
}
|
||||
if(usesMixins.toBoolean()) {
|
||||
maven {
|
||||
name = "sponge"
|
||||
url = "https://repo.spongepowered.org/repository/maven-public"
|
||||
}
|
||||
maven {
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
if(usesMixins.toBoolean()) {
|
||||
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
|
||||
annotationProcessor("com.google.guava:guava:24.1.1-jre")
|
||||
annotationProcessor("com.google.code.gson:gson:2.8.6")
|
||||
annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT")
|
||||
// using 0.8 to workaround a issue in 0.7 which fails mixin application
|
||||
compile("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
|
||||
// Mixin includes a lot of dependencies that are too up-to-date
|
||||
exclude module: "launchwrapper"
|
||||
exclude module: "guava"
|
||||
exclude module: "gson"
|
||||
exclude module: "commons-io"
|
||||
exclude module: "log4j-core"
|
||||
}
|
||||
compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
def mixingConfigRefMap = "mixins." + modId + ".refmap.json"
|
||||
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
|
||||
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
|
||||
|
||||
task generateAssets {
|
||||
if(usesMixins.toBoolean()) {
|
||||
getFile("/src/main/resources/mixins." + modId + ".json").text = """{
|
||||
"required": true,
|
||||
"minVersion": "0.7.11",
|
||||
"package": "${modGroup}.${mixinsPackage}",
|
||||
"plugin": "${modGroup}.${mixinPlugin}",
|
||||
"refmap": "${mixingConfigRefMap}",
|
||||
"target": "@env(DEFAULT)",
|
||||
"compatibilityLevel": "JAVA_8"
|
||||
}
|
||||
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
task relocateShadowJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = modGroup + ".shadow"
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation]
|
||||
dependsOn(relocateShadowJar)
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(shadowJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
reobf {
|
||||
if(usesMixins.toBoolean()) {
|
||||
addExtraSrgFile mixinSrg
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
if(usesMixins.toBoolean()) {
|
||||
tasks.compileJava {
|
||||
options.compilerArgs += [
|
||||
"-AreobfSrgFile=${tasks.reobf.srg}",
|
||||
"-AoutSrgFile=${mixinSrg}",
|
||||
"-AoutRefMapFile=${refMap}",
|
||||
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
|
||||
"-XDenableSunApiLintControl",
|
||||
"-XDignore.symbol.file"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runClient {
|
||||
def arguments = []
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
arguments += [
|
||||
"--mods=../build/libs/$modId-${version}.jar",
|
||||
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
|
||||
]
|
||||
}
|
||||
|
||||
if(developmentEnvironmentUserName) {
|
||||
arguments += [
|
||||
"--username",
|
||||
developmentEnvironmentUserName
|
||||
]
|
||||
}
|
||||
|
||||
args(arguments)
|
||||
}
|
||||
|
||||
runServer {
|
||||
def arguments = []
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
arguments += [
|
||||
"--mods=../build/libs/$modId-${version}.jar",
|
||||
"--tweakClass org.spongepowered.asm.launch.MixinTweaker"
|
||||
]
|
||||
}
|
||||
|
||||
args(arguments)
|
||||
}
|
||||
|
||||
tasks.withType(JavaExec).configureEach {
|
||||
javaLauncher.set(
|
||||
javaToolchains.launcherFor {
|
||||
languageVersion = projectJavaVersion
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand "minecraftVersion": project.minecraft.version,
|
||||
"modVersion": versionDetails().lastTag,
|
||||
"modId": modId,
|
||||
"modName": modName
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
from refMap
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
def getManifestAttributes() {
|
||||
def manifestAttributes = [:]
|
||||
if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) {
|
||||
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
|
||||
}
|
||||
|
||||
if(accessTransformersFile) {
|
||||
manifestAttributes += ["FMLAT" : accessTransformersFile.toString()]
|
||||
}
|
||||
|
||||
if(coreModClass) {
|
||||
manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass]
|
||||
}
|
||||
|
||||
if(usesMixins.toBoolean()) {
|
||||
manifestAttributes += [
|
||||
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
|
||||
"MixinConfigs" : "mixins." + modId + ".json",
|
||||
"ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false
|
||||
]
|
||||
}
|
||||
return manifestAttributes
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from (sourceSets.main.allJava)
|
||||
from (file("$projectDir/LICENSE"))
|
||||
getArchiveClassifier().set('sources')
|
||||
}
|
||||
|
||||
task shadowDevJar(type: ShadowJar) {
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation]
|
||||
}
|
||||
|
||||
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowDevJar
|
||||
prefix = modGroup + ".shadow"
|
||||
}
|
||||
|
||||
task circularResolverJar(type: Jar) {
|
||||
dependsOn(relocateShadowDevJar)
|
||||
dependsOn(shadowDevJar)
|
||||
enabled = false
|
||||
}
|
||||
|
||||
task devJar(type: Jar) {
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(circularResolverJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
task apiJar(type: Jar) {
|
||||
from (sourceSets.main.allJava) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.output) {
|
||||
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
|
||||
}
|
||||
|
||||
from (sourceSets.main.resources.srcDirs) {
|
||||
include("LICENSE")
|
||||
}
|
||||
|
||||
getArchiveClassifier().set('api')
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives devJar
|
||||
if(apiPackage) {
|
||||
archives apiJar
|
||||
}
|
||||
}
|
||||
|
||||
// Updating
|
||||
task updateBuildScript {
|
||||
doLast {
|
||||
if (performBuildScriptUpdate(projectDir.toString())) return
|
||||
|
||||
print("Build script already up-to-date!")
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
|
||||
if (autoUpdateBuildScript.toBoolean()) {
|
||||
performBuildScriptUpdate(projectDir.toString())
|
||||
} else {
|
||||
println("Build script update available! Run 'gradle updateBuildScript'")
|
||||
}
|
||||
}
|
||||
|
||||
static URL availableBuildScriptUrl() {
|
||||
new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle")
|
||||
}
|
||||
|
||||
boolean performBuildScriptUpdate(String projectDir) {
|
||||
if (isNewBuildScriptVersionAvailable(projectDir)) {
|
||||
def buildscriptFile = getFile("build.gradle")
|
||||
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
|
||||
print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
boolean isNewBuildScriptVersionAvailable(String projectDir) {
|
||||
Map parameters = ["connectTimeout": 2000, "readTimeout": 2000]
|
||||
|
||||
String currentBuildScript = getFile("build.gradle").getText()
|
||||
String currentBuildScriptHash = getVersionHash(currentBuildScript)
|
||||
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
|
||||
String availableBuildScriptHash = getVersionHash(availableBuildScript)
|
||||
|
||||
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
|
||||
return !isUpToDate
|
||||
}
|
||||
|
||||
static String getVersionHash(String buildScriptContent) {
|
||||
String versionLine = buildScriptContent.find("^//version: [a-z0-9]*")
|
||||
if(versionLine != null) {
|
||||
return versionLine.split(": ").last()
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
configure(updateBuildScript) {
|
||||
group = 'forgegradle'
|
||||
description = 'Updates the build script to the latest version'
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
|
||||
def checkPropertyExists(String propertyName) {
|
||||
if (project.hasProperty(propertyName) == false) {
|
||||
throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties")
|
||||
}
|
||||
}
|
||||
|
||||
def getFile(String relativePath) {
|
||||
return new File(projectDir, relativePath)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile("com.github.GTNewHorizons:ForestryMC:master-SNAPSHOT:dev")
|
||||
|
||||
|
||||
/*compileOnly("net.industrial-craft:industrialcraft-2:2.2.828-experimental:api") { // Transitive by ForestryMC
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("com.mod-buildcraft:buildcraft:7.1.23:dev") { // Transitive by ForestryMC
|
||||
transitive = false
|
||||
}
|
||||
compileOnly("curse.maven:cofh-lib-220333:2388748") { // Transitive by ForestryMC
|
||||
transitive = false
|
||||
}*/
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
modName = Binnie Core
|
||||
|
||||
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
|
||||
modId = BinnieCore
|
||||
|
||||
modGroup = binnie
|
||||
|
||||
# WHY is there no version field?
|
||||
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
|
||||
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
|
||||
|
||||
# Will update your build.gradle automatically whenever an update is available
|
||||
autoUpdateBuildScript = false
|
||||
|
||||
minecraftVersion = 1.7.10
|
||||
forgeVersion = 10.13.4.1614
|
||||
|
||||
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you
|
||||
# restart Minecraft in development. Choose this dependent on your mod:
|
||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
|
||||
developmentEnvironmentUserName = "Developer"
|
||||
|
||||
# Define a source file of your project with:
|
||||
# public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
|
||||
# version in @Mod([...], version = VERSION, [...])
|
||||
# Leave these properties empty to skip individual token replacements
|
||||
replaceGradleTokenInFile =
|
||||
gradleTokenModId =
|
||||
gradleTokenModName =
|
||||
gradleTokenVersion =
|
||||
gradleTokenGroupName =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can
|
||||
# leave this property empty.
|
||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||
apiPackage =
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
accessTransformersFile =
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage =
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatability only
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass =
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = false
|
||||
|
||||
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
|
||||
# responsibility check the licence and request permission for distribution, if required.
|
||||
usesShadowedDependencies = false
|
||||
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
|
||||
# projects. New projects should not use this parameter.
|
||||
customArchiveBaseName = binnie-mods
|
||||
Vendored
BIN
Binary file not shown.
+1
-2
@@ -1,6 +1,5 @@
|
||||
#Wed Jul 02 15:54:47 CDT 2014
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
|
||||
@@ -1,4 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
@@ -6,47 +22,6 @@
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
@@ -61,9 +36,49 @@ while [ -h "$PRG" ] ; do
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
@@ -90,7 +105,7 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
@@ -110,10 +125,11 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
@@ -154,11 +170,19 @@ if $cygwin ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+100
-90
@@ -1,90 +1,100 @@
|
||||
@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
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem 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 Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
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=.
|
||||
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
|
||||
@@ -0,0 +1,2 @@
|
||||
before_install:
|
||||
- ./gradlew setupCIWorkspace
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "ic2"
|
||||
url = "http://maven.ic2.player.to/"
|
||||
metadataSources {
|
||||
mavenPom()
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url "https://cursemaven.com"
|
||||
}
|
||||
maven {
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
if (info.length() > 0) {
|
||||
info = " (" + info + EnumChatFormatting.RESET + ")";
|
||||
}
|
||||
addTooltipString("Flowers" + info);
|
||||
addTooltipString(I18N.localise("botany.circuit.flowers") + info);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,10 +89,28 @@ public class GardenLogic extends FarmLogic {
|
||||
return stack.getItem() == Item.getItemFromBlock(Blocks.dirt);
|
||||
}
|
||||
|
||||
private boolean maintainSoil(int x2, int y2, int z2, FarmDirection direction, int extent) {
|
||||
private boolean maintainSoil(int x, int y, int z, FarmDirection direction, int extent) {
|
||||
for (int i = 0; i < extent; ++i) {
|
||||
Vect position = translateWithOffset(x2, y2, z2, direction, i);
|
||||
if (fertilised && Gardening.isSoil(world.getBlock(position.x, position.y, position.z))) {
|
||||
Vect position = translateWithOffset(x, y, z, direction, i);
|
||||
boolean isSoil = Gardening.isSoil(world.getBlock(position.x, position.y, position.z));
|
||||
|
||||
// remove unnecessary blocks
|
||||
if (!isManual && !isSoil && !isAirBlock(position)) {
|
||||
Block block = world.getBlock(position.x, position.y, position.z);
|
||||
if (moisture == EnumMoisture.DAMP) {
|
||||
if (block != Blocks.water) {
|
||||
dropBlockAsProduction(position);
|
||||
}
|
||||
} else if (moisture == EnumMoisture.DRY) {
|
||||
if (block != Blocks.sand) {
|
||||
dropBlockAsProduction(position);
|
||||
}
|
||||
} else {
|
||||
dropBlockAsProduction(position);
|
||||
}
|
||||
}
|
||||
|
||||
if (fertilised && isSoil) {
|
||||
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
|
||||
if (soil.fertilise(world, position.x, position.y, position.z, EnumSoilType.FLOWERBED)) {
|
||||
continue;
|
||||
@@ -101,55 +119,56 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
if (world.getBlock(position.x, position.y + 1, position.z) == Botany.plant) {
|
||||
world.setBlockToAir(position.x, position.y + 1, position.z);
|
||||
} else {
|
||||
if (acidity != null && Gardening.isSoil(world.getBlock(position.x, position.y, position.z))) {
|
||||
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
|
||||
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});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
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});
|
||||
continue;
|
||||
}
|
||||
if (acidity != null && isSoil) {
|
||||
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
|
||||
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});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
produce.addAll(Blocks.dirt.getDrops(world, position.x, position.y, position.z, block.getItemDamage(), 0));
|
||||
setBlock(position, Blocks.air, 0);
|
||||
return trySetSoil(position, loam);
|
||||
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});
|
||||
continue;
|
||||
}
|
||||
} else if (!isManual) {
|
||||
if (!isWaterBlock(position)) {
|
||||
if (i % 2 == 0) {
|
||||
return trySetSoil(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FarmDirection cclock = FarmDirection.EAST;
|
||||
if (direction == FarmDirection.EAST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
} else if (direction == FarmDirection.SOUTH) {
|
||||
cclock = FarmDirection.EAST;
|
||||
} else if (direction == FarmDirection.WEST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
}
|
||||
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) {
|
||||
produce.addAll(Blocks.dirt.getDrops(world, position.x, position.y, position.z, block.getItemDamage(), 0));
|
||||
setBlock(position, Blocks.air, 0);
|
||||
return trySetSoil(position, loam);
|
||||
}
|
||||
} else if (!isManual) {
|
||||
if (!isWaterBlock(position)) {
|
||||
if (i % 2 == 0) {
|
||||
return trySetSoil(position);
|
||||
}
|
||||
|
||||
Vect previous = translateWithOffset(position.x, position.y, position.z, cclock, 1);
|
||||
ItemStack soil2 = getAsItemStack(previous);
|
||||
if (!Gardening.isSoil(soil2.getItem())) {
|
||||
trySetSoil(position);
|
||||
}
|
||||
FarmDirection cclock = FarmDirection.EAST;
|
||||
if (direction == FarmDirection.EAST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
} else if (direction == FarmDirection.SOUTH) {
|
||||
cclock = FarmDirection.EAST;
|
||||
} else if (direction == FarmDirection.WEST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
}
|
||||
|
||||
Vect previous = translateWithOffset(position.x, position.y, position.z, cclock, 1);
|
||||
ItemStack soil2 = getAsItemStack(previous);
|
||||
if (!Gardening.isSoil(soil2.getItem())) {
|
||||
trySetSoil(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -278,10 +297,19 @@ public class GardenLogic extends FarmLogic {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void dropBlockAsProduction(Vect position) {
|
||||
ItemStack stack = new ItemStack(world.getBlock(position.x, position.y, position.z));
|
||||
if (stack.getItem() == null) {
|
||||
return;
|
||||
}
|
||||
produce.add(stack);
|
||||
world.setBlockToAir(position.x, position.y, position.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedGermling(ItemStack itemstack) {
|
||||
public boolean isAcceptedGermling(ItemStack stack) {
|
||||
for (IFarmable farmable : farmables) {
|
||||
if (farmable.isGermling(itemstack)) {
|
||||
if (farmable.isGermling(stack)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -340,7 +368,7 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
try {
|
||||
IOwnable housing2 = (IOwnable) housing;
|
||||
GameProfile prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
|
||||
GameProfile prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
|
||||
((TileEntityFlower) tile).setOwner(prof);
|
||||
} catch (Exception ex) {
|
||||
// ignored
|
||||
|
||||
@@ -36,6 +36,12 @@ public class BlockFlower extends BlockContainer {
|
||||
setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, f * 3.0f, 0.5f + f);
|
||||
setTickRandomly(true);
|
||||
setBlockName("flower");
|
||||
setStepSound(Block.soundTypeGrass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return "botany.flower";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -217,4 +223,10 @@ public class BlockFlower extends BlockContainer {
|
||||
}
|
||||
return hasBeenBroken;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int meta, int side) {
|
||||
return Blocks.yellow_flower.getIcon(0, 0);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public class ItemInsulatedTube extends Item {
|
||||
icons = new IIcon[3];
|
||||
setUnlocalizedName("insulatedTube");
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public static ItemStack getInsulateStack(ItemStack stack) {
|
||||
@@ -52,9 +53,9 @@ public class ItemInsulatedTube extends Item {
|
||||
if (pass == 0) {
|
||||
return 0xffffff;
|
||||
}
|
||||
return (pass == 1) ?
|
||||
Material.get(stack.getItemDamage()).getColor() :
|
||||
Insulate.get(stack.getItemDamage()).getColor();
|
||||
return (pass == 1)
|
||||
? Material.get(stack.getItemDamage()).getColor()
|
||||
: Insulate.get(stack.getItemDamage()).getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,7 @@ public class BlockPlant extends BlockBush {
|
||||
setBlockName("plant");
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setTickRandomly(true);
|
||||
setStepSound(Block.soundTypeGrass);
|
||||
}
|
||||
|
||||
public static boolean isWeed(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ModuleGardening implements IInitializable {
|
||||
if (fertilised) {
|
||||
insulate += 3;
|
||||
}
|
||||
new CircuitGarden(moist, null, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 0 + 128 * insulate), icon);
|
||||
new CircuitGarden(moist, null, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 128 * insulate), icon);
|
||||
new CircuitGarden(moist, EnumAcidity.ACID, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 1 + 128 * insulate), icon);
|
||||
new CircuitGarden(moist, EnumAcidity.NEUTRAL, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 2 + 128 * insulate), icon);
|
||||
new CircuitGarden(moist, EnumAcidity.ALKALINE, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 3 + 128 * insulate), icon);
|
||||
@@ -132,6 +132,13 @@ public class ModuleGardening implements IInitializable {
|
||||
}
|
||||
}
|
||||
|
||||
GameRegistry.addShapelessRecipe(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));
|
||||
GameRegistry.addShapelessRecipe(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));
|
||||
GameRegistry.addShapelessRecipe(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));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
Botany.trowelWood,
|
||||
new Object[]{
|
||||
@@ -193,6 +200,7 @@ public class ModuleGardening implements IInitializable {
|
||||
new ItemStack(Items.wheat_seeds),
|
||||
new ItemStack(Items.wheat_seeds)
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), Mods.forestry.stack("ash"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), Mods.forestry.stack("mulch"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), Mods.forestry.stack("fertilizerBio"));
|
||||
@@ -202,6 +210,7 @@ public class ModuleGardening implements IInitializable {
|
||||
BotanyItems.SulphurPowder.get(4),
|
||||
new Object[]{"dustSulphur"}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
new ItemStack(Botany.pigment, 2, EnumFlowerColor.BLACK.ordinal()),
|
||||
new Object[]{
|
||||
@@ -210,6 +219,7 @@ public class ModuleGardening implements IInitializable {
|
||||
"dyeBlack"
|
||||
}
|
||||
));
|
||||
|
||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
|
||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
|
||||
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "mulch")), 2);
|
||||
@@ -245,6 +255,7 @@ public class ModuleGardening implements IInitializable {
|
||||
'c', Items.clay_ball,
|
||||
'g', Blocks.gravel
|
||||
);
|
||||
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal());
|
||||
ItemStack pigment = new ItemStack(Botany.pigment, 1, c.ordinal());
|
||||
@@ -252,8 +263,14 @@ public class ModuleGardening implements IInitializable {
|
||||
GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(Botany.ceramic, c.ordinal()), 0.0f);
|
||||
ItemStack glass = TileEntityMetadata.getItemStack(Botany.stained, c.ordinal());
|
||||
glass.stackSize = 4;
|
||||
GameRegistry.addShapedRecipe(glass, " g ", "gpg", " g ", 'g', Blocks.glass, 'p', pigment);
|
||||
GameRegistry.addShapedRecipe(
|
||||
glass,
|
||||
" g ", "gpg", " g ",
|
||||
'g', Blocks.glass,
|
||||
'p', pigment
|
||||
);
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(new PigmentRecipe());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.genetics.item.ItemFieldKit;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.craftgui.minecraft.ModuleCraftGUI;
|
||||
@@ -24,6 +23,7 @@ import binnie.core.network.IPacketID;
|
||||
import binnie.core.proxy.BinnieProxy;
|
||||
import binnie.core.proxy.IBinnieProxy;
|
||||
import binnie.core.triggers.ModuleTrigger;
|
||||
import binnie.genetics.item.ItemFieldKit;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
|
||||
@@ -74,12 +74,8 @@ public class TileEntityMetadata extends TileEntity {
|
||||
}
|
||||
|
||||
public static ItemStack getItemStack(Block block, int damage) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setInteger("meta", damage);
|
||||
|
||||
ItemStack item = new ItemStack(block, 1, 0);
|
||||
item.setItemDamage((damage < 16387) ? damage : 16387);
|
||||
item.setTagCompound(tag);
|
||||
item.setItemDamage(Math.min(damage, 16387));
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ public class Widget implements IWidget {
|
||||
}
|
||||
|
||||
onUpdateClient();
|
||||
List<IWidget> deletedWidgets = new ArrayList<IWidget>();
|
||||
List<IWidget> deletedWidgets = new ArrayList<>();
|
||||
for (IWidget widget : getWidgets()) {
|
||||
if (widget.hasAttribute(WidgetAttribute.NEEDS_DELETION)) {
|
||||
deletedWidgets.add(widget);
|
||||
|
||||
@@ -213,6 +213,10 @@ public class WindowFieldKit extends Window {
|
||||
super.onWindowInventoryChanged();
|
||||
if (isServer()) {
|
||||
ItemStack kit = getPlayer().getHeldItem();
|
||||
if(kit == null || !kit.getItem().equals(BinnieCore.fieldKit)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int sheets = 64 - kit.getItemDamage();
|
||||
int size = (getWindowInventory().getStackInSlot(1) == null) ? 0 : getWindowInventory().getStackInSlot(1).stackSize;
|
||||
if (sheets != size) {
|
||||
@@ -274,7 +278,12 @@ public class WindowFieldKit extends Window {
|
||||
return;
|
||||
}
|
||||
|
||||
getWindowInventory().setInventorySlotContents(0, Analyser.analyse(getWindowInventory().getStackInSlot(0)));
|
||||
ItemStack stack = getWindowInventory().getStackInSlot(0);
|
||||
if (stack == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
getWindowInventory().setInventorySlotContents(0, Analyser.analyse(stack));
|
||||
getWindowInventory().decrStackSize(1, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ControlListBox<T> extends ControlScrollableContent<ControlList<T>>
|
||||
|
||||
@Override
|
||||
public void initialise() {
|
||||
setScrollableContent(new ControlList<T>(this, 1.0f, 1.0f, w() - 2.0f - scrollBarSize, h() - 2.0f));
|
||||
setScrollableContent(new ControlList<>(this, 1.0f, 1.0f, w() - 2.0f - scrollBarSize, h() - 2.0f));
|
||||
addEventHandler(new EventKey.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventKey.Down event) {
|
||||
|
||||
@@ -93,11 +93,8 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
|
||||
switch (discovered) {
|
||||
case SHOW:
|
||||
tooltip.add(species.getName());
|
||||
break;
|
||||
|
||||
case DISCOVERED:
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.discovered.discovered"));
|
||||
tooltip.add(species.getName());
|
||||
break;
|
||||
|
||||
case UNDISCOVERED:
|
||||
|
||||
@@ -31,11 +31,11 @@ public class PageBreeder extends ControlPage<DatabaseTab> {
|
||||
);
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.species.count", system.discoveredSpeciesCount, system.totalSpeciesCount));
|
||||
new ControlBreedingProgress(this, 20, 87, 102, 14, system, system.discoveredSpeciesPercentage);
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.branch.count", system.discoveredBranchCount, system.totalBranchCount));
|
||||
new ControlTextCentered(this, 115.0f, I18N.localise("binniecore.gui.database.branch.count", system.discoveredBranchCount, system.totalBranchCount));
|
||||
new ControlBreedingProgress(this, 20, 127, 102, 14, system, system.discoveredBranchPercentage);
|
||||
|
||||
if (system.discoveredSecretCount > 0) {
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.species.secretCount", system.discoveredSecretCount, system.totalSecretCount));
|
||||
new ControlTextCentered(this, 155.0f, I18N.localise("binniecore.gui.database.species.secretCount", system.discoveredSecretCount, system.totalSecretCount));
|
||||
}
|
||||
|
||||
new ControlTextCentered(this, 32.0f, player.getName());
|
||||
|
||||
@@ -119,7 +119,7 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
widgets.listBox.setValidator(new IValidator<IWidget>() {
|
||||
@Override
|
||||
public boolean isValid(IWidget object) {
|
||||
return event.getValue() == "" || ((ControlTextOption) object).getText().toLowerCase().contains(event.getValue().toLowerCase());
|
||||
return event.getValue().isEmpty() || ((ControlTextOption) object).getText().toLowerCase().contains(event.getValue().toLowerCase());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -393,9 +393,9 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
if (rotating) {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||
GL11.glClear(256);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class ListMap<T> implements List<T> {
|
||||
private LinkedHashMap<Integer, T> map;
|
||||
|
||||
ListMap() {
|
||||
map = new LinkedHashMap<Integer, T>();
|
||||
map = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -92,7 +92,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
|
||||
throw new RuntimeException("Parameter must have between one and four numbers");
|
||||
}
|
||||
|
||||
List<Float> f = new ArrayList<Float>();
|
||||
List<Float> f = new ArrayList<>();
|
||||
for (String string : split) {
|
||||
f.add(Float.parseFloat(string));
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
|
||||
if (split.length < 1 || split.length > 4) {
|
||||
throw new RuntimeException("Parameter must have between one and four numbers");
|
||||
}
|
||||
List<Float> f = new ArrayList<Float>();
|
||||
List<Float> f = new ArrayList<>();
|
||||
for (String string : split) {
|
||||
f.add(Float.parseFloat(string));
|
||||
}
|
||||
|
||||
@@ -207,10 +207,10 @@ public class ManagerGenetics extends ManagerBase {
|
||||
throw new NullPointerException("Allele is null!");
|
||||
}
|
||||
if (o1 instanceof IAlleleFloat && o2 instanceof IAlleleFloat) {
|
||||
return Float.valueOf(((IAlleleFloat) o1).getValue()).compareTo(Float.valueOf(((IAlleleFloat) o2).getValue()));
|
||||
return Float.valueOf(((IAlleleFloat) o1).getValue()).compareTo(((IAlleleFloat) o2).getValue());
|
||||
}
|
||||
if (o1 instanceof IAlleleInteger && o2 instanceof IAlleleInteger && !(o1 instanceof AlleleColor)) {
|
||||
return Integer.valueOf(((IAlleleInteger) o1).getValue()).compareTo(Integer.valueOf(((IAlleleInteger) o2).getValue()));
|
||||
return Integer.valueOf(((IAlleleInteger) o1).getValue()).compareTo(((IAlleleInteger) o2).getValue());
|
||||
}
|
||||
if (o1.getName() != null && o2.getName() != null) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
|
||||
@@ -226,7 +226,7 @@ public class TreeBreedingSystem extends BreedingSystem {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Collection<IAlleleSpecies> set = nei ? getAllSpecies() : getDiscoveredSpecies(world, player);
|
||||
List<IAlleleSpecies> found = new ArrayList<IAlleleSpecies>();
|
||||
List<IAlleleSpecies> found = new ArrayList<>();
|
||||
for (IAlleleSpecies species : set) {
|
||||
IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies) species;
|
||||
ITreeGenome genome = TreeManager.treeRoot.templateAsGenome(TreeManager.treeRoot.getTemplate(tSpecies.getUID()));
|
||||
|
||||
@@ -3,11 +3,11 @@ package binnie.core.item;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.botany.flower.TileEntityFlower;
|
||||
import binnie.genetics.item.ItemFieldKit;
|
||||
import binnie.botany.network.PacketID;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.network.packet.MessageNBT;
|
||||
import binnie.genetics.item.ItemFieldKit;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -24,13 +24,16 @@ public class MachineComponent implements INBTTagable {
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public void onUpdate() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public Class[] getComponentInterfaces() {
|
||||
@@ -38,6 +41,7 @@ public class MachineComponent implements INBTTagable {
|
||||
}
|
||||
|
||||
public void onInventoryUpdate() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public MachinePayload getPayload() {
|
||||
|
||||
@@ -164,9 +164,9 @@ public class MachineUtil {
|
||||
return machine.getInterface(IProcess.class);
|
||||
}
|
||||
|
||||
public List<ItemStack> getNonNullStacks(int[] slotAcclimatiser) {
|
||||
List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
for (ItemStack stack : getStacks(slotAcclimatiser)) {
|
||||
public List<ItemStack> getNonNullStacks(int[] slot) {
|
||||
List<ItemStack> stacks = new ArrayList<>();
|
||||
for (ItemStack stack : getStacks(slot)) {
|
||||
if (stack != null) {
|
||||
stacks.add(stack);
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ public class ManagerMachine extends ManagerBase {
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Class<?>> interfaces = new HashSet<Class<?>>();
|
||||
for (Class<?> currentClass = component; currentClass != null; currentClass = null) {
|
||||
Set<Class<?>> interfaces = new HashSet<>();
|
||||
for (Class<?> currentClass = component; currentClass != null; currentClass = currentClass.getSuperclass()) {
|
||||
Collections.addAll(interfaces, currentClass.getInterfaces());
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class SidedAccess {
|
||||
}
|
||||
|
||||
public AccessDirection getAccess(ForgeDirection side) {
|
||||
return accesses.containsKey(side) ? accesses.get(side) : base;
|
||||
return accesses.getOrDefault(side, base);
|
||||
}
|
||||
|
||||
public boolean canInsert(ForgeDirection side) {
|
||||
|
||||
@@ -25,10 +25,10 @@ public abstract class ComponentProcessIndefinate extends MachineComponent implem
|
||||
|
||||
public ComponentProcessIndefinate(IMachine machine, float energyPerTick) {
|
||||
super(machine);
|
||||
this.energyPerTick = energyPerTick;
|
||||
actionPauseProcess = 0.0f;
|
||||
actionCancelTask = 0.0f;
|
||||
clientEnergyPerSecond = 0;
|
||||
this.energyPerTick = energyPerTick;
|
||||
}
|
||||
|
||||
protected IPoweredMachine getPower() {
|
||||
@@ -52,6 +52,7 @@ public abstract class ComponentProcessIndefinate extends MachineComponent implem
|
||||
} else if (isInProgress()) {
|
||||
onCancelTask();
|
||||
}
|
||||
|
||||
if (actionPauseProcess > 0.0f) {
|
||||
actionPauseProcess--;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -142,7 +141,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
@Override
|
||||
public void onEvent(EventValueChanged event) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
int i = ((Integer) event.getValue()).intValue();
|
||||
int i = (Integer) event.getValue();
|
||||
nbt.setByte("i", (byte) i);
|
||||
Window.get(tab).sendClientAction("tab-change", nbt);
|
||||
currentTab = i;
|
||||
@@ -150,10 +149,10 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
}.setOrigin(EventHandler.Origin.DirectChild, tab));
|
||||
x += 24;
|
||||
|
||||
ControlPages<Integer> compartmentPages = new ControlPages<Integer>(controlCompartment, 24.0f, 0.0f, compartmentPageWidth, compartmentPageHeight);
|
||||
ControlPages<Integer> compartmentPages = new ControlPages<>(controlCompartment, 24.0f, 0.0f, compartmentPageWidth, compartmentPageHeight);
|
||||
ControlPage[] page = new ControlPage[inv.getTabNumber()];
|
||||
for (int p = 0; p < inv.getTabNumber(); ++p) {
|
||||
page[p] = new ControlPage(compartmentPages, Integer.valueOf(p));
|
||||
page[p] = new ControlPage(compartmentPages, p);
|
||||
}
|
||||
CraftGUIUtil.linkWidgets(tab, compartmentPages);
|
||||
int i = 0;
|
||||
@@ -210,7 +209,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
@Override
|
||||
public void onEvent(EventValueChanged event) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
int i = ((Integer) event.getValue()).intValue();
|
||||
int i = (Integer) event.getValue();
|
||||
nbt.setByte("i", (byte) i);
|
||||
Window.get(tab).sendClientAction("tab-change", nbt);
|
||||
currentTab = i;
|
||||
@@ -374,7 +373,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
|
||||
if (sortByName) {
|
||||
List<Entry<Integer, String>> list = new LinkedList(slotIds.entrySet());
|
||||
Collections.sort(list, new Comparator<Entry<Integer, String>>() {
|
||||
list.sort(new Comparator<Entry<Integer, String>>() {
|
||||
@Override
|
||||
public int compare(Entry<Integer, String> o1, Entry<Integer, String> o2) {
|
||||
return -o2.getValue().compareTo(o1.getValue());
|
||||
|
||||
@@ -32,30 +32,32 @@ public enum BinnieCorePacketID implements IPacketID {
|
||||
((INetworkedEntity) tile).readFromPacket(packet.payload);
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.TileMetadata) {
|
||||
MessageMetadata packet2 = new MessageMetadata(message);
|
||||
TileEntity tile = packet2.getTileEntity(BinnieCore.proxy.getWorld());
|
||||
MessageMetadata packet = new MessageMetadata(message);
|
||||
TileEntity tile = packet.getTileEntity(BinnieCore.proxy.getWorld());
|
||||
if (tile instanceof TileEntityMetadata) {
|
||||
((TileEntityMetadata) tile).setTileMetadata(packet2.meta, true);
|
||||
((TileEntityMetadata) tile).setTileMetadata(packet.meta, true);
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.CraftGUIAction && context.side == Side.CLIENT) {
|
||||
MessageCraftGUI packet3 = new MessageCraftGUI(message);
|
||||
EntityPlayer player = BinnieCore.proxy.getPlayer();
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet3.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.CLIENT, player, packet3.getTagCompound());
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.CraftGUIAction && context.side == Side.SERVER && context.netHandler instanceof NetHandlerPlayServer) {
|
||||
MessageCraftGUI packet3 = new MessageCraftGUI(message);
|
||||
EntityPlayer player = ((NetHandlerPlayServer) context.netHandler).playerEntity;
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet3.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.SERVER, player, packet3.getTagCompound());
|
||||
} else if (this == BinnieCorePacketID.CraftGUIAction) {
|
||||
if (context.side == Side.CLIENT) {
|
||||
MessageCraftGUI packet = new MessageCraftGUI(message);
|
||||
EntityPlayer player = BinnieCore.proxy.getPlayer();
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.CLIENT, player, packet.getTagCompound());
|
||||
}
|
||||
} else if (context.netHandler instanceof NetHandlerPlayServer) {
|
||||
MessageCraftGUI packet = new MessageCraftGUI(message);
|
||||
EntityPlayer player = ((NetHandlerPlayServer) context.netHandler).playerEntity;
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.SERVER, player, packet.getTagCompound());
|
||||
}
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.TileDescriptionSync && context.side == Side.CLIENT) {
|
||||
MessageTileNBT packet4 = new MessageTileNBT(message);
|
||||
TileEntity tile = packet4.getTarget(BinnieCore.proxy.getWorld());
|
||||
if (tile != null && packet4.getTagCompound() != null) {
|
||||
MessageTileNBT packet = new MessageTileNBT(message);
|
||||
TileEntity tile = packet.getTarget(BinnieCore.proxy.getWorld());
|
||||
if (tile != null && packet.getTagCompound() != null) {
|
||||
IMachine machine = Machine.getMachine(tile);
|
||||
if (machine != null && machine instanceof INetwork.TilePacketSync) {
|
||||
((INetwork.TilePacketSync) machine).syncFromNBT(packet4.getTagCompound());
|
||||
((INetwork.TilePacketSync) machine).syncFromNBT(packet.getTagCompound());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,11 +69,6 @@ public class ComponentBeeModifier extends MachineComponent implements IBeeModifi
|
||||
// ignored
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public void onPostQueenDeath(IBee queen) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public boolean onEggLaid(IBee queen) {
|
||||
return false;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return frame.getName();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements
|
||||
public void onMachineBroken() {
|
||||
min = null;
|
||||
max = null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,13 +92,11 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements
|
||||
@Override
|
||||
public void updateClient(int arg0) {
|
||||
super.updateEntity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateServer(int arg0) {
|
||||
super.updateEntity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,6 @@ public class FrameSlotValidator extends SlotValidator {
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise("extrabees.achine.alveay.frame.tooltip");
|
||||
return I18N.localise("extrabees.machine.alveay.frame.tooltip");
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package binnie.extrabees.apiary.machine.mutator;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
@@ -23,7 +22,7 @@ public class MutatorModifierComponent extends ComponentBeeModifier implements IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostQueenDeath(IBee queen) {
|
||||
public void onQueenDeath() {
|
||||
getUtil().decreaseStack(AlvearyMutator.SLOT_MUTATOR, 1);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class TransmissionModifierComponent extends ComponentBeeModifier implemen
|
||||
}
|
||||
|
||||
TileExtraBeeAlveary tile = (TileExtraBeeAlveary) getMachine().getTileEntity();
|
||||
List<IEnergyHandler> handlers = new ArrayList<IEnergyHandler>();
|
||||
List<IEnergyHandler> handlers = new ArrayList<>();
|
||||
for (TileEntity alvearyTile : tile.getAlvearyBlocks()) {
|
||||
if (alvearyTile instanceof IEnergyHandler && alvearyTile != tile) {
|
||||
handlers.add((IEnergyHandler) alvearyTile);
|
||||
|
||||
@@ -71,7 +71,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extrabees.flowers." + name().toString().toLowerCase() + ".name");
|
||||
return I18N.localise("extrabees.flowers." + name().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
public void register() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extrabees.genetics.requirements;
|
||||
|
||||
import forestry.api.core.IClimateProvider;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IMutationCondition;
|
||||
@@ -13,7 +14,7 @@ public class DummyMutationCondition implements IMutationCondition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.Mods;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class ModuleProducts implements IInitializable {
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
public class HiveDrop implements IHiveDrop {
|
||||
private IAllele[] template;
|
||||
@@ -27,9 +28,7 @@ public class HiveDrop implements IHiveDrop {
|
||||
}
|
||||
this.template = template;
|
||||
this.chance = chance;
|
||||
for (ItemStack stack : bonus) {
|
||||
additional.add(stack);
|
||||
}
|
||||
Collections.addAll(additional, bonus);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,7 +47,7 @@ public class HiveDrop implements IHiveDrop {
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getAdditional(World world, int x, int y, int z, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
for (ItemStack stack : additional) {
|
||||
ret.add(stack.copy());
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ public class ExtraTrees extends AbstractMod {
|
||||
public static Block blockLog;
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
public static Block blockPlanks;
|
||||
public static Block blockShrubLeaves;
|
||||
public static Block blockMachine;
|
||||
public static Block blockFence;
|
||||
public static BlockCarpentry blockPanel;
|
||||
public static Block blockKitchen;
|
||||
public static Block blockSlab;
|
||||
public static Block blockDoubleSlab;
|
||||
public static Item itemHammer;
|
||||
|
||||
@@ -128,7 +128,11 @@ public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise("extratrees.block.log.name", ILogType.ExtraTreeLog.values()[meta].getName());
|
||||
ILogType.ExtraTreeLog[] logs= ILogType.ExtraTreeLog.values();
|
||||
if(meta < 0 || meta >= logs.length) {
|
||||
meta = 0;
|
||||
}
|
||||
return I18N.localise("extratrees.block.log.name", logs[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import forestry.arboriculture.blocks.BlockForestryLeaves;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockShrubLeaves extends BlockForestryLeaves {
|
||||
public BlockShrubLeaves() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginLeavesDecay(World world, int x, int y, int z) {
|
||||
// ignored, no able decay
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.arboriculture.worldgen.BlockTypeLog;
|
||||
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.arboriculture.worldgen.BlockTypeLog;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface ILogType {
|
||||
void placeBlock(World p0, int p1, int p2, int p3);
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.world.World;
|
||||
public class ItemETDoor extends ItemMetadata {
|
||||
public ItemETDoor(Block block) {
|
||||
super(block);
|
||||
maxStackSize = 1;
|
||||
maxStackSize = 8;
|
||||
setCreativeTab(CreativeTabs.tabRedstone);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,14 @@ public class ModuleBlocks implements IInitializable {
|
||||
ExtraTrees.blockPlanks = new BlockETPlanks();
|
||||
ExtraTrees.blockFence = new BlockFence();
|
||||
ExtraTrees.blockLog = new BlockETLog();
|
||||
ExtraTrees.blockShrubLeaves = new BlockShrubLeaves();
|
||||
ExtraTrees.blockGate = new BlockGate();
|
||||
ExtraTrees.blockDoor = new BlockETDoor();
|
||||
ExtraTrees.blockMultiFence = new BlockMultiFence();
|
||||
ExtraTrees.blockSlab = new BlockETSlab(false);
|
||||
ExtraTrees.blockDoubleSlab = new BlockETSlab(true);
|
||||
ExtraTrees.blockStairs = new BlockETStairs(ExtraTrees.blockPlanks);
|
||||
|
||||
GameRegistry.registerBlock(ExtraTrees.blockPlanks, ItemMetadata.class, "planks");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockFence, ItemMetadata.class, "fence");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockMultiFence, ItemMetadata.class, "multifence");
|
||||
@@ -56,6 +58,7 @@ public class ModuleBlocks implements IInitializable {
|
||||
GameRegistry.registerBlock(ExtraTrees.blockDoubleSlab, ItemETSlab.class, "doubleSlab");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockDoor, ItemETDoor.class, "door");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockStairs, ItemETStairs.class, "stairs");
|
||||
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
|
||||
for (ILogType plank : ILogType.ExtraTreeLog.values()) {
|
||||
|
||||
@@ -31,41 +31,41 @@ public class PlankType {
|
||||
}
|
||||
|
||||
public enum ExtraTreePlanks implements IPlankType, IFenceProvider {
|
||||
Fir(12815444),
|
||||
Cedar(14181940),
|
||||
Hemlock(13088108),
|
||||
Cypress(16169052),
|
||||
Fig(13142058),
|
||||
Beech(14784849),
|
||||
Alder(12092755),
|
||||
Hazel(13480341),
|
||||
Hornbeam(12818528),
|
||||
Box(16511430),
|
||||
Butternut(15510138),
|
||||
Hickory(14333070),
|
||||
Whitebeam(13222585),
|
||||
Elm(15772004),
|
||||
Apple(6305064),
|
||||
Yew(14722426),
|
||||
Pear(12093805),
|
||||
Hawthorn(13402978),
|
||||
Rowan(13610394),
|
||||
Elder(12489337),
|
||||
Maclura(15970862),
|
||||
Syzgium(15123393),
|
||||
Brazilwood(7487063),
|
||||
Logwood(10762028),
|
||||
Iroko(7681024),
|
||||
Locust(12816736),
|
||||
Eucalyptus(16165771),
|
||||
Purpleheart(5970991),
|
||||
Ash(16107368),
|
||||
Holly(16512743),
|
||||
Olive(11578760),
|
||||
Sweetgum(13997656),
|
||||
Rosewood(7738624),
|
||||
Gingko(16050106),
|
||||
PinkIvory(15502496);
|
||||
Fir(0xc38c54),
|
||||
Cedar(0xd86634),
|
||||
Hemlock(0xc7b56c),
|
||||
Cypress(0xf6b85c),
|
||||
Fig(0xc8882a),
|
||||
Beech(0xe19951),
|
||||
Alder(0xb88553),
|
||||
Hazel(0xcdb195),
|
||||
Hornbeam(0xc39860),
|
||||
Box(0xfbf1c6),
|
||||
Butternut(0xecaa7a),
|
||||
Hickory(0xdab48e),
|
||||
Whitebeam(0xc9c2b9),
|
||||
Elm(0xf0a964),
|
||||
Apple(0x603528),
|
||||
Yew(0xe0a57a),
|
||||
Pear(0xb8896d),
|
||||
Hawthorn(0xcc8362),
|
||||
Rowan(0xcfad9a),
|
||||
Elder(0xbe9279),
|
||||
Maclura(0xf3b22e),
|
||||
Syzgium(0xe6c3c1),
|
||||
Brazilwood(0x723e57),
|
||||
Logwood(0xa4372c),
|
||||
Iroko(0x753400),
|
||||
Locust(0xc39160),
|
||||
Eucalyptus(0xf6ab8b),
|
||||
Purpleheart(0x5b1c2f),
|
||||
Ash(0xf5c768),
|
||||
Holly(0xfbf6e7),
|
||||
Olive(0xb0ad88),
|
||||
Sweetgum(0xd59658),
|
||||
Rosewood(0x761500),
|
||||
Gingko(0xf4e7ba),
|
||||
PinkIvory(0xec8ca0);
|
||||
|
||||
protected int color;
|
||||
protected IIcon icon;
|
||||
@@ -109,7 +109,7 @@ public class PlankType {
|
||||
}
|
||||
}
|
||||
|
||||
public enum VanillaPlanks implements IPlankType {
|
||||
public enum VanillaPlanks implements IPlankType, IFenceProvider {
|
||||
OAK(0xb4905a),
|
||||
SPRUCE(0x805e36),
|
||||
BIRCH(0xd7c185),
|
||||
@@ -149,6 +149,11 @@ public class PlankType {
|
||||
Block block = Blocks.planks;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
|
||||
}
|
||||
}
|
||||
|
||||
public enum ForestryPlanks implements IPlankType, IFenceProvider {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
@@ -19,7 +18,6 @@ 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.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -41,20 +39,17 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
setStepSound(Block.soundTypeWood);
|
||||
}
|
||||
|
||||
public static boolean canConnect(Block block) {
|
||||
return block == ((ItemBlock) Mods.forestry.item("fences")).field_150939_a
|
||||
|| block == Blocks.fence
|
||||
|| block == Blocks.fence_gate
|
||||
|| block == Blocks.nether_brick_fence
|
||||
|| block instanceof IBlockFence
|
||||
|| block == ExtraTrees.blockGate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
|
||||
for (IFenceProvider type : PlankType.VanillaPlanks.values()) {
|
||||
if (type != PlankType.VanillaPlanks.OAK) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,16 +135,10 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
|
||||
@Override
|
||||
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
|
||||
if (!isFence(world, x, y, z)) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block != null && block.getMaterial().isOpaque() && block.renderAsNormalBlock();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isFence(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return canConnect(block);
|
||||
Material material = block.getMaterial();
|
||||
return IBlockFence.isFence(block) && material == this.blockMaterial
|
||||
|| material.isOpaque() && block.renderAsNormalBlock() && material != Material.gourd;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -185,6 +174,13 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@@ -137,6 +137,13 @@ public class BlockGate extends BlockFenceGate implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
@@ -29,10 +29,6 @@ public class BlockHedge extends Block implements IBlockFence {
|
||||
setBlockName("hedge");
|
||||
}
|
||||
|
||||
public static boolean func_149825_a(Block block) {
|
||||
return BlockFence.canConnect(block);
|
||||
}
|
||||
|
||||
public static int getColor(int meta) {
|
||||
LeafType type = LeafType.values()[meta % 6];
|
||||
if (type == LeafType.CONIFER) {
|
||||
@@ -130,11 +126,11 @@ public class BlockHedge extends Block implements IBlockFence {
|
||||
return ModuleBlocks.hedgeRenderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block == this
|
||||
|| block == Blocks.fence_gate
|
||||
|| func_149825_a(block)
|
||||
|| IBlockFence.isFence(block)
|
||||
|| block.isLeaves(world, x, y, z)
|
||||
|| (block.getMaterial().isOpaque() && block.renderAsNormalBlock() && block.getMaterial() != Material.gourd);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class FenceType {
|
||||
}
|
||||
|
||||
public static Collection<FenceType> values() {
|
||||
List<FenceType> list = new ArrayList<FenceType>();
|
||||
List<FenceType> list = new ArrayList<>();
|
||||
for (int size = 0; size < 3; ++size) {
|
||||
for (boolean solid : new boolean[]{false, true}) {
|
||||
for (boolean embedded : new boolean[]{false, true}) {
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public interface IBlockFence {
|
||||
|
||||
/**
|
||||
* Test if the specified block is a fence
|
||||
*
|
||||
* @param block the block to test
|
||||
* @return {@code true} if the specified block is a fence
|
||||
*/
|
||||
static boolean isFence(Block block) {
|
||||
return block == ((ItemBlock) Mods.forestry.item("fences")).field_150939_a
|
||||
|| block instanceof BlockFence && block != Blocks.nether_brick_fence
|
||||
|| block instanceof BlockFenceGate;
|
||||
}
|
||||
|
||||
boolean canConnectFenceTo(IBlockAccess world, int x, int y, int z);
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class MultiFenceRecipeSize implements IRecipe {
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
StringBuilder pattern = new StringBuilder();
|
||||
List<IPlankType> types = new ArrayList<IPlankType>();
|
||||
List<IPlankType> types = new ArrayList<>();
|
||||
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
IPlankType type = (stack == null) ? null : WoodManager.get(stack);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class NBTShapedRecipe implements IRecipe {
|
||||
for (int i2 = 0; i2 < j * k; ++i2) {
|
||||
char c0 = s.charAt(i2);
|
||||
if (hashmap.containsKey(c0)) {
|
||||
aitemstack[i2] = ((ItemStack) hashmap.get(Character.valueOf(c0))).copy();
|
||||
aitemstack[i2] = ((ItemStack) hashmap.get(c0)).copy();
|
||||
} else {
|
||||
aitemstack[i2] = null;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(
|
||||
"extratrees.block.tooltip.twoColors",
|
||||
"extratrees.block.tooltip.twoMaterials",
|
||||
block.getPrimaryMaterial().getName(),
|
||||
block.getSecondaryMaterial().getName()
|
||||
));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.extratrees.carpentry;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -11,6 +12,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockStainedDesign extends BlockDesign {
|
||||
@@ -60,4 +62,18 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise("extratrees.block.stainedglass.name", design.getDesign().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(
|
||||
"extratrees.block.tooltip.twoColors",
|
||||
block.getPrimaryMaterial().getName(),
|
||||
block.getSecondaryMaterial().getName()
|
||||
));
|
||||
} else {
|
||||
tooltip.add(block.getPrimaryMaterial().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class CarpentryInterface implements ICarpentryInterface {
|
||||
|
||||
@Override
|
||||
public Collection<IDesignCategory> getAllDesignCategories() {
|
||||
List<IDesignCategory> categories = new ArrayList<IDesignCategory>();
|
||||
List<IDesignCategory> categories = new ArrayList<>();
|
||||
for (IDesignCategory category : CarpentryInterface.designCategories.values()) {
|
||||
if (category.getDesigns().size() > 0) {
|
||||
categories.add(category);
|
||||
@@ -92,7 +92,7 @@ public class CarpentryInterface implements ICarpentryInterface {
|
||||
|
||||
@Override
|
||||
public List<IDesign> getSortedDesigns() {
|
||||
List<IDesign> designs = new ArrayList<IDesign>();
|
||||
List<IDesign> designs = new ArrayList<>();
|
||||
for (IDesignCategory category : getAllDesignCategories()) {
|
||||
designs.addAll(category.getDesigns());
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.FakeWorld;
|
||||
import binnie.extratrees.craftgui.ControlBlockIconDisplay;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
@@ -117,7 +116,7 @@ public class PageSpeciesTreeGenome extends PageSpecies {
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
List<ItemStack> fruits = new ArrayList<ItemStack>();
|
||||
List<ItemStack> fruits = new ArrayList<>();
|
||||
Collections.addAll(fruits, genome.getFruitProvider().getProducts());
|
||||
|
||||
if (!fruits.isEmpty()) {
|
||||
|
||||
@@ -213,7 +213,7 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
if (itemstack.getItem() == Mods.forestry.item("honeydew")) {
|
||||
return 0.7f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.forestry.item("beeComb")) {
|
||||
if (itemstack.getItem() == Mods.forestry.item("beeCombs")) {
|
||||
return 0.4f;
|
||||
}
|
||||
if (AlleleManager.alleleRegistry.isIndividual(itemstack)) {
|
||||
|
||||
@@ -313,7 +313,7 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return I18N.localise("extratrees.item.food." + name().toLowerCase());
|
||||
return "extratrees.item.food." + name().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -375,7 +375,7 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
|
||||
float modeYieldMod = 1.0f;
|
||||
for (Map.Entry<ItemStack, Float> entry2 : products.entrySet()) {
|
||||
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * entry2.getValue() * 5.0f * stage) {
|
||||
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * entry2.getValue() * stage) {
|
||||
product2.add(entry2.getKey().copy());
|
||||
}
|
||||
}
|
||||
@@ -418,7 +418,7 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getDescription();
|
||||
return I18N.localise("for." + getDescription());
|
||||
}
|
||||
|
||||
public String getNameOfFruit() {
|
||||
|
||||
@@ -6,28 +6,64 @@ import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.ILogType;
|
||||
import binnie.extratrees.worldgen.DefaultTreeGenerator;
|
||||
import binnie.extratrees.worldgen.WorldGenAlder;
|
||||
import binnie.extratrees.worldgen.WorldGenApple;
|
||||
import binnie.extratrees.worldgen.WorldGenAsh;
|
||||
import binnie.extratrees.worldgen.WorldGenAcornOak;
|
||||
import binnie.extratrees.worldgen.WorldGenAspen;
|
||||
import binnie.extratrees.worldgen.WorldGenBalsamFir;
|
||||
import binnie.extratrees.worldgen.WorldGenBanana;
|
||||
import binnie.extratrees.worldgen.WorldGenBeech;
|
||||
import binnie.extratrees.worldgen.WorldGenConifer;
|
||||
import binnie.extratrees.worldgen.WorldGenBox;
|
||||
import binnie.extratrees.worldgen.WorldGenBrazilNut;
|
||||
import binnie.extratrees.worldgen.WorldGenBrazilwood;
|
||||
import binnie.extratrees.worldgen.WorldGenButternut;
|
||||
import binnie.extratrees.worldgen.WorldGenCedar;
|
||||
import binnie.extratrees.worldgen.WorldGenClove;
|
||||
import binnie.extratrees.worldgen.WorldGenCoconut;
|
||||
import binnie.extratrees.worldgen.WorldGenCoffee;
|
||||
import binnie.extratrees.worldgen.WorldGenCommonAlder;
|
||||
import binnie.extratrees.worldgen.WorldGenCommonAsh;
|
||||
import binnie.extratrees.worldgen.WorldGenCommonBeech;
|
||||
import binnie.extratrees.worldgen.WorldGenCopperBeech;
|
||||
import binnie.extratrees.worldgen.WorldGenCypress;
|
||||
import binnie.extratrees.worldgen.WorldGenDefault;
|
||||
import binnie.extratrees.worldgen.WorldGenEucalyptus;
|
||||
import binnie.extratrees.worldgen.WorldGenFir;
|
||||
import binnie.extratrees.worldgen.WorldGenDouglasFir;
|
||||
import binnie.extratrees.worldgen.WorldGenElder;
|
||||
import binnie.extratrees.worldgen.WorldGenElm;
|
||||
import binnie.extratrees.worldgen.WorldGenFloweringCrabapple;
|
||||
import binnie.extratrees.worldgen.WorldGenGingko;
|
||||
import binnie.extratrees.worldgen.WorldGenHawthorn;
|
||||
import binnie.extratrees.worldgen.WorldGenHazel;
|
||||
import binnie.extratrees.worldgen.WorldGenHolly;
|
||||
import binnie.extratrees.worldgen.WorldGenJungle;
|
||||
import binnie.extratrees.worldgen.WorldGenHornbeam;
|
||||
import binnie.extratrees.worldgen.WorldGenIroko;
|
||||
import binnie.extratrees.worldgen.WorldGenLazy;
|
||||
import binnie.extratrees.worldgen.WorldGenMaple;
|
||||
import binnie.extratrees.worldgen.WorldGenPalm;
|
||||
import binnie.extratrees.worldgen.WorldGenPoplar;
|
||||
import binnie.extratrees.worldgen.WorldGenLoblollyPine;
|
||||
import binnie.extratrees.worldgen.WorldGenLocust;
|
||||
import binnie.extratrees.worldgen.WorldGenLogwood;
|
||||
import binnie.extratrees.worldgen.WorldGenMango;
|
||||
import binnie.extratrees.worldgen.WorldGenMonkeyPuzzle;
|
||||
import binnie.extratrees.worldgen.WorldGenOldFustic;
|
||||
import binnie.extratrees.worldgen.WorldGenOlive;
|
||||
import binnie.extratrees.worldgen.WorldGenOrchardApple;
|
||||
import binnie.extratrees.worldgen.WorldGenOsangeOsange;
|
||||
import binnie.extratrees.worldgen.WorldGenPear;
|
||||
import binnie.extratrees.worldgen.WorldGenPecan;
|
||||
import binnie.extratrees.worldgen.WorldGenPrairieCrabapple;
|
||||
import binnie.extratrees.worldgen.WorldGenPurpleheart;
|
||||
import binnie.extratrees.worldgen.WorldGenRainbowGum;
|
||||
import binnie.extratrees.worldgen.WorldGenRedMaple;
|
||||
import binnie.extratrees.worldgen.WorldGenRoseGum;
|
||||
import binnie.extratrees.worldgen.WorldGenRosewood;
|
||||
import binnie.extratrees.worldgen.WorldGenRowan;
|
||||
import binnie.extratrees.worldgen.WorldGenSallow;
|
||||
import binnie.extratrees.worldgen.WorldGenShrub;
|
||||
import binnie.extratrees.worldgen.WorldGenSorbus;
|
||||
import binnie.extratrees.worldgen.WorldGenSilverFir;
|
||||
import binnie.extratrees.worldgen.WorldGenSwampGum;
|
||||
import binnie.extratrees.worldgen.WorldGenSweetCrabapple;
|
||||
import binnie.extratrees.worldgen.WorldGenSweetgum;
|
||||
import binnie.extratrees.worldgen.WorldGenSycamore;
|
||||
import binnie.extratrees.worldgen.WorldGenTree;
|
||||
import binnie.extratrees.worldgen.WorldGenTree2;
|
||||
import binnie.extratrees.worldgen.WorldGenTree3;
|
||||
import binnie.extratrees.worldgen.WorldGenTropical;
|
||||
import binnie.extratrees.worldgen.WorldGenWalnut;
|
||||
import binnie.extratrees.worldgen.WorldGenWesternHemlock;
|
||||
import binnie.extratrees.worldgen.WorldGenWhitebeam;
|
||||
import binnie.extratrees.worldgen.WorldGenYew;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -71,10 +107,10 @@ import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGermlingIconProvider {
|
||||
OrchardApple("malus", "domestica", 0x648830, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Apple, WorldGenApple.OrchardApple.class),
|
||||
SweetCrabapple("malus", "coronaria", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.SweetCrabapple.class),
|
||||
FloweringCrabapple("malus", "hopa", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.FloweringCrabapple.class),
|
||||
PrairieCrabapple("malus", "ioensis", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.PrairieCrabapple.class),
|
||||
OrchardApple("malus", "domestica", 0x648830, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Apple, WorldGenOrchardApple.class),
|
||||
SweetCrabapple("malus", "coronaria", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenSweetCrabapple.class),
|
||||
FloweringCrabapple("malus", "hopa", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenFloweringCrabapple.class),
|
||||
PrairieCrabapple("malus", "ioensis", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenPrairieCrabapple.class),
|
||||
Blackthorn("prunus", "spinosa ", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.Blackthorn),
|
||||
CherryPlum("prunus", "cerasifera", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.CherryPlum),
|
||||
Peach("prunus", "persica", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.Peach),
|
||||
@@ -99,75 +135,75 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
Banana("musa", "sinensis", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.Banana, WorldGenBanana.class),
|
||||
RedBanana("musa", "rubra", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.RedBanana, WorldGenBanana.class),
|
||||
Plantain("musa", "paradisiaca", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.Plantain, WorldGenBanana.class),
|
||||
Butternut("juglans", "cinerea", 0x82b58c, ILogType.ExtraTreeLog.Butternut, ExtraTreeFruitGene.Butternut, WorldGenWalnut.Butternut.class),
|
||||
Rowan("sorbus", "aucuparia", 0x9ec79b, ILogType.ExtraTreeLog.Rowan, null, WorldGenSorbus.Rowan.class),
|
||||
Hemlock("tsuga", "heterophylla", 0x5cac72, ILogType.ExtraTreeLog.Hemlock, null, WorldGenConifer.WesternHemlock.class),
|
||||
Ash("fraxinus", "excelsior", 0x488e2b, ILogType.ExtraTreeLog.Ash, null, WorldGenAsh.CommonAsh.class),
|
||||
Alder("alnus", "glutinosa", 0x698a33, ILogType.ExtraTreeLog.Alder, null, WorldGenAlder.CommonAlder.class),
|
||||
Beech("fagus", "sylvatica", 0x83a04c, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenBeech.CommonBeech.class),
|
||||
CopperBeech("fagus", "purpurea", 0x801318, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenBeech.CopperBeech.class),
|
||||
Aspen("populus", "tremula", 0x8acc37, ILogType.ForestryLog.POPLAR, null, WorldGenPoplar.Aspen.class),
|
||||
Yew("taxus", "baccata", 0x948a4d, ILogType.ExtraTreeLog.Yew, null, WorldGenConifer.Yew.class),
|
||||
Cypress("chamaecyparis", "lawsoniana", 0x89c9a7, ILogType.ExtraTreeLog.Cypress, null, WorldGenConifer.Cypress.class),
|
||||
DouglasFir("pseudotsuga", "menziesii", 0x99b582, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.DouglasFir.class),
|
||||
Hazel("Corylus", "avellana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenTree3.Hazel.class),
|
||||
Sycamore("ficus", "sycomorus", 0xa0a52f, ILogType.ExtraTreeLog.Fig, ExtraTreeFruitGene.Fig, WorldGenTree3.Sycamore.class),
|
||||
Whitebeam("sorbus", "aria", 0xbace99, ILogType.ExtraTreeLog.Whitebeam, null, WorldGenSorbus.Whitebeam.class),
|
||||
Hawthorn("crataegus", "monogyna", 0x6ba84a, ILogType.ExtraTreeLog.Hawthorn, null, WorldGenTree3.Hawthorn.class),
|
||||
Pecan("carya", "illinoinensis", 0x85b674, ILogType.ExtraTreeLog.Hickory, ExtraTreeFruitGene.Pecan, WorldGenTree3.Pecan.class),
|
||||
Elm("ulmus", "procera", 0x7c9048, ILogType.ExtraTreeLog.Elm, null, WorldGenTree3.Elm.class),
|
||||
Elder("sambucus", "nigra", 0xaeb873, ILogType.ExtraTreeLog.Elder, ExtraTreeFruitGene.Elderberry, WorldGenTree3.Elder.class),
|
||||
Holly("ilex", "aquifolium", 0x254b4c, ILogType.ExtraTreeLog.Holly, null, WorldGenHolly.Holly.class),
|
||||
Hornbeam("carpinus", "betulus", 0x96a71b, ILogType.ExtraTreeLog.Hornbeam, null, WorldGenTree3.Hornbeam.class),
|
||||
Sallow("salix", "caprea", 0xaeb323, ILogType.ForestryLog.WILLOW, null, WorldGenTree3.Sallow.class),
|
||||
AcornOak("quercus", "robur", 0x66733e, ILogType.VanillaLog.Oak, ExtraTreeFruitGene.Acorn, WorldGenTree3.AcornOak.class),
|
||||
Fir("abies", "alba", 0x6f7c20, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.SilverFir.class),
|
||||
Cedar("cedrus", "libani", 0x95a370, ILogType.ExtraTreeLog.Cedar, null, WorldGenConifer.Cedar.class),
|
||||
Olive("olea", "europaea", 0x3c4834, ILogType.ExtraTreeLog.Olive, ExtraTreeFruitGene.Olive, WorldGenTree2.Olive.class),
|
||||
RedMaple("acer", "ubrum", 0xe82e17, ILogType.ForestryLog.MAPLE, null, WorldGenMaple.RedMaple.class),
|
||||
BalsamFir("abies", "balsamea", 0x74a07c, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.BalsamFir.class),
|
||||
LoblollyPine("pinus", "taeda", 0x6f8a47, ILogType.ForestryLog.PINE, null, WorldGenConifer.LoblollyPine.class),
|
||||
Sweetgum("liquidambar", "styraciflua", 0x8b8762, ILogType.ExtraTreeLog.Sweetgum, null, WorldGenTree2.Sweetgum.class),
|
||||
Locust("robinia", "pseudoacacia", 0x887300, ILogType.ExtraTreeLog.Locust, null, WorldGenTree2.Locust.class),
|
||||
Pear("pyrus", "communis", 0x5e8826, ILogType.ExtraTreeLog.Pear, ExtraTreeFruitGene.Pear, WorldGenTree2.Pear.class),
|
||||
OsangeOsange("maclura", "pomifera", 0x687a50, ILogType.ExtraTreeLog.Maclura, ExtraTreeFruitGene.OsangeOsange, WorldGenJungle.OsangeOsange.class),
|
||||
OldFustic("maclura", "tinctoria", 0x687a50, ILogType.ExtraTreeLog.Maclura, null, WorldGenJungle.OldFustic.class),
|
||||
Brazilwood("caesalpinia", "echinata", 0x607459, ILogType.ExtraTreeLog.Brazilwood, null, WorldGenJungle.Brazilwood.class),
|
||||
Logwood("haematoxylum", "campechianum", 0x889f6b, ILogType.ExtraTreeLog.Logwood, null, WorldGenJungle.Logwood.class),
|
||||
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenJungle.Rosewood.class),
|
||||
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenJungle.Purpleheart.class),
|
||||
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenTree2.Iroko.class),
|
||||
Gingko("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Gingko, ExtraTreeFruitGene.GingkoNut, WorldGenTree2.Gingko.class),
|
||||
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut, WorldGenJungle.BrazilNut.class),
|
||||
RoseGum("eucalyptus", "grandis", 0x9ca258, ILogType.ExtraTreeLog.Eucalyptus, null, WorldGenEucalyptus.RoseGum.class),
|
||||
SwampGum("eucalyptus", "grandis", 0xa2c686, ILogType.ExtraTreeLog.Eucalyptus2, null, WorldGenEucalyptus.SwampGum.class),
|
||||
Box("boxus", "sempervirens", 0x72996d, ILogType.ExtraTreeLog.Box, null, WorldGenTree2.Box.class),
|
||||
Clove("syzygium", "aromaticum", 0x7a821f, ILogType.ExtraTreeLog.Syzgium, ExtraTreeFruitGene.Clove, WorldGenTree2.Clove.class),
|
||||
Coffee("coffea", "arabica", 0x6f9065, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coffee, WorldGenJungle.Coffee.class),
|
||||
MonkeyPuzzle("araucaria", "araucana", 0x576158, ILogType.ForestryLog.PINE, null, WorldGenConifer.MonkeyPuzzle.class),
|
||||
RainbowGum("eucalyptus", "deglupta", 0xb7f025, ILogType.ExtraTreeLog.Eucalyptus3, null, WorldGenEucalyptus.RainbowGum.class),
|
||||
Butternut("juglans", "cinerea", 0x82b58c, ILogType.ExtraTreeLog.Butternut, ExtraTreeFruitGene.Butternut, WorldGenButternut.class),
|
||||
Rowan("sorbus", "aucuparia", 0x9ec79b, ILogType.ExtraTreeLog.Rowan, null, WorldGenRowan.class),
|
||||
Hemlock("tsuga", "heterophylla", 0x5cac72, ILogType.ExtraTreeLog.Hemlock, null, WorldGenWesternHemlock.class),
|
||||
Ash("fraxinus", "excelsior", 0x488e2b, ILogType.ExtraTreeLog.Ash, null, WorldGenCommonAsh.class),
|
||||
Alder("alnus", "glutinosa", 0x698a33, ILogType.ExtraTreeLog.Alder, null, WorldGenCommonAlder.class),
|
||||
Beech("fagus", "sylvatica", 0x83a04c, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenCommonBeech.class),
|
||||
CopperBeech("fagus", "purpurea", 0x801318, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenCopperBeech.class),
|
||||
Aspen("populus", "tremula", 0x8acc37, ILogType.ForestryLog.POPLAR, null, WorldGenAspen.class),
|
||||
Yew("taxus", "baccata", 0x948a4d, ILogType.ExtraTreeLog.Yew, null, WorldGenYew.class),
|
||||
Cypress("chamaecyparis", "lawsoniana", 0x89c9a7, ILogType.ExtraTreeLog.Cypress, null, WorldGenCypress.class),
|
||||
DouglasFir("pseudotsuga", "menziesii", 0x99b582, ILogType.ExtraTreeLog.Fir, null, WorldGenDouglasFir.class),
|
||||
Hazel("Corylus", "avellana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenHazel.class),
|
||||
Sycamore("ficus", "sycomorus", 0xa0a52f, ILogType.ExtraTreeLog.Fig, ExtraTreeFruitGene.Fig, WorldGenSycamore.class),
|
||||
Whitebeam("sorbus", "aria", 0xbace99, ILogType.ExtraTreeLog.Whitebeam, null, WorldGenWhitebeam.class),
|
||||
Hawthorn("crataegus", "monogyna", 0x6ba84a, ILogType.ExtraTreeLog.Hawthorn, null, WorldGenHawthorn.class),
|
||||
Pecan("carya", "illinoinensis", 0x85b674, ILogType.ExtraTreeLog.Hickory, ExtraTreeFruitGene.Pecan, WorldGenPecan.class),
|
||||
Elm("ulmus", "procera", 0x7c9048, ILogType.ExtraTreeLog.Elm, null, WorldGenElm.class),
|
||||
Elder("sambucus", "nigra", 0xaeb873, ILogType.ExtraTreeLog.Elder, ExtraTreeFruitGene.Elderberry, WorldGenElder.class),
|
||||
Holly("ilex", "aquifolium", 0x254b4c, ILogType.ExtraTreeLog.Holly, null, WorldGenHolly.class),
|
||||
Hornbeam("carpinus", "betulus", 0x96a71b, ILogType.ExtraTreeLog.Hornbeam, null, WorldGenHornbeam.class),
|
||||
Sallow("salix", "caprea", 0xaeb323, ILogType.ForestryLog.WILLOW, null, WorldGenSallow.class),
|
||||
AcornOak("quercus", "robur", 0x66733e, ILogType.VanillaLog.Oak, ExtraTreeFruitGene.Acorn, WorldGenAcornOak.class),
|
||||
Fir("abies", "alba", 0x6f7c20, ILogType.ExtraTreeLog.Fir, null, WorldGenSilverFir.class),
|
||||
Cedar("cedrus", "libani", 0x95a370, ILogType.ExtraTreeLog.Cedar, null, WorldGenCedar.class),
|
||||
Olive("olea", "europaea", 0x3c4834, ILogType.ExtraTreeLog.Olive, ExtraTreeFruitGene.Olive, WorldGenOlive.class),
|
||||
RedMaple("acer", "ubrum", 0xe82e17, ILogType.ForestryLog.MAPLE, null, WorldGenRedMaple.class),
|
||||
BalsamFir("abies", "balsamea", 0x74a07c, ILogType.ExtraTreeLog.Fir, null, WorldGenBalsamFir.class),
|
||||
LoblollyPine("pinus", "taeda", 0x6f8a47, ILogType.ForestryLog.PINE, null, WorldGenLoblollyPine.class),
|
||||
Sweetgum("liquidambar", "styraciflua", 0x8b8762, ILogType.ExtraTreeLog.Sweetgum, null, WorldGenSweetgum.class),
|
||||
Locust("robinia", "pseudoacacia", 0x887300, ILogType.ExtraTreeLog.Locust, null, WorldGenLocust.class),
|
||||
Pear("pyrus", "communis", 0x5e8826, ILogType.ExtraTreeLog.Pear, ExtraTreeFruitGene.Pear, WorldGenPear.class),
|
||||
OsangeOsange("maclura", "pomifera", 0x687a50, ILogType.ExtraTreeLog.Maclura, ExtraTreeFruitGene.OsangeOsange, WorldGenOsangeOsange.class),
|
||||
OldFustic("maclura", "tinctoria", 0x687a50, ILogType.ExtraTreeLog.Maclura, null, WorldGenOldFustic.class),
|
||||
Brazilwood("caesalpinia", "echinata", 0x607459, ILogType.ExtraTreeLog.Brazilwood, null, WorldGenBrazilwood.class),
|
||||
Logwood("haematoxylum", "campechianum", 0x889f6b, ILogType.ExtraTreeLog.Logwood, null, WorldGenLogwood.class),
|
||||
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenRosewood.class),
|
||||
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenPurpleheart.class),
|
||||
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenIroko.class),
|
||||
Gingko("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Gingko, ExtraTreeFruitGene.GingkoNut, WorldGenGingko.class),
|
||||
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut, WorldGenBrazilNut.class),
|
||||
RoseGum("eucalyptus", "grandis", 0x9ca258, ILogType.ExtraTreeLog.Eucalyptus, null, WorldGenRoseGum.class),
|
||||
SwampGum("eucalyptus", "grandis", 0xa2c686, ILogType.ExtraTreeLog.Eucalyptus2, null, WorldGenSwampGum.class),
|
||||
Box("boxus", "sempervirens", 0x72996d, ILogType.ExtraTreeLog.Box, null, WorldGenBox.class),
|
||||
Clove("syzygium", "aromaticum", 0x7a821f, ILogType.ExtraTreeLog.Syzgium, ExtraTreeFruitGene.Clove, WorldGenClove.class),
|
||||
Coffee("coffea", "arabica", 0x6f9065, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coffee, WorldGenCoffee.class),
|
||||
MonkeyPuzzle("araucaria", "araucana", 0x576158, ILogType.ForestryLog.PINE, null, WorldGenMonkeyPuzzle.class),
|
||||
RainbowGum("eucalyptus", "deglupta", 0xb7f025, ILogType.ExtraTreeLog.Eucalyptus3, null, WorldGenRainbowGum.class),
|
||||
PinkIvory("berchemia", "zeyheri", 0x7c9159, ILogType.ExtraTreeLog.PinkIvory, null, WorldGenTree.class),
|
||||
Blackcurrant("ribes", "nigrum", 0xa6da5c, null, ExtraTreeFruitGene.Blackcurrant, WorldGenShrub.Shrub.class),
|
||||
Redcurrant("ribes", "rubrum", 0x74ac00, null, ExtraTreeFruitGene.Redcurrant, WorldGenShrub.Shrub.class),
|
||||
Blackberry("rubus", "fruticosus", 0x92c15b, null, ExtraTreeFruitGene.Blackberry, WorldGenShrub.Shrub.class),
|
||||
Raspberry("rubus", "idaeus", 0x83b96e, null, ExtraTreeFruitGene.Raspberry, WorldGenShrub.Shrub.class),
|
||||
Blueberry("vaccinium", "corymbosum", 0x72c750, null, ExtraTreeFruitGene.Blueberry, WorldGenShrub.Shrub.class),
|
||||
Cranberry("vaccinium", "oxycoccos", 0x96d179, null, ExtraTreeFruitGene.Cranberry, WorldGenShrub.Shrub.class),
|
||||
Juniper("juniperus", "communis", 0x90b149, null, ExtraTreeFruitGene.Juniper, WorldGenShrub.Shrub.class),
|
||||
Gooseberry("ribes", "grossularia", 0x79bb00, null, ExtraTreeFruitGene.Gooseberry, WorldGenShrub.Shrub.class),
|
||||
GoldenRaspberry("rubus", "occidentalis", 0x83b96e, null, ExtraTreeFruitGene.GoldenRaspberry, WorldGenShrub.Shrub.class),
|
||||
Cinnamon("cinnamomum", "cassia", 0x738e0b, ILogType.ExtraTreeLog.Cinnamon, null, WorldGenLazy.Tree.class),
|
||||
Coconut("cocous", "nucifera", 0x649923, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coconut, WorldGenPalm.Coconut.class),
|
||||
Cashew("anacardium", "occidentale", 0xabb962, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Cashew, WorldGenLazy.Tree.class),
|
||||
Avacado("persea", "americana", 0x96a375, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Avacado, WorldGenLazy.Tree.class),
|
||||
Nutmeg("myristica", "fragrans", 0x488d4c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Nutmeg, WorldGenLazy.Tree.class),
|
||||
Allspice("pimenta", "dioica", 0x7c9724, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Allspice, WorldGenLazy.Tree.class),
|
||||
Chilli("capsicum", "annuum", 0x2a9f01, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Chilli, WorldGenLazy.Tree.class),
|
||||
StarAnise("illicium", "verum", 0x7fc409, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.StarAnise, WorldGenLazy.Tree.class),
|
||||
Mango("mangifera", "indica", 0x87b574, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Mango, WorldGenTropical.Mango.class),
|
||||
Starfruit("averrhoa", "carambola", 0x6da92d, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Starfruit, WorldGenLazy.Tree.class),
|
||||
Candlenut("aleurites", "moluccana", 0x8aa36c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Candlenut, WorldGenLazy.Tree.class),
|
||||
DwarfHazel("Corylus", "americana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenShrub.Shrub.class);
|
||||
Blackcurrant("ribes", "nigrum", 0xa6da5c, null, ExtraTreeFruitGene.Blackcurrant, WorldGenShrub.class),
|
||||
Redcurrant("ribes", "rubrum", 0x74ac00, null, ExtraTreeFruitGene.Redcurrant, WorldGenShrub.class),
|
||||
Blackberry("rubus", "fruticosus", 0x92c15b, null, ExtraTreeFruitGene.Blackberry, WorldGenShrub.class),
|
||||
Raspberry("rubus", "idaeus", 0x83b96e, null, ExtraTreeFruitGene.Raspberry, WorldGenShrub.class),
|
||||
Blueberry("vaccinium", "corymbosum", 0x72c750, null, ExtraTreeFruitGene.Blueberry, WorldGenShrub.class),
|
||||
Cranberry("vaccinium", "oxycoccos", 0x96d179, null, ExtraTreeFruitGene.Cranberry, WorldGenShrub.class),
|
||||
Juniper("juniperus", "communis", 0x90b149, null, ExtraTreeFruitGene.Juniper, WorldGenShrub.class),
|
||||
Gooseberry("ribes", "grossularia", 0x79bb00, null, ExtraTreeFruitGene.Gooseberry, WorldGenShrub.class),
|
||||
GoldenRaspberry("rubus", "occidentalis", 0x83b96e, null, ExtraTreeFruitGene.GoldenRaspberry, WorldGenShrub.class),
|
||||
Cinnamon("cinnamomum", "cassia", 0x738e0b, ILogType.ExtraTreeLog.Cinnamon, null, WorldGenLazy.class),
|
||||
Coconut("cocous", "nucifera", 0x649923, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coconut, WorldGenCoconut.class),
|
||||
Cashew("anacardium", "occidentale", 0xabb962, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Cashew, WorldGenLazy.class),
|
||||
Avacado("persea", "americana", 0x96a375, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Avacado, WorldGenLazy.class),
|
||||
Nutmeg("myristica", "fragrans", 0x488d4c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Nutmeg, WorldGenLazy.class),
|
||||
Allspice("pimenta", "dioica", 0x7c9724, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Allspice, WorldGenLazy.class),
|
||||
Chilli("capsicum", "annuum", 0x2a9f01, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Chilli, WorldGenLazy.class),
|
||||
StarAnise("illicium", "verum", 0x7fc409, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.StarAnise, WorldGenLazy.class),
|
||||
Mango("mangifera", "indica", 0x87b574, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Mango, WorldGenMango.class),
|
||||
Starfruit("averrhoa", "carambola", 0x6da92d, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Starfruit, WorldGenLazy.class),
|
||||
Candlenut("aleurites", "moluccana", 0x8aa36c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Candlenut, WorldGenLazy.class),
|
||||
DwarfHazel("Corylus", "americana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenShrub.class);
|
||||
|
||||
public ILogType wood;
|
||||
|
||||
@@ -1169,6 +1205,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
try {
|
||||
return gen.getConstructor(ITreeGenData.class).newInstance(tree);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
@@ -1179,11 +1216,9 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
leafType = type;
|
||||
if (leafType == LeafType.CONIFER) {
|
||||
saplingType = SaplingType.CONIFER;
|
||||
}
|
||||
if (leafType == LeafType.JUNGLE) {
|
||||
} else if (leafType == LeafType.JUNGLE) {
|
||||
saplingType = SaplingType.JUNGLE;
|
||||
}
|
||||
if (leafType == LeafType.PALM) {
|
||||
} else if (leafType == LeafType.PALM) {
|
||||
saplingType = SaplingType.PALM;
|
||||
}
|
||||
return this;
|
||||
@@ -1247,7 +1282,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getLeafColour(ITree tree) {
|
||||
public int getLeafColor(ITree tree) {
|
||||
return color;
|
||||
}
|
||||
|
||||
@@ -1312,7 +1347,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
if (itemstack.getItem() == Mods.forestry.item("honeydew")) {
|
||||
return 0.7f;
|
||||
}
|
||||
if (itemstack.getItem() == Mods.forestry.item("beeComb")) {
|
||||
if (itemstack.getItem() == Mods.forestry.item("beeCombs")) {
|
||||
return 0.4f;
|
||||
}
|
||||
if (AlleleManager.alleleRegistry.isIndividual(itemstack)) {
|
||||
@@ -1359,14 +1394,14 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
public int getGermlingColour(EnumGermlingType type, int renderPass) {
|
||||
if (type == EnumGermlingType.SAPLING) {
|
||||
if (renderPass == 0) {
|
||||
return getLeafColour(null);
|
||||
return getLeafColor(null);
|
||||
}
|
||||
if (getLog() == null) {
|
||||
return 0xffffff;
|
||||
}
|
||||
return getLog().getColour();
|
||||
}
|
||||
return getLeafColour(null);
|
||||
return getLeafColor(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -68,7 +68,7 @@ public class ModuleGenetics implements IInitializable {
|
||||
|
||||
private void generateBranches() {
|
||||
for (String hierarchy : branches) {
|
||||
List<String> set = new ArrayList<String>();
|
||||
List<String> set = new ArrayList<>();
|
||||
for (String string : hierarchy.split(" ", 0)) {
|
||||
set.add(string.toLowerCase());
|
||||
}
|
||||
|
||||
@@ -89,7 +89,6 @@ public enum Food implements IItemMisc {
|
||||
ores = new ArrayList<>();
|
||||
this.hunger = hunger;
|
||||
}
|
||||
|
||||
public static void registerOreDictionary() {
|
||||
Food.Crabapple.ore("Apple").ore("Crabapple");
|
||||
Food.Orange.ore("Orange");
|
||||
@@ -131,6 +130,25 @@ public enum Food implements IItemMisc {
|
||||
Food.Coffee.ore("Coffee");
|
||||
Food.OsangeOrange.ore("OsangeOrange");
|
||||
Food.Clove.ore("Clove");
|
||||
Food.Papayimar.ore("Papayimar");
|
||||
Food.Blackcurrant.ore("Blackcurrant");
|
||||
Food.Redcurrant.ore("Redcurrant");
|
||||
Food.Blackberry.ore("Blackberry");
|
||||
Food.Raspberry.ore("Raspberry");
|
||||
Food.Blueberry.ore("Blueberry");
|
||||
Food.Cranberry.ore("Cranberry");
|
||||
Food.Juniper.ore("Juniper");
|
||||
Food.Gooseberry.ore("Gooseberry");
|
||||
Food.GoldenRaspberry.ore("GoldenRaspberry");
|
||||
Food.Coconut.ore("Coconut");
|
||||
Food.Cashew.ore("Cashew");
|
||||
Food.Avacado.ore("Avacado");
|
||||
Food.Nutmeg.ore("Nutmeg");
|
||||
Food.Chilli.ore("Chilli");
|
||||
Food.StarAnise.ore("StarAnise");
|
||||
Food.Mango.ore("Mango");
|
||||
Food.Starfruit.ore("Starfruit");
|
||||
Food.Candlenut.ore("Candlenut");
|
||||
}
|
||||
|
||||
public boolean isEdible() {
|
||||
@@ -148,7 +166,7 @@ public enum Food implements IItemMisc {
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return I18N.localise("extratrees.item.food." + name().toLowerCase());
|
||||
return I18N.localise("for.extratrees.item.food." + name().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockTypeLeaf extends BlockType {
|
||||
public BlockTypeLeaf() {
|
||||
super(Mods.forestry.block("leaves"), 0);
|
||||
public BlockTypeLeaf(boolean decay) {
|
||||
super(decay ? Mods.forestry.block("leaves") : ExtraTrees.blockShrubLeaves, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,8 +24,9 @@ public class DefaultTreeGenerator implements ITreeGenerator {
|
||||
|
||||
@Override
|
||||
public void setLogBlock(ITreeGenome genome, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
if (extraTreeSpecies.wood != null)
|
||||
if (extraTreeSpecies.wood != null) {
|
||||
extraTreeSpecies.wood.placeBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAcornOak extends WorldGenTree {
|
||||
public WorldGenAcornOak(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 3.0f;
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.4f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.7f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.2f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAlder {
|
||||
public static class CommonAlder extends WorldGenTree {
|
||||
public CommonAlder(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenApple {
|
||||
public static class OrchardApple extends WorldGenTree {
|
||||
public OrchardApple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
while (leafSpawn > 2) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 6);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class SweetCrabapple extends WorldGenTree {
|
||||
public SweetCrabapple(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 4);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class FloweringCrabapple extends WorldGenTree {
|
||||
public FloweringCrabapple(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 6);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class PrairieCrabapple extends WorldGenTree {
|
||||
public PrairieCrabapple(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 4);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAsh {
|
||||
public static class CommonAsh extends WorldGenTree {
|
||||
public CommonAsh(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.35f, 0.45f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAspen extends WorldGenTree {
|
||||
public WorldGenAspen(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(height / 2, height / 2 + 1) + 1;
|
||||
float width = height * randBetween(0.25f, 0.35f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBalsamFir extends WorldGenTree {
|
||||
public WorldGenBalsamFir(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = 1.0f;
|
||||
float width = height / randBetween(2.0f, 2.5f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,10 @@ public class WorldGenBanana extends WorldGenTree {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
float width = height / randBetween(1.8f, 2.0f);
|
||||
int bottom = randBetween(3, 4);
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
public class WorldGenBeech {
|
||||
public static class CommonBeech extends WorldGenTree {
|
||||
public CommonBeech(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.47f, 0.5f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class CopperBeech extends CommonBeech {
|
||||
public CopperBeech(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBox extends WorldGenTree {
|
||||
public WorldGenBox(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 0.0f;
|
||||
float width = 1.5f;
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBrazilNut extends WorldGenTree {
|
||||
public WorldGenBrazilNut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = height - 3;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBrazilwood extends WorldGenTree {
|
||||
public WorldGenBrazilwood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.8f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenButternut extends WorldGenTree {
|
||||
public WorldGenButternut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
|
||||
}
|
||||
if (rand.nextBoolean()) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 4.0f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCedar extends WorldGenTree {
|
||||
public WorldGenCedar(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 3;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), girth, 1, leaf, false);
|
||||
}
|
||||
|
||||
for (leafSpawn = height + 3; leafSpawn > bottom; leafSpawn += 1 + rand.nextInt(2)) {
|
||||
float cone = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
cone *= 2.0f - cone;
|
||||
|
||||
float radius = (0.7f + rand.nextFloat() * 0.3f) * width;
|
||||
radius *= cone;
|
||||
if (radius < 2.0f) {
|
||||
radius = 2.0f;
|
||||
}
|
||||
|
||||
float xOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
|
||||
xOffset *= cone;
|
||||
if (xOffset > radius / 2.0f) {
|
||||
xOffset = radius / 2.0f;
|
||||
}
|
||||
|
||||
float yOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
|
||||
yOffset *= cone;
|
||||
if (yOffset > radius / 2.0f) {
|
||||
yOffset = radius / 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), 0.7f * radius, 1, leaf, false);
|
||||
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), radius, 1, leaf, false);
|
||||
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), 0.5f * radius, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenClove extends WorldGenTree {
|
||||
public WorldGenClove(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCoconut extends WorldGenTree {
|
||||
public WorldGenCoconut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCoffee extends WorldGenTree {
|
||||
public WorldGenCoffee(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.3f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCommonAlder extends WorldGenTree {
|
||||
public WorldGenCommonAlder(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCommonAsh extends WorldGenTree {
|
||||
public WorldGenCommonAsh(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.35f, 0.45f);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCommonBeech extends WorldGenTree {
|
||||
public WorldGenCommonBeech(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.47f, 0.5f);
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 185 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user