mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-15 01:35:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
280ed91925 | ||
|
|
d08ebbde14 | ||
|
|
51d7f51c44 | ||
|
|
b3bf9ea9ac | ||
|
|
0b23dcdb39 | ||
|
|
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 | ||
|
|
4ef9cd6a28 | ||
|
|
60b881810d | ||
|
|
c854f9b489 | ||
|
|
4e9624daab | ||
|
|
fac2008f14 | ||
|
|
2475710a6a | ||
|
|
e83d0e3fa6 | ||
|
|
052997cb09 | ||
|
|
ef372d4f84 | ||
|
|
f215990d8a | ||
|
|
f5a83016f5 | ||
|
|
eab09635e9 | ||
|
|
767ec08795 | ||
|
|
5928473316 | ||
|
|
b5989356ce | ||
|
|
4d1d3d1cca | ||
|
|
0b9b0c0068 | ||
|
|
dccaf6d7d4 | ||
|
|
73edb413f5 | ||
|
|
303c98e443 | ||
|
|
868ef735b0 | ||
|
|
1d4b5f791d | ||
|
|
46140e2e66 |
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}
|
||||
|
||||
+552
-32
@@ -1,68 +1,588 @@
|
||||
//version: 8fa7883b6196c1765266f4e6ddf3118d5043aafb
|
||||
/*
|
||||
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")
|
||||
id("maven-publish")
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "2.0.16"
|
||||
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"
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
if(file("addon.gradle").exists()) {
|
||||
apply from: "addon.gradle"
|
||||
}
|
||||
|
||||
apply from: 'repositories.gradle'
|
||||
|
||||
configurations {
|
||||
implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
|
||||
implementation.extendsFrom(shadowCompile)
|
||||
implementation.extendsFrom(shadeCompile)
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "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 {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
|
||||
dependsOn(relocateShadowJar)
|
||||
}
|
||||
|
||||
jar {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(shadowJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
reobf {
|
||||
if(usesMixins.toBoolean()) {
|
||||
addExtraSrgFile mixinSrg
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
if(usesMixins.toBoolean()) {
|
||||
tasks.compileJava {
|
||||
options.compilerArgs += [
|
||||
"-AreobfSrgFile=${tasks.reobf.srg}",
|
||||
"-AoutSrgFile=${mixinSrg}",
|
||||
"-AoutRefMapFile=${refMap}",
|
||||
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
|
||||
"-XDenableSunApiLintControl",
|
||||
"-XDignore.symbol.file"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runClient {
|
||||
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'
|
||||
expand 'version': project.version,
|
||||
'mcversion': project.minecraft.version,
|
||||
'modid': "BinnieMods"
|
||||
|
||||
// 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'
|
||||
}
|
||||
}
|
||||
|
||||
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');
|
||||
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) {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
minimize() // This will only allow shading for actually used classes
|
||||
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
|
||||
}
|
||||
|
||||
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
|
||||
target = tasks.shadowDevJar
|
||||
prefix = modGroup + ".shadow"
|
||||
}
|
||||
|
||||
task circularResolverJar(type: Jar) {
|
||||
dependsOn(relocateShadowDevJar)
|
||||
dependsOn(shadowDevJar)
|
||||
enabled = false
|
||||
}
|
||||
|
||||
task devJar(type: Jar) {
|
||||
project.configurations.shadeCompile.each { dep ->
|
||||
from(project.zipTree(dep)) {
|
||||
exclude 'META-INF', 'META-INF/**'
|
||||
}
|
||||
}
|
||||
|
||||
from sourceSets.main.output
|
||||
getArchiveClassifier().set("dev")
|
||||
|
||||
manifest {
|
||||
attributes(getManifestAttributes())
|
||||
}
|
||||
|
||||
if(usesShadowedDependencies.toBoolean()) {
|
||||
dependsOn(circularResolverJar)
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
task apiJar(type: Jar) {
|
||||
from (sourceSets.main.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
|
||||
}
|
||||
}
|
||||
|
||||
// publishing
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
artifact source: jar
|
||||
artifact source: sourcesJar, classifier: "src"
|
||||
artifact source: devJar, classifier: "dev"
|
||||
if (apiPackage) {
|
||||
artifact source: apiJar, classifier: "api"
|
||||
}
|
||||
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: group
|
||||
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
|
||||
version = System.getenv("ARTIFACT_VERSION") ?: project.version
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown"
|
||||
String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown"
|
||||
String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName"
|
||||
name = "GitHubPackages"
|
||||
url = githubRepositoryUrl
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_ACTOR") ?: "NONE"
|
||||
password = System.getenv("GITHUB_TOKEN") ?: "NONE"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Updating
|
||||
task updateBuildScript {
|
||||
doLast {
|
||||
if (performBuildScriptUpdate(projectDir.toString())) return
|
||||
|
||||
print("Build script already up-to-date!")
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
|
||||
if (autoUpdateBuildScript.toBoolean()) {
|
||||
performBuildScriptUpdate(projectDir.toString())
|
||||
} else {
|
||||
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)
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
# Git Changelog Gradle plugin
|
||||
{{#tags}}
|
||||
<h3>{{name}}</h3>
|
||||
<ul>
|
||||
|
||||
@@ -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 username each time you
|
||||
# restart Minecraft in development. Choose this dependent on your mod:
|
||||
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
|
||||
# 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 mod's 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 = BinnieCore.java
|
||||
gradleTokenModId =
|
||||
gradleTokenModName =
|
||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||
gradleTokenGroupName =
|
||||
|
||||
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
|
||||
# leave this property empty.
|
||||
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
|
||||
apiPackage =
|
||||
|
||||
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
|
||||
# Example value: mymodid_at.cfg
|
||||
accessTransformersFile =
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage =
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatibility only
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass =
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = false
|
||||
|
||||
# If enabled, you may use '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"
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ import net.minecraftforge.event.world.BlockEvent;
|
||||
@Mod(
|
||||
modid = "Botany",
|
||||
name = "Botany",
|
||||
version = BinnieCore.VERSION,
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore"
|
||||
)
|
||||
|
||||
@@ -31,8 +31,8 @@ public class ControlColorDisplay extends Control implements IControlValue<IFlowe
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.solid(area, -1);
|
||||
CraftGUI.Render.solid(area.inset(1), 0xff000000 + getValue().getColor(false));
|
||||
CraftGUI.render.solid(area, -1);
|
||||
CraftGUI.render.solid(area.inset(1), 0xff000000 + getValue().getColor(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ControlColorOption extends ControlTextOption<IFlowerColor> {
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
|
||||
int th = (int) CraftGUI.Render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
int th = (int) CraftGUI.render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
int height = Math.max(20, th + 6);
|
||||
setSize(new IPoint(size().x(), height));
|
||||
textWidget.setSize(new IPoint(textWidget.getSize().x(), height));
|
||||
|
||||
@@ -31,9 +31,9 @@ public class ControlColourMixSymbol extends Control implements ITooltip {
|
||||
public void onRenderBackground() {
|
||||
super.onRenderBackground();
|
||||
if (type == 0) {
|
||||
CraftGUI.Render.texture(ControlColourMixSymbol.MutationPlus, IPoint.ZERO);
|
||||
CraftGUI.render.texture(ControlColourMixSymbol.MutationPlus, IPoint.ZERO);
|
||||
} else {
|
||||
CraftGUI.Render.texture(ControlColourMixSymbol.MutationArrow, IPoint.ZERO);
|
||||
CraftGUI.render.texture(ControlColourMixSymbol.MutationArrow, IPoint.ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -13,11 +13,11 @@ import binnie.core.util.I18N;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageColourMix extends PageAbstract<IFlowerColor> {
|
||||
public class PageColorMix extends PageAbstract<IFlowerColor> {
|
||||
ControlText title;
|
||||
ControlColorMixBox list;
|
||||
|
||||
public PageColourMix(IWidget parent, DatabaseTab tab) {
|
||||
public PageColorMix(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
title = new ControlTextCentered(this, 8.0f, I18N.localise("botany.gui.controls.pageColorFurtherTitle"));
|
||||
list = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Further);
|
||||
@@ -47,7 +47,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.species"));
|
||||
createMode(FlowerMode.COLOR, new ColorModeWidget());
|
||||
new PageColorMixResultant(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.resultant"));
|
||||
new PageColourMix(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.further"));
|
||||
new PageColorMix(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.further"));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(Botany.instance, "breeder"));
|
||||
}
|
||||
|
||||
|
||||
@@ -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.botany.items.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;
|
||||
@@ -47,7 +47,9 @@ import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Mod(modid = "BinnieCore", name = "Binnie Core", useMetadata = true, dependencies = "after:Forestry@[4.2,)")
|
||||
import static binnie.core.BinnieCore.*;
|
||||
|
||||
@Mod(modid = "BinnieCore", name = "Binnie Core", version = VERSION, useMetadata = true, dependencies = "after:Forestry@[4.2,)")
|
||||
public class BinnieCore extends AbstractMod {
|
||||
@Mod.Instance("BinnieCore")
|
||||
public static BinnieCore instance;
|
||||
@@ -58,6 +60,7 @@ public class BinnieCore extends AbstractMod {
|
||||
public static MachineGroup packageCompartment;
|
||||
public static ItemGenesis genesis;
|
||||
public static ItemFieldKit fieldKit;
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent evt) {
|
||||
@@ -92,7 +95,7 @@ public class BinnieCore extends AbstractMod {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
BinnieCore.instance = this;
|
||||
instance = this;
|
||||
for (FluidContainer container : FluidContainer.values()) {
|
||||
Item item = new ItemFluidContainer(container);
|
||||
GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
|
||||
@@ -108,7 +111,7 @@ public class BinnieCore extends AbstractMod {
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(mod, new BinnieGUIHandler(mod));
|
||||
}
|
||||
|
||||
BinnieCore.multipassRenderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
multipassRenderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new MultipassBlockRenderer());
|
||||
GameRegistry.registerTileEntity(TileEntityMetadata.class, "binnie.tile.metadata");
|
||||
}
|
||||
@@ -147,12 +150,12 @@ public class BinnieCore extends AbstractMod {
|
||||
}
|
||||
|
||||
static void registerMod(AbstractMod mod) {
|
||||
BinnieCore.modList.add(mod);
|
||||
modList.add(mod);
|
||||
}
|
||||
|
||||
private static List<AbstractMod> getActiveMods() {
|
||||
List<AbstractMod> list = new ArrayList<>();
|
||||
for (AbstractMod mod : BinnieCore.modList) {
|
||||
for (AbstractMod mod : modList) {
|
||||
if (mod.isActive()) {
|
||||
list.add(mod);
|
||||
}
|
||||
@@ -183,7 +186,7 @@ public class BinnieCore extends AbstractMod {
|
||||
|
||||
@Override
|
||||
public IBinnieProxy getProxy() {
|
||||
return BinnieCore.proxy;
|
||||
return proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -222,7 +225,7 @@ public class BinnieCore extends AbstractMod {
|
||||
|
||||
public static class PacketHandler extends BinniePacketHandler {
|
||||
public PacketHandler() {
|
||||
super(BinnieCore.instance);
|
||||
super(instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,10 +36,11 @@ public class ItemMetadataRenderer implements IItemRenderer {
|
||||
if (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
GL11.glTranslated(0.5, 0.5, 0.5);
|
||||
}
|
||||
|
||||
if (type == IItemRenderer.ItemRenderType.INVENTORY && block.getRenderBlockPass() != 0) {
|
||||
GL11.glAlphaFunc(516, 0.1f);
|
||||
GL11.glEnable(3042);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
}
|
||||
GL11.glPushMatrix();
|
||||
((RenderBlocks) data[0]).renderBlockAsItem(block, TileEntityMetadata.getItemDamage(item), 1.0f);
|
||||
|
||||
@@ -15,11 +15,11 @@ public class MultipassItemRenderer implements IItemRenderer {
|
||||
GL11.glEnable(3008);
|
||||
if (block.getRenderBlockPass() != 0) {
|
||||
GL11.glAlphaFunc(516, 0.1f);
|
||||
GL11.glEnable(3042);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
} else {
|
||||
GL11.glAlphaFunc(516, 0.5f);
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
MultipassBlockRenderer.instance.renderInventoryBlock(block, TileEntityMetadata.getItemDamage(item), 0, renderer);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@ import binnie.core.craftgui.renderer.Renderer;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUIResourceManager;
|
||||
|
||||
public class CraftGUI {
|
||||
public static CraftGUIResourceManager ResourceManager;
|
||||
public static Renderer Render;
|
||||
public static CraftGUIResourceManager resourceManager;
|
||||
public static Renderer render;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public interface IWidget {
|
||||
|
||||
void setCroppedZone(IWidget relative, IArea area);
|
||||
|
||||
boolean isCroppedWidet();
|
||||
boolean isCroppedWidget();
|
||||
|
||||
IWidget getCropWidget();
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
|
||||
private Collection<IWidget> getQueuedWidgets(IWidget widget) {
|
||||
List<IWidget> widgets = new ArrayList<>();
|
||||
boolean addChildren = true;
|
||||
if (widget.isCroppedWidet()) {
|
||||
if (widget.isCroppedWidget()) {
|
||||
addChildren = widget.getCroppedZone().contains(widget.getCropWidget().getRelativeMousePosition());
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ public class Widget implements IWidget {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCroppedWidet() {
|
||||
public boolean isCroppedWidget() {
|
||||
return cropped;
|
||||
}
|
||||
|
||||
@@ -280,21 +280,18 @@ public class Widget implements IWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
CraftGUI.Render.preRender(this);
|
||||
CraftGUI.render.preRender(this);
|
||||
onRender(RenderStage.PreChildren);
|
||||
|
||||
for (IWidget widget : getWidgets()) {
|
||||
widget.render();
|
||||
}
|
||||
|
||||
for (IWidget widget : getWidgets()) {
|
||||
CraftGUI.Render.preRender(widget);
|
||||
CraftGUI.render.preRender(widget);
|
||||
widget.onRender(RenderStage.PostSiblings);
|
||||
CraftGUI.Render.postRender(widget);
|
||||
CraftGUI.render.postRender(widget);
|
||||
}
|
||||
|
||||
onRender(RenderStage.PostChildren);
|
||||
CraftGUI.Render.postRender(this);
|
||||
CraftGUI.render.postRender(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -308,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);
|
||||
@@ -419,11 +416,9 @@ public class Widget implements IWidget {
|
||||
public void onRender(RenderStage stage) {
|
||||
if (stage == RenderStage.PreChildren) {
|
||||
onRenderBackground();
|
||||
}
|
||||
if (stage == RenderStage.PostChildren) {
|
||||
} else if (stage == RenderStage.PostChildren) {
|
||||
onRenderForeground();
|
||||
}
|
||||
if (stage == RenderStage.PostSiblings) {
|
||||
} else if (stage == RenderStage.PostSiblings) {
|
||||
onRenderOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class WindowFieldKit extends Window {
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle(getName());
|
||||
CraftGUI.Render.stylesheet(new StyleSheetPunnett());
|
||||
CraftGUI.render.stylesheet(new StyleSheetPunnett());
|
||||
getWindowInventory().createSlot(0);
|
||||
getWindowInventory().createSlot(1);
|
||||
setupValidators();
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ControlButton extends Control {
|
||||
} else if (isEnabled()) {
|
||||
texture = CraftGUITexture.Button;
|
||||
}
|
||||
CraftGUI.Render.texture(texture, getArea());
|
||||
CraftGUI.render.texture(texture, getArea());
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ControlCheckbox extends Control implements IControlValue<Boolean> {
|
||||
if (isMouseOver()) {
|
||||
texture = (getValue() ? CraftGUITexture.CheckboxCheckedHighlighted : CraftGUITexture.CheckboxHighlighted);
|
||||
}
|
||||
CraftGUI.Render.texture(texture, IPoint.ZERO);
|
||||
CraftGUI.render.texture(texture, IPoint.ZERO);
|
||||
}
|
||||
|
||||
protected void onValueChanged(boolean value) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ControlText extends Control implements IControlValue<String> {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.text(getArea(), align, text, getColor());
|
||||
CraftGUI.render.text(getArea(), align, text, getColor());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.Slot, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, getArea());
|
||||
renderTextField();
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ControlOption<T> extends Control implements IControlValue<T> {
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
if (isCurrentSelection()) {
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.Outline, getArea());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ControlScrollBar extends Control {
|
||||
} else if (isEnabled()) {
|
||||
texture = CraftGUITexture.Scroll;
|
||||
}
|
||||
CraftGUI.Render.texture(texture, renderArea);
|
||||
CraftGUI.render.texture(texture, renderArea);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
||||
texture = CraftGUITexture.Tab;
|
||||
}
|
||||
|
||||
Texture lTexture = CraftGUI.Render.getTexture(texture);
|
||||
Texture lTexture = CraftGUI.render.getTexture(texture);
|
||||
Position position = getTabPosition();
|
||||
Texture iTexture = lTexture.crop(position, 8.0f);
|
||||
IArea area = getArea();
|
||||
@@ -56,7 +56,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
||||
}
|
||||
}
|
||||
|
||||
CraftGUI.Render.texture(iTexture, area);
|
||||
CraftGUI.render.texture(iTexture, area);
|
||||
if (this instanceof ControlTabIcon) {
|
||||
ControlTabIcon icon = (ControlTabIcon) this;
|
||||
ControlItemDisplay item = (ControlItemDisplay) getWidgets().get(0);
|
||||
@@ -67,10 +67,10 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
||||
}
|
||||
|
||||
if (icon.hasOutline()) {
|
||||
iTexture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline);
|
||||
iTexture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline);
|
||||
iTexture = iTexture.crop(position, 8.0f);
|
||||
CraftGUI.Render.color(icon.getOutlineColor());
|
||||
CraftGUI.Render.texture(iTexture, area.inset(2));
|
||||
CraftGUI.render.color(icon.getOutlineColor());
|
||||
CraftGUI.render.texture(iTexture, area.inset(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ class ControlBreedingProgress extends Control {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.PanelBlack, getArea());
|
||||
IArea area = getArea().inset(1);
|
||||
area.setSize(new IPoint(area.size().x() * percentage, area.size().y()));
|
||||
CraftGUI.Render.color(colour);
|
||||
CraftGUI.Render.texture(ControlBreedingProgress.Progress, area);
|
||||
CraftGUI.render.color(colour);
|
||||
CraftGUI.render.texture(ControlBreedingProgress.Progress, area);
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
break;
|
||||
}
|
||||
if (icon != null) {
|
||||
CraftGUI.Render.iconItem(IPoint.ZERO, icon);
|
||||
CraftGUI.render.iconItem(IPoint.ZERO, icon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ControlItemStackOption extends ControlTextOption<ItemStack> {
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
|
||||
int th = (int) CraftGUI.Render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
int th = (int) CraftGUI.render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
int height = Math.max(20, th + 6);
|
||||
setSize(new IPoint(size().x(), height));
|
||||
textWidget.setSize(new IPoint(textWidget.getSize().x(), height));
|
||||
|
||||
@@ -26,9 +26,9 @@ class ControlMutationSymbol extends Control implements ITooltip {
|
||||
public void onRenderBackground() {
|
||||
super.onRenderBackground();
|
||||
if (type == 0) {
|
||||
CraftGUI.Render.texture(ControlMutationSymbol.MutationPlus, IPoint.ZERO);
|
||||
CraftGUI.render.texture(ControlMutationSymbol.MutationPlus, IPoint.ZERO);
|
||||
} else {
|
||||
CraftGUI.Render.texture(ControlMutationSymbol.MutationArrow, IPoint.ZERO);
|
||||
CraftGUI.render.texture(ControlMutationSymbol.MutationArrow, IPoint.ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class ControlSpeciesBoxOption extends ControlTextOption<IAlleleSpecies> {
|
||||
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
|
||||
int th = (int) CraftGUI.Render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
int th = (int) CraftGUI.render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
int height = Math.max(20, th + 6);
|
||||
setSize(new IPoint(size().x(), height));
|
||||
textWidget.setSize(new IPoint(textWidget.getSize().x(), height));
|
||||
|
||||
@@ -56,7 +56,7 @@ public class PageBranchOverview extends PageBranch {
|
||||
StringBuilder line = new StringBuilder();
|
||||
List<String> descLines = new ArrayList<>();
|
||||
for (String str : desc.split(" ")) {
|
||||
if (CraftGUI.Render.textWidth(line + " " + str) > 134) {
|
||||
if (CraftGUI.render.textWidth(line + " " + str) > 134) {
|
||||
descLines.add(EnumChatFormatting.ITALIC + line.toString() + EnumChatFormatting.RESET);
|
||||
line = new StringBuilder();
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -64,7 +64,7 @@ public class PageSpeciesOverview extends PageSpecies {
|
||||
|
||||
controlDescription.setValue(descBody + EnumChatFormatting.RESET);
|
||||
controlSignature.setValue(descSig + EnumChatFormatting.RESET);
|
||||
float descHeight = CraftGUI.Render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
|
||||
float descHeight = CraftGUI.render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
|
||||
controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0f));
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -143,7 +143,9 @@ public class ContainerCraftGUI extends Container {
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
crafters.add(player);
|
||||
if (!crafters.contains(player)) {
|
||||
crafters.add(player);
|
||||
}
|
||||
sentNBT.clear();
|
||||
}
|
||||
IInventory inventory = window.getInventory();
|
||||
|
||||
@@ -26,9 +26,9 @@ public abstract class Dialog extends Control {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.gradientRect(getArea().outset(400), -1442840576, -1442840576);
|
||||
CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
|
||||
CraftGUI.Render.texture(CraftGUITexture.TabOutline, getArea().inset(4));
|
||||
CraftGUI.render.gradientRect(getArea().outset(400), -1442840576, -1442840576);
|
||||
CraftGUI.render.texture(CraftGUITexture.Window, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.TabOutline, getArea().inset(4));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.events.EventKey;
|
||||
@@ -77,10 +76,10 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y());
|
||||
drawDefaultBackground();
|
||||
|
||||
GL11.glDisable(32826);
|
||||
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(2896);
|
||||
GL11.glDisable(2929);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
zLevel = 10.0f;
|
||||
GuiScreen.itemRender.zLevel = zLevel;
|
||||
|
||||
@@ -88,18 +87,18 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(32826);
|
||||
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
|
||||
InventoryPlayer playerInventory = mc.thePlayer.inventory;
|
||||
draggedItem = playerInventory.getItemStack();
|
||||
if (draggedItem != null) {
|
||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, 200, false);
|
||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, 200, false);
|
||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
||||
}
|
||||
GL11.glDisable(32826);
|
||||
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(2896);
|
||||
GL11.glDisable(2929);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
MinecraftTooltip tooltip = new MinecraftTooltip();
|
||||
if (isHelpMode()) {
|
||||
tooltip.setType(Tooltip.Type.HELP);
|
||||
@@ -108,24 +107,26 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
tooltip.setType(Tooltip.Type.STANDARD);
|
||||
window.getTooltip(tooltip);
|
||||
}
|
||||
|
||||
if (tooltip.exists()) {
|
||||
renderTooltip(new IPoint(mouseX, mouseY), tooltip);
|
||||
}
|
||||
zLevel = 0.0f;
|
||||
GL11.glEnable(2896);
|
||||
GL11.glEnable(2929);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
public void renderTooltip(IPoint mousePosition, MinecraftTooltip tooltip) {
|
||||
int mouseX = (int) mousePosition.x();
|
||||
int mouseY = (int) mousePosition.y();
|
||||
FontRenderer font = getFontRenderer();
|
||||
GL11.glDisable(32826);
|
||||
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(2896);
|
||||
GL11.glDisable(2929);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
int k = 0;
|
||||
List<String> strings = new ArrayList<String>();
|
||||
List<String> strings = new ArrayList<>();
|
||||
for (String string : tooltip.getList()) {
|
||||
if (string != null) {
|
||||
if (!string.contains("~~~")) {
|
||||
@@ -135,6 +136,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String s : strings) {
|
||||
int l = font.getStringWidth(s);
|
||||
if (s.contains("~~~")) {
|
||||
@@ -144,6 +146,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
k = l;
|
||||
}
|
||||
}
|
||||
|
||||
int i1 = mouseX + 12;
|
||||
int j1 = mouseY - 12;
|
||||
int k2 = 8;
|
||||
@@ -158,9 +161,10 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
zLevel = 300.0f;
|
||||
GuiScreen.itemRender.zLevel = 300.0f;
|
||||
int l2 = -267386864;
|
||||
int l2 = 0xf0100010;
|
||||
int j2;
|
||||
int i2 = j2 = 1342177280 + MinecraftTooltip.getOutline(tooltip.getType());
|
||||
int i2 = j2 = 0x50000000 + MinecraftTooltip.getOutline(tooltip.getType());
|
||||
|
||||
drawGradientRect(i1 - 3, j1 - 4, i1 + k + 3, j1 - 3, l2, l2);
|
||||
drawGradientRect(i1 - 3, j1 + k2 + 3, i1 + k + 3, j1 + k2 + 4, l2, l2);
|
||||
drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 + k2 + 3, l2, l2);
|
||||
@@ -170,6 +174,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
drawGradientRect(i1 + k + 2, j1 - 3 + 1, i1 + k + 3, j1 + k2 + 3 - 1, i2, j2);
|
||||
drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 - 3 + 1, i2, i2);
|
||||
drawGradientRect(i1 - 3, j1 + k2 + 2, i1 + k + 3, j1 + k2 + 3, j2, j2);
|
||||
|
||||
for (int k3 = 0; k3 < strings.size(); ++k3) {
|
||||
String s2 = strings.get(k3);
|
||||
if (k3 == 0) {
|
||||
@@ -177,6 +182,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
} else {
|
||||
s2 = MinecraftTooltip.getBody(tooltip.getType()) + s2;
|
||||
}
|
||||
|
||||
if (s2.contains("~~~")) {
|
||||
String split = s2.split("~~~")[1];
|
||||
try {
|
||||
@@ -192,18 +198,20 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
s2 = " " + s2.replaceAll("~~~(.*?)~~~", "");
|
||||
}
|
||||
|
||||
font.drawStringWithShadow(s2, i1, j1, -1);
|
||||
if (k3 == 0) {
|
||||
j1 += 2;
|
||||
}
|
||||
j1 += 10;
|
||||
}
|
||||
|
||||
zLevel = 0.0f;
|
||||
GuiScreen.itemRender.zLevel = 0.0f;
|
||||
GL11.glEnable(2896);
|
||||
GL11.glEnable(2929);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GL11.glEnable(32826);
|
||||
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -215,10 +223,6 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
window.callEvent(new EventMouse.Down(origin, x, y, button));
|
||||
}
|
||||
|
||||
public boolean isShiftDown() {
|
||||
return Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int key) {
|
||||
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
|
||||
@@ -231,10 +235,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
@Override
|
||||
protected void mouseMovedOrUp(int x, int y, int button) {
|
||||
IWidget origin = (window.getMousedOverWidget() == null) ? window : window.getMousedOverWidget();
|
||||
if (button == -1) {
|
||||
float dx = Mouse.getEventDX() * width / (float) mc.displayWidth;
|
||||
float dy = -(Mouse.getEventDY() * height / (float) mc.displayHeight);
|
||||
} else {
|
||||
if (button != -1) {
|
||||
window.callEvent(new EventMouse.Up(origin, x, y, button));
|
||||
}
|
||||
}
|
||||
@@ -243,7 +244,6 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
public void handleMouseInput() {
|
||||
super.handleMouseInput();
|
||||
int dWheel = Mouse.getDWheel();
|
||||
IWidget origin = (window.getFocusedWidget() == null) ? window : window.getFocusedWidget();
|
||||
if (dWheel != 0) {
|
||||
window.callEvent(new EventMouse.Wheel(window, dWheel));
|
||||
}
|
||||
@@ -254,16 +254,15 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
window.onClose();
|
||||
}
|
||||
|
||||
public void renderTexturedRect(float x, float y, float u, float v, float w, float h) {
|
||||
drawTexturedModalRect((int) x, (int) y, (int) u, (int) v, (int) w, (int) h);
|
||||
}
|
||||
|
||||
public void renderTexture(IPoint position, IArea textureArea) {
|
||||
drawTexturedModalRect((int) position.x(), (int) position.y(), (int) textureArea.pos().x(), (int) textureArea.pos().y(), (int) textureArea.size().x(), (int) textureArea.size().y());
|
||||
}
|
||||
|
||||
private void renderTexturedRect(IArea area, IPoint uv) {
|
||||
renderTexturedRect(area.pos().x(), area.pos().y(), uv.x(), uv.y(), area.size().x(), area.size().y());
|
||||
drawTexturedModalRect(
|
||||
(int) position.x(),
|
||||
(int) position.y(),
|
||||
(int) textureArea.pos().x(),
|
||||
(int) textureArea.pos().y(),
|
||||
(int) textureArea.size().x(),
|
||||
(int) textureArea.size().y()
|
||||
);
|
||||
}
|
||||
|
||||
public void renderTexturePadded(IArea area, IArea texture, IBorder padding) {
|
||||
@@ -279,19 +278,22 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
int textHeight = (int) texture.h();
|
||||
int u = (int) texture.x();
|
||||
int v = (int) texture.y();
|
||||
|
||||
if (borderTop + borderBottom > height) {
|
||||
borderTop = height / 2;
|
||||
borderBottom = height / 2;
|
||||
}
|
||||
|
||||
if (borderLeft + borderRight > width) {
|
||||
borderLeft = width / 2;
|
||||
borderRight = width / 2;
|
||||
}
|
||||
IPoint origin = area.pos();
|
||||
|
||||
drawTexturedModalRect(posX, posY, u, v, borderLeft, borderTop);
|
||||
drawTexturedModalRect(posX + width - borderRight, posY, u + textWidth - borderRight, v, borderRight, borderTop);
|
||||
drawTexturedModalRect(posX, posY + height - borderBottom, u, v + textHeight - borderBottom, borderLeft, borderBottom);
|
||||
drawTexturedModalRect(posX + width - borderRight, posY + height - borderBottom, u + textWidth - borderRight, v + textHeight - borderBottom, borderRight, borderBottom);
|
||||
|
||||
int texturingWidth;
|
||||
for (int currentXPos = borderLeft; currentXPos < width - borderRight; currentXPos += texturingWidth) {
|
||||
int distanceXRemaining = width - borderRight - currentXPos;
|
||||
@@ -299,9 +301,11 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
if (texturingWidth > distanceXRemaining) {
|
||||
texturingWidth = distanceXRemaining;
|
||||
}
|
||||
|
||||
if (texturingWidth <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
drawTexturedModalRect(posX + currentXPos, posY, u + borderLeft, v, texturingWidth, borderTop);
|
||||
drawTexturedModalRect(posX + currentXPos, posY + height - borderBottom, u + borderLeft, v + textHeight - borderBottom, texturingWidth, borderBottom);
|
||||
int texturingHeight;
|
||||
@@ -317,6 +321,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
drawTexturedModalRect(posX + currentXPos, posY + currentYPos, u + borderLeft, v + borderTop, texturingWidth, texturingHeight);
|
||||
}
|
||||
}
|
||||
|
||||
int texturingHeight2;
|
||||
for (int currentYPos2 = borderTop; currentYPos2 < height - borderBottom; currentYPos2 += texturingHeight2) {
|
||||
int distanceYRemaining2 = height - borderBottom - currentYPos2;
|
||||
@@ -324,6 +329,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
if (texturingHeight2 > distanceYRemaining2) {
|
||||
texturingHeight2 = distanceYRemaining2;
|
||||
}
|
||||
|
||||
if (texturingHeight2 <= 0) {
|
||||
break;
|
||||
}
|
||||
@@ -332,86 +338,84 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
}
|
||||
|
||||
public void drawGradientArea(float p_73733_1_, float p_73733_2_, float p_73733_3_, float p_73733_4_, int p_73733_5_, int p_73733_6_) {
|
||||
float f = (p_73733_5_ >> 24 & 0xFF) / 255.0f;
|
||||
float f2 = (p_73733_5_ >> 16 & 0xFF) / 255.0f;
|
||||
float f3 = (p_73733_5_ >> 8 & 0xFF) / 255.0f;
|
||||
float f4 = (p_73733_5_ & 0xFF) / 255.0f;
|
||||
float f5 = (p_73733_6_ >> 24 & 0xFF) / 255.0f;
|
||||
float f6 = (p_73733_6_ >> 16 & 0xFF) / 255.0f;
|
||||
float f7 = (p_73733_6_ >> 8 & 0xFF) / 255.0f;
|
||||
float f8 = (p_73733_6_ & 0xFF) / 255.0f;
|
||||
GL11.glDisable(3553);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glDisable(3008);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glShadeModel(7425);
|
||||
public void drawGradientArea(float x, float y, float width, float height, int color1, int color2) {
|
||||
float alpha1 = (color1 >> 24 & 0xFF) / 255.0f;
|
||||
float r1 = (color1 >> 16 & 0xFF) / 255.0f;
|
||||
float b1 = (color1 >> 8 & 0xFF) / 255.0f;
|
||||
float g1 = (color1 & 0xFF) / 255.0f;
|
||||
|
||||
float alpha2 = (color2 >> 24 & 0xFF) / 255.0f;
|
||||
float r2 = (color2 >> 16 & 0xFF) / 255.0f;
|
||||
float g2 = (color2 >> 8 & 0xFF) / 255.0f;
|
||||
float b2 = (color2 & 0xFF) / 255.0f;
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA_F(f2, f3, f4, f);
|
||||
tessellator.addVertex(p_73733_3_, p_73733_2_, zLevel);
|
||||
tessellator.addVertex(p_73733_1_, p_73733_2_, zLevel);
|
||||
tessellator.setColorRGBA_F(f6, f7, f8, f5);
|
||||
tessellator.addVertex(p_73733_1_, p_73733_4_, zLevel);
|
||||
tessellator.addVertex(p_73733_3_, p_73733_4_, zLevel);
|
||||
tessellator.setColorRGBA_F(r1, b1, g1, alpha1);
|
||||
tessellator.addVertex(width, y, zLevel);
|
||||
tessellator.addVertex(x, y, zLevel);
|
||||
tessellator.setColorRGBA_F(r2, g2, b2, alpha2);
|
||||
tessellator.addVertex(x, height, zLevel);
|
||||
tessellator.addVertex(width, height, zLevel);
|
||||
tessellator.draw();
|
||||
GL11.glShadeModel(7424);
|
||||
GL11.glDisable(3042);
|
||||
GL11.glEnable(3008);
|
||||
GL11.glEnable(3553);
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
public void renderItem(IPoint pos, ItemStack item, boolean rotating) {
|
||||
renderItem(pos, item, (int) zLevel + 3, rotating);
|
||||
}
|
||||
|
||||
private void renderItem(IPoint pos, ItemStack item, int zLevel, boolean rotating) {
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(8256);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(32826);
|
||||
GL11.glEnable(2929);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
FontRenderer font = item.getItem().getFontRenderer(item);
|
||||
if (font == null) {
|
||||
font = getFontRenderer();
|
||||
}
|
||||
if (item != null) {
|
||||
BinnieCore.proxy.getMinecraftInstance();
|
||||
float phase = Minecraft.getSystemTime() / 20.0f;
|
||||
|
||||
BinnieCore.proxy.getMinecraftInstance();
|
||||
float phase = Minecraft.getSystemTime() / 20.0f;
|
||||
|
||||
if (rotating) {
|
||||
GL11.glPushMatrix();
|
||||
if (rotating) {
|
||||
GL11.glTranslatef(8.0f, 8.0f, 0.0f);
|
||||
GL11.glRotatef(phase, 0.0f, -0.866f, 0.5f);
|
||||
GL11.glTranslatef(-8.0f, -8.0f, -67.1f);
|
||||
}
|
||||
GuiScreen.itemRender.renderItemAndEffectIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y());
|
||||
GL11.glPopMatrix();
|
||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||
GL11.glTranslatef(8.0f, 8.0f, 0.0f);
|
||||
GL11.glRotatef(phase, 0.0f, -0.866f, 0.5f);
|
||||
GL11.glTranslatef(-8.0f, -8.0f, -67.1f);
|
||||
}
|
||||
|
||||
GuiScreen.itemRender.renderItemAndEffectIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y());
|
||||
if (rotating) {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||
GL11.glClear(256);
|
||||
GL11.glEnable(3042);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
CraftGUI.Render.color(-1);
|
||||
GL11.glEnable(32826);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
public void renderIcon(IPoint pos, IIcon icon, ResourceLocation map) {
|
||||
if (icon == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(32826);
|
||||
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
BinnieCore.proxy.bindTexture(map);
|
||||
GuiScreen.itemRender.zLevel = zLevel;
|
||||
GuiScreen.itemRender.renderIcon((int) pos.x(), (int) pos.y(), icon, 16, 16);
|
||||
GL11.glEnable(32826);
|
||||
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public boolean isHelpMode() {
|
||||
return Keyboard.isKeyDown(15);
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_TAB);
|
||||
}
|
||||
|
||||
public FontRenderer getFontRenderer() {
|
||||
@@ -432,47 +436,42 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
float w = area.size().x();
|
||||
float h = area.size().y();
|
||||
y = height - (y + h);
|
||||
float k = xSize;
|
||||
float scaleX = width / (float) mc.displayWidth;
|
||||
float scaleY = height / (float) mc.displayHeight;
|
||||
x += 0.0f;
|
||||
y += 0.0f;
|
||||
w += 0.0f;
|
||||
h += 0.0f;
|
||||
GL11.glScissor((int) (x / scaleX), (int) (y / scaleY), (int) (w / scaleX), (int) (h / scaleY));
|
||||
}
|
||||
|
||||
public int getZLevel() {
|
||||
return (int) zLevel;
|
||||
}
|
||||
public void drawRect(float x, float y, float width, float height, int color) {
|
||||
if (x < width) {
|
||||
float temp = x;
|
||||
x = width;
|
||||
width = temp;
|
||||
}
|
||||
|
||||
public void drawRect(float p_73734_0_, float p_73734_1_, float p_73734_2_, float p_73734_3_, int p_73734_4_) {
|
||||
if (p_73734_0_ < p_73734_2_) {
|
||||
float j1 = p_73734_0_;
|
||||
p_73734_0_ = p_73734_2_;
|
||||
p_73734_2_ = j1;
|
||||
if (y < height) {
|
||||
float temp = y;
|
||||
y = height;
|
||||
height = temp;
|
||||
}
|
||||
if (p_73734_1_ < p_73734_3_) {
|
||||
float j1 = p_73734_1_;
|
||||
p_73734_1_ = p_73734_3_;
|
||||
p_73734_3_ = j1;
|
||||
}
|
||||
float f3 = (p_73734_4_ >> 24 & 0xFF) / 255.0f;
|
||||
float f4 = (p_73734_4_ >> 16 & 0xFF) / 255.0f;
|
||||
float f5 = (p_73734_4_ >> 8 & 0xFF) / 255.0f;
|
||||
float f6 = (p_73734_4_ & 0xFF) / 255.0f;
|
||||
|
||||
float alpha = (color >> 24 & 0xFF) / 255.0f;
|
||||
float r = (color >> 16 & 0xFF) / 255.0f;
|
||||
float g = (color >> 8 & 0xFF) / 255.0f;
|
||||
float b = (color & 0xFF) / 255.0f;
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glEnable(3042);
|
||||
GL11.glDisable(3553);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(f4, f5, f6, f3);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
GL11.glColor4f(r, g, b, alpha);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertex(p_73734_0_, p_73734_3_, 0.0);
|
||||
tessellator.addVertex(p_73734_2_, p_73734_3_, 0.0);
|
||||
tessellator.addVertex(p_73734_2_, p_73734_1_, 0.0);
|
||||
tessellator.addVertex(p_73734_0_, p_73734_1_, 0.0);
|
||||
tessellator.addVertex(x, height, 0.0);
|
||||
tessellator.addVertex(width, height, 0.0);
|
||||
tessellator.addVertex(width, y, 0.0);
|
||||
tessellator.addVertex(x, y, 0.0);
|
||||
tessellator.draw();
|
||||
GL11.glEnable(3553);
|
||||
GL11.glDisable(3042);
|
||||
GL11.glColor4f(1, 1, 1, 255);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -78,8 +78,8 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
ControlSlot.highlighting.put(h, new ArrayList<>());
|
||||
}
|
||||
|
||||
CraftGUI.Render = new Renderer(gui);
|
||||
CraftGUI.Render.stylesheet(StyleSheetManager.getDefault());
|
||||
CraftGUI.render = new Renderer(gui);
|
||||
CraftGUI.render.stylesheet(StyleSheetManager.getDefault());
|
||||
titleButtonLeft = -14.0f;
|
||||
|
||||
if (showHelpButton()) {
|
||||
@@ -211,15 +211,15 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.color(0xffffff);
|
||||
CraftGUI.render.color(0xffffff);
|
||||
if (getBackground1() != null) {
|
||||
CraftGUI.Render.texture(getBackground1(), IPoint.ZERO);
|
||||
CraftGUI.render.texture(getBackground1(), IPoint.ZERO);
|
||||
}
|
||||
if (getBackground2() != null) {
|
||||
CraftGUI.Render.texture(getBackground2(), new IPoint(256.0f, 0.0f));
|
||||
CraftGUI.render.texture(getBackground2(), new IPoint(256.0f, 0.0f));
|
||||
}
|
||||
CraftGUI.Render.color(getColor());
|
||||
CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
|
||||
CraftGUI.render.color(getColor());
|
||||
CraftGUI.render.texture(CraftGUITexture.Window, getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -85,9 +85,9 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.EnergyBarBack, getArea());
|
||||
float percentage = getPercentage() / 100.0f;
|
||||
CraftGUI.Render.color(getColourFromPercentage(percentage));
|
||||
CraftGUI.render.color(getColourFromPercentage(percentage));
|
||||
IArea area = getArea();
|
||||
|
||||
switch (direction) {
|
||||
@@ -106,27 +106,27 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
|
||||
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), c, c);
|
||||
} else if (ControlEnergyBar.isError) {
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR);
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), c, c);
|
||||
}
|
||||
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlow, area);
|
||||
CraftGUI.render.texture(CraftGUITexture.EnergyBarGlow, area);
|
||||
GL11.glColor3d(1.0, 1.0, 1.0);
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.EnergyBarGlass, getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.color(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
CraftGUI.render.color(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
|
||||
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
} else if (ControlEnergyBar.isError) {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.color(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
CraftGUI.render.color(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
|
||||
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
} else if (type == 0) {
|
||||
texture = CraftGUITexture.StateError;
|
||||
}
|
||||
CraftGUI.Render.texture(texture, IPoint.ZERO);
|
||||
CraftGUI.render.texture(texture, IPoint.ZERO);
|
||||
super.onRenderBackground();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class ControlHelp extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.HelpButton, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.HelpButton, getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,6 @@ public class ControlIconDisplay extends Control {
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
CraftGUI.Render.iconItem(IPoint.ZERO, icon);
|
||||
CraftGUI.render.iconItem(IPoint.ZERO, icon);
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,6 @@ public class ControlImage extends Control {
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
CraftGUI.Render.texture(key, IPoint.ZERO);
|
||||
CraftGUI.render.texture(key, IPoint.ZERO);
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class ControlInfo extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.InfoButton, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.InfoButton, getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,10 +60,10 @@ public class ControlItemDisplay extends Control implements ITooltip {
|
||||
GL11.glScalef(scale, scale, 1.0f);
|
||||
BinnieCore.proxy.getMinecraftInstance();
|
||||
float phase = Minecraft.getSystemTime() / 20.0f;
|
||||
CraftGUI.Render.item(IPoint.ZERO, itemStack, rotating);
|
||||
CraftGUI.render.item(IPoint.ZERO, itemStack, rotating);
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
CraftGUI.Render.item(IPoint.ZERO, itemStack, rotating);
|
||||
CraftGUI.render.item(IPoint.ZERO, itemStack, rotating);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,18 +72,18 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
|
||||
CraftGUI.render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
|
||||
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), c, c);
|
||||
} else if (ControlLiquidTank.tankError.contains(tankID)) {
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR);
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), c, c);
|
||||
} else if (getSuperParent().getMousedOverWidget() == this) {
|
||||
if (Window.get(this).getGui().getDraggedItem() != null) {
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), 0xaaff9999, 0xaaff9999);
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), 0xaaff9999, 0xaaff9999);
|
||||
} else {
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), 0x80ffffff, 0x80ffffff);
|
||||
CraftGUI.render.gradientRect(getArea().inset(1), 0x80ffffff, 0x80ffffff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
IPoint pos = getAbsolutePosition();
|
||||
IPoint offset = new IPoint(0.0f, height - squaled);
|
||||
IArea limited = getArea().inset(1);
|
||||
@@ -105,34 +105,35 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
limited.setSize(new IPoint(limited.w() - 1.0f, limited.h()));
|
||||
}
|
||||
|
||||
CraftGUI.Render.limitArea(new IArea(limited.pos().add(pos).add(offset), limited.size().sub(offset)));
|
||||
GL11.glEnable(3089);
|
||||
CraftGUI.render.limitArea(new IArea(limited.pos().add(pos).add(offset), limited.size().sub(offset)));
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
BinnieCore.proxy.bindTexture(TextureMap.locationItemsTexture);
|
||||
for (int y = 0; y < height; y += 16) {
|
||||
for (int x = 0; x < (horizontal ? 58 : 16); x += 16) {
|
||||
IIcon icon = fluid.getIcon();
|
||||
CraftGUI.Render.iconBlock(new IPoint(1 + x, 1 + y), icon);
|
||||
CraftGUI.render.iconBlock(new IPoint(x + 1, y + 1), icon);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glDisable(3089);
|
||||
GL11.glDisable(3042);
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1, 1, 1, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
CraftGUI.Render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
|
||||
CraftGUI.render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
|
||||
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.color(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
CraftGUI.render.color(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
|
||||
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
}
|
||||
|
||||
if (ControlLiquidTank.tankError.contains(tankID)) {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.color(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
CraftGUI.render.color(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
|
||||
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ControlPowerSystem extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.PowerButton, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.PowerButton, getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ControlProgress extends ControlProgressBase {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(progressBlank, getArea());
|
||||
CraftGUI.Render.texturePercentage(progressBar, getArea(), direction, progress);
|
||||
CraftGUI.render.texture(progressBlank, getArea());
|
||||
CraftGUI.render.texturePercentage(progressBar, getArea(), direction, progress);
|
||||
}
|
||||
}
|
||||
@@ -37,17 +37,17 @@ public class ControlSlide extends Control {
|
||||
public void onRenderBackground() {
|
||||
super.onRenderBackground();
|
||||
if (label != null) {
|
||||
float lw = CraftGUI.Render.textWidth(label) + 16;
|
||||
float lh = CraftGUI.Render.textHeight() + 16;
|
||||
float lw = CraftGUI.render.textWidth(label) + 16;
|
||||
float lh = CraftGUI.render.textHeight() + 16;
|
||||
boolean hor = anchor.x() != 0;
|
||||
IArea ar = isSlideActive() ? expanded : shrunk;
|
||||
IArea tabArea = new IArea(hor ? (-lh / 2.0f) : (-lw / 2.0f), hor ? (-lw / 2.0f) : (-lh / 2.0f), hor ? lh : lw, hor ? lw : lh);
|
||||
IPoint shift = new IPoint(ar.w() * (1 - anchor.x()) / 2.0f, ar.h() * (1 - anchor.y()) / 2.0f);
|
||||
tabArea = tabArea.shift(shift.x() - (-3.0f + lh / 2.0f) * anchor.x(), shift.y() - (-3.0f + lh / 2.0f) * anchor.y());
|
||||
Texture texture = CraftGUI.Render.getTexture(isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(anchor.opposite(), 8.0f);
|
||||
CraftGUI.Render.texture(texture, tabArea);
|
||||
texture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline).crop(anchor.opposite(), 8.0f);
|
||||
CraftGUI.Render.texture(texture, tabArea.inset(2));
|
||||
Texture texture = CraftGUI.render.getTexture(isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(anchor.opposite(), 8.0f);
|
||||
CraftGUI.render.texture(texture, tabArea);
|
||||
texture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline).crop(anchor.opposite(), 8.0f);
|
||||
CraftGUI.render.texture(texture, tabArea.inset(2));
|
||||
IArea labelArea = new IArea(-lw / 2.0f, 0.0f, lw, lh);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(shift.x() + anchor.x() * 2.0f, shift.y() + anchor.y() * 2.0f, 0.0f);
|
||||
@@ -57,12 +57,12 @@ public class ControlSlide extends Control {
|
||||
if (anchor.y() > 0) {
|
||||
GL11.glTranslatef(0.0f, -lh, 0.0f);
|
||||
}
|
||||
CraftGUI.Render.text(labelArea, TextJustification.MIDDLE_CENTER, label, 16777215);
|
||||
CraftGUI.render.text(labelArea, TextJustification.MIDDLE_CENTER, label, 16777215);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.Window, getArea());
|
||||
Object slideTexture = (anchor == Position.BOTTOM) ? CraftGUITexture.SlideDown : ((anchor == Position.TOP) ? CraftGUITexture.SlideUp : ((anchor == Position.LEFT) ? CraftGUITexture.SlideLeft : CraftGUITexture.SlideRight));
|
||||
CraftGUI.Render.texture(slideTexture, new IPoint((anchor.x() + 1.0f) * w() / 2.0f - 8.0f, (anchor.y() + 1.0f) * h() / 2.0f - 8.0f));
|
||||
CraftGUI.render.texture(slideTexture, new IPoint((anchor.x() + 1.0f) * w() / 2.0f - 8.0f, (anchor.y() + 1.0f) * h() / 2.0f - 8.0f));
|
||||
}
|
||||
|
||||
public boolean isSlideActive() {
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.Slot, IPoint.ZERO);
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
|
||||
if (slot == null) {
|
||||
return;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
if (islot != null && islot.getValidator() != null) {
|
||||
IIcon icon = islot.getValidator().getIcon(!islot.getInputSides().isEmpty());
|
||||
if (icon != null) {
|
||||
CraftGUI.Render.iconItem(new IPoint(1.0f, 1.0f), icon);
|
||||
CraftGUI.render.iconItem(new IPoint(1.0f, 1.0f), icon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,13 +90,13 @@ public class ControlSlot extends ControlSlotBase {
|
||||
|
||||
highlighted = true;
|
||||
int c = 0xaa000000 + Math.min(highlight.getKey().getColour(), 0xffffff);
|
||||
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), c, c);
|
||||
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), c, c);
|
||||
}
|
||||
if (!highlighted && getSuperParent().getMousedOverWidget() == this) {
|
||||
if (Window.get(this).getGui().getDraggedItem() != null && !slot.isItemValid(Window.get(this).getGui().getDraggedItem())) {
|
||||
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), 0xaaff9999, 0xaaff9999);
|
||||
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), 0xaaff9999, 0xaaff9999);
|
||||
} else {
|
||||
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), 0x80ffffff, 0x80ffffff);
|
||||
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), 0x80ffffff, 0x80ffffff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,8 +123,8 @@ public class ControlSlot extends ControlSlotBase {
|
||||
area = getParent().getArea();
|
||||
area.setPosition(IPoint.ZERO.sub(getPosition()));
|
||||
}
|
||||
CraftGUI.Render.color(c);
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
CraftGUI.render.color(c);
|
||||
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.Slot, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, getArea());
|
||||
if (getSuperParent().getMousedOverWidget() == this) {
|
||||
CraftGUI.Render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), getArea().size().sub(new IPoint(2.0f, 2.0f))), 0x80ffffff, 0x80ffffff);
|
||||
CraftGUI.render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), getArea().size().sub(new IPoint(2.0f, 2.0f))), 0x80ffffff, 0x80ffffff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ public class ControlSlotCharge extends Control {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
|
||||
CraftGUI.Render.texturePercentage(CraftGUI.Render.getTexture(CraftGUITexture.SlotCharge), getArea().inset(1), Position.BOTTOM, getCharge());
|
||||
CraftGUI.render.texture(CraftGUITexture.PanelBlack, getArea());
|
||||
CraftGUI.render.texturePercentage(CraftGUI.render.getTexture(CraftGUITexture.SlotCharge), getArea().inset(1), Position.BOTTOM, getCharge());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ControlUser extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.UserButton, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.UserButton, getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,12 +18,12 @@ import java.util.List;
|
||||
|
||||
public class Renderer {
|
||||
protected GuiCraftGUI gui;
|
||||
protected int currentColour;
|
||||
protected int currentColor;
|
||||
protected Texture currentTexture;
|
||||
protected IStyleSheet stylesheet;
|
||||
|
||||
public Renderer(GuiCraftGUI gui) {
|
||||
currentColour = 16777215;
|
||||
currentColor = 0xffffff;
|
||||
this.gui = gui;
|
||||
}
|
||||
|
||||
@@ -31,37 +31,38 @@ public class Renderer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(widget.getPosition().x(), widget.getPosition().y(), 0.0f);
|
||||
color(widget.getColor());
|
||||
if (widget.isCroppedWidet()) {
|
||||
if (widget.isCroppedWidget()) {
|
||||
IWidget cropRelative = (widget.getCropWidget() != null) ? widget.getCropWidget() : widget;
|
||||
IPoint pos = cropRelative.getAbsolutePosition();
|
||||
IArea cropZone = widget.getCroppedZone();
|
||||
GL11.glEnable(3089);
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
limitArea(new IArea(pos.add(cropZone.pos()), cropZone.size()));
|
||||
|
||||
}
|
||||
GL11.glDisable(2929);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
public void postRender(IWidget widget) {
|
||||
if (widget.isCroppedWidet()) {
|
||||
GL11.glDisable(3089);
|
||||
if (widget.isCroppedWidget()) {
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
}
|
||||
GL11.glEnable(2929);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void color(int hex) {
|
||||
currentColour = hex;
|
||||
currentColor = hex;
|
||||
int a = (hex & 0xFF000000) >> 24;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
if (a < 0) {
|
||||
a += 256;
|
||||
}
|
||||
|
||||
if (a > 0 && a != 255) {
|
||||
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
|
||||
GL11.glEnable(3042);
|
||||
} else {
|
||||
GL11.glColor3f(r / 255.0f, g / 255.0f, b / 255.0f);
|
||||
}
|
||||
@@ -78,7 +79,7 @@ public class Renderer {
|
||||
if (texture != currentTexture && texture != null) {
|
||||
BinnieCore.proxy.bindTexture(texture.getFilename());
|
||||
}
|
||||
color(currentColour);
|
||||
color(currentColor);
|
||||
}
|
||||
|
||||
public void texture(Object texture, IPoint position) {
|
||||
@@ -89,6 +90,7 @@ public class Renderer {
|
||||
if (texture == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTexture(texture);
|
||||
IPoint point = position.sub(new IPoint(texture.getBorder().l(), texture.getBorder().t()));
|
||||
IArea textureArea = texture.getArea().outset(texture.getBorder());
|
||||
@@ -103,6 +105,7 @@ public class Renderer {
|
||||
if (texture == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTexture(texture);
|
||||
IArea textureArea = texture.getArea().outset(texture.getBorder());
|
||||
IArea targetArea = area.outset(texture.getBorder());
|
||||
@@ -146,7 +149,7 @@ public class Renderer {
|
||||
float stringWidth = textWidth(string);
|
||||
float posX = area.size().x() - stringWidth;
|
||||
posX *= justification.getXOffset();
|
||||
GL11.glDisable(2929);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
gui.getFontRenderer().drawString(string, (int) (pos.x() + posX), (int) posY, colour);
|
||||
posY += textHeight();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class StyleSheetManager {
|
||||
private static class DefaultStyleSheet implements IStyleSheet {
|
||||
@Override
|
||||
public Texture getTexture(Object key) {
|
||||
return CraftGUI.ResourceManager.getTexture(key.toString());
|
||||
return CraftGUI.resourceManager.getTexture(key.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
|
||||
public CraftGUIResourceManager() {
|
||||
textureSheets = new HashMap<>();
|
||||
textures = new HashMap<>();
|
||||
CraftGUI.ResourceManager = this;
|
||||
CraftGUI.resourceManager = this;
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ public enum CraftGUITextureSheet implements IBinnieTexture {
|
||||
if (BinnieCore.proxy.isServer()) {
|
||||
return null;
|
||||
}
|
||||
return CraftGUI.ResourceManager.getTextureSheet(name).getTexture();
|
||||
return CraftGUI.resourceManager.getTextureSheet(name).getTexture();
|
||||
}
|
||||
}
|
||||
@@ -25,23 +25,23 @@ public class Panel extends Control {
|
||||
if (panelType instanceof MinecraftGUI.PanelType) {
|
||||
switch ((MinecraftGUI.PanelType) panelType) {
|
||||
case Black:
|
||||
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.PanelBlack, getArea());
|
||||
break;
|
||||
|
||||
case Gray:
|
||||
CraftGUI.Render.texture(CraftGUITexture.PanelGray, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.PanelGray, getArea());
|
||||
break;
|
||||
|
||||
case Tinted:
|
||||
CraftGUI.Render.texture(CraftGUITexture.PanelTinted, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.PanelTinted, getArea());
|
||||
break;
|
||||
|
||||
case Outline:
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.Outline, getArea());
|
||||
break;
|
||||
|
||||
case TabOutline:
|
||||
CraftGUI.Render.texture(CraftGUITexture.TabOutline, getArea());
|
||||
CraftGUI.render.texture(CraftGUITexture.TabOutline, getArea());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.botany.items.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--;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,6 @@ class ControlColourSelector extends Control implements ITooltip, IControlValue<E
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
super.onRenderBackground();
|
||||
CraftGUI.Render.gradientRect(getArea(), 0xff000000 + value.getColor(), 0xff000000 + value.getColor());
|
||||
CraftGUI.render.gradientRect(getArea(), 0xff000000 + value.getColor(), 0xff000000 + value.getColor());
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -162,9 +161,9 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
Panel panel = new Panel(thisPage, 0.0f, 0.0f, thisPage.w(), thisPage.h(), MinecraftGUI.PanelType.Black) {
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
Texture iTexture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline);
|
||||
CraftGUI.Render.color(getTab(panels.get(this)).getColor().getColor());
|
||||
CraftGUI.Render.texture(iTexture, getArea().inset(3));
|
||||
Texture iTexture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline);
|
||||
CraftGUI.render.color(getTab(panels.get(this)).getColor().getColor());
|
||||
CraftGUI.render.texture(iTexture, getArea().inset(3));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -314,8 +313,8 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
ControlScrollableContent<IWidget> scroll = new ControlScrollableContent<IWidget>(this, 124.0f, 16.0f, 116.0f, 92.0f, 6.0f) {
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.color(11184810);
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, getArea().inset(new IBorder(0.0f, 6.0f, 0.0f, 0.0f)));
|
||||
CraftGUI.render.color(11184810);
|
||||
CraftGUI.render.texture(CraftGUITexture.Outline, getArea().inset(new IBorder(0.0f, 6.0f, 0.0f, 0.0f)));
|
||||
}
|
||||
};
|
||||
slotGrid = new Control(scroll, 1.0f, 1.0f, 108.0f, 18.0f);
|
||||
@@ -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());
|
||||
@@ -482,7 +481,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
Object texture = isMouseOver() ? CraftGUITexture.TabHighlighted : CraftGUITexture.Tab;
|
||||
CraftGUI.Render.texture(CraftGUI.Render.getTexture(texture).crop(Position.BOTTOM, 8.0f), getArea());
|
||||
CraftGUI.render.texture(CraftGUI.render.getTexture(texture).crop(Position.BOTTOM, 8.0f), getArea());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.item.Item;
|
||||
@Mod(
|
||||
modid = "ExtraBees",
|
||||
name = "Extra Bees",
|
||||
version = BinnieCore.VERSION,
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore"
|
||||
)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Loaded 100 of 272 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user