Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29d8fed2a3 | ||
|
|
9b05c7e7d2 | ||
|
|
a2d9c9f791 | ||
|
|
c6a72a489c | ||
|
|
71f71514ae | ||
|
|
74a0fcd883 | ||
|
|
eb36ee9260 | ||
|
|
5988871448 | ||
|
|
5bb88e9115 | ||
|
|
1591cdab8b | ||
|
|
42dd7e3fb5 | ||
|
|
d62c5d0054 | ||
|
|
e20df09909 | ||
|
|
b813b75a8b | ||
|
|
52d9d1aedc | ||
|
|
50bed12f66 | ||
|
|
0d6d7ff9aa | ||
|
|
0b7ae46d2e | ||
|
|
a0cfcc9da6 | ||
|
|
171c5b29f6 | ||
|
|
b5ad490947 | ||
|
|
00051c4594 | ||
|
|
d913e245ed | ||
|
|
f253dfc5dc | ||
|
|
6582ea3e56 | ||
|
|
bb96e7deae | ||
|
|
7643d11e14 |
No files matched your search
@@ -32,6 +32,7 @@
|
|||||||
*.[dD][lL][lL] binary
|
*.[dD][lL][lL] binary
|
||||||
*.[dD][yY][lL][iI][bB] binary
|
*.[dD][yY][lL][iI][bB] binary
|
||||||
*.[pP][sS][dD] binary
|
*.[pP][sS][dD] binary
|
||||||
|
*.[pP][dD][nN] binary
|
||||||
*.[tT][tT][fF] binary
|
*.[tT][tT][fF] binary
|
||||||
*.[oO][tT][fF] binary
|
*.[oO][tT][fF] binary
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ name: Build and test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
push:
|
push:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ whitelist.json
|
|||||||
*.iws
|
*.iws
|
||||||
src/main/resources/mixins.*([!.]).json
|
src/main/resources/mixins.*([!.]).json
|
||||||
*.bat
|
*.bat
|
||||||
|
*.sh
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
!gradlew.bat
|
!gradlew.bat
|
||||||
.factorypath
|
.factorypath
|
||||||
@@ -35,4 +36,4 @@ addon.local.gradle
|
|||||||
addon.local.gradle.kts
|
addon.local.gradle.kts
|
||||||
addon.late.local.gradle
|
addon.late.local.gradle
|
||||||
addon.late.local.gradle.kts
|
addon.late.local.gradle.kts
|
||||||
layout.json
|
layout.json
|
||||||
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 219 B |
@@ -1,12 +1,12 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api('com.github.GTNewHorizons:ForestryMC:4.11.12:dev')
|
api('com.github.GTNewHorizons:ForestryMC:4.11.39:dev')
|
||||||
implementation('com.github.GTNewHorizons:GTNHLib:0.9.48:dev')
|
implementation('com.github.GTNewHorizons:GTNHLib:0.11.54:dev')
|
||||||
|
|
||||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.97-GTNH:dev')
|
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.162-GTNH:dev')
|
||||||
|
|
||||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.57:api')
|
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.64:api')
|
||||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||||
}
|
}
|
||||||
@@ -186,6 +186,11 @@ modrinthRelations =
|
|||||||
# Leave this empty if you don't want to publish on CurseForge.
|
# Leave this empty if you don't want to publish on CurseForge.
|
||||||
curseForgeProjectId =
|
curseForgeProjectId =
|
||||||
|
|
||||||
|
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
|
||||||
|
# Use client or server for mods that only support one environment. Defaults to client,server.
|
||||||
|
# These tags describe where the mod can run, not whether installation is required on both sides.
|
||||||
|
curseForgeEnvironments = client,server
|
||||||
|
|
||||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||||
# Syntax: type1:name1;type2:name2;...
|
# Syntax: type1:name1;type2:name2;...
|
||||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#This file is generated by updateDaemonJvm
|
#This file is generated by updateDaemonJvm
|
||||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
|
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect
|
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect
|
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||||
toolchainVersion=25
|
toolchainVersion=25
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
retries=0
|
||||||
|
retryBackOffMs=500
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Gradle start up script for POSIX generated by Gradle.
|
# gradlew start up script for POSIX generated by Gradle.
|
||||||
#
|
#
|
||||||
# Important for running:
|
# Important for running:
|
||||||
#
|
#
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
# bash, then to run this script, type that shell name before the whole
|
# bash, then to run this script, type that shell name before the whole
|
||||||
# command line, like:
|
# command line, like:
|
||||||
#
|
#
|
||||||
# ksh Gradle
|
# ksh gradlew
|
||||||
#
|
#
|
||||||
# Busybox and similar reduced shells will NOT work, because this script
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
# requires all of these POSIX shell features:
|
# requires all of these POSIX shell features:
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem gradlew startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
setlocal EnableExtensions
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
|||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
@@ -65,29 +65,18 @@ echo. 1>&2
|
|||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute gradlew
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||||
|
@rem which allows us to clear the local environment before executing the java command
|
||||||
|
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||||
|
|
||||||
:end
|
:exitWithErrorLevel
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
||||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
||||||
exit /b %EXIT_CODE%
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
@@ -17,5 +17,5 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.34'
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
@@ -19,18 +21,25 @@ import net.minecraft.world.World;
|
|||||||
import binnie.Binnie;
|
import binnie.Binnie;
|
||||||
import binnie.botany.Botany;
|
import binnie.botany.Botany;
|
||||||
import binnie.botany.CreativeTabBotany;
|
import binnie.botany.CreativeTabBotany;
|
||||||
|
import binnie.botany.api.EnumFlowerChromosome;
|
||||||
import binnie.botany.api.EnumFlowerStage;
|
import binnie.botany.api.EnumFlowerStage;
|
||||||
|
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||||
import binnie.botany.api.IFlower;
|
import binnie.botany.api.IFlower;
|
||||||
import binnie.botany.api.IFlowerColor;
|
import binnie.botany.api.IFlowerColor;
|
||||||
import binnie.botany.api.IFlowerGenome;
|
import binnie.botany.api.IFlowerGenome;
|
||||||
import binnie.botany.api.IFlowerType;
|
import binnie.botany.api.IFlowerType;
|
||||||
import binnie.botany.core.BotanyCore;
|
import binnie.botany.core.BotanyCore;
|
||||||
|
import binnie.botany.genetics.AlleleColor;
|
||||||
|
import binnie.botany.genetics.EnumFlowerColor;
|
||||||
import binnie.botany.genetics.EnumFlowerType;
|
import binnie.botany.genetics.EnumFlowerType;
|
||||||
import binnie.botany.genetics.Flower;
|
import binnie.botany.genetics.Flower;
|
||||||
|
import binnie.botany.genetics.FlowerSpecies;
|
||||||
import binnie.core.BinnieCore;
|
import binnie.core.BinnieCore;
|
||||||
import binnie.core.util.I18N;
|
import binnie.core.util.I18N;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import forestry.api.genetics.AlleleManager;
|
||||||
|
import forestry.api.genetics.IAllele;
|
||||||
import forestry.api.genetics.IIndividual;
|
import forestry.api.genetics.IIndividual;
|
||||||
import forestry.api.genetics.IPollinatable;
|
import forestry.api.genetics.IPollinatable;
|
||||||
import forestry.core.config.Config;
|
import forestry.core.config.Config;
|
||||||
@@ -61,12 +70,44 @@ public abstract class ItemBotany extends Item {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static IAllele getRenderAllele(ItemStack stack, EnumFlowerChromosome chromosome, boolean active) {
|
||||||
|
if (stack == null || !stack.hasTagCompound()) return null;
|
||||||
|
|
||||||
|
NBTTagCompound genome = stack.getTagCompound().getCompoundTag("Genome");
|
||||||
|
NBTTagList chromosomes = genome.getTagList("Chromosomes", 10);
|
||||||
|
int slot = chromosome.ordinal();
|
||||||
|
NBTTagCompound chromosomeTag = null;
|
||||||
|
for (int index = chromosomes.tagCount() - 1; index >= 0; index--) {
|
||||||
|
NBTTagCompound candidate = chromosomes.getCompoundTagAt(index);
|
||||||
|
if (candidate.getByte("Slot") == slot) {
|
||||||
|
chromosomeTag = candidate;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (chromosomeTag == null) return null;
|
||||||
|
|
||||||
|
Class<? extends IAllele> alleleClass = chromosome.getAlleleClass();
|
||||||
|
IAllele primary = AlleleManager.alleleRegistry.getAllele(chromosomeTag.getString("UID0"));
|
||||||
|
if (!alleleClass.isInstance(primary)) return null;
|
||||||
|
IAllele secondary = AlleleManager.alleleRegistry.getAllele(chromosomeTag.getString("UID1"));
|
||||||
|
if (!alleleClass.isInstance(secondary)) return null;
|
||||||
|
if (!active) return primary;
|
||||||
|
|
||||||
|
if (primary.isDominant()) return primary;
|
||||||
|
return secondary.isDominant() ? secondary : primary;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasEffect(ItemStack stack, int pass) {
|
public boolean hasEffect(ItemStack stack, int pass) {
|
||||||
if (!stack.hasTagCompound()) {
|
if (!stack.hasTagCompound()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IAllele allele = getRenderAllele(stack, EnumFlowerChromosome.SPECIES, false);
|
||||||
|
if (allele instanceof IAlleleFlowerSpecies species) {
|
||||||
|
return species.hasEffect();
|
||||||
|
}
|
||||||
|
|
||||||
IIndividual individual = getIndividual(stack);
|
IIndividual individual = getIndividual(stack);
|
||||||
return individual != null && individual.getGenome() != null && individual.hasEffect();
|
return individual != null && individual.getGenome() != null && individual.hasEffect();
|
||||||
}
|
}
|
||||||
@@ -152,6 +193,17 @@ public abstract class ItemBotany extends Item {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getColorFromItemStack(ItemStack itemstack, int renderPass) {
|
public int getColorFromItemStack(ItemStack itemstack, int renderPass) {
|
||||||
|
if (!itemstack.hasTagCompound()) {
|
||||||
|
return (renderPass == 0 ? EnumFlowerColor.GREEN : EnumFlowerColor.RED).getColor(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
EnumFlowerChromosome chromosome = renderPass == 0 ? EnumFlowerChromosome.STEM
|
||||||
|
: renderPass == 1 ? EnumFlowerChromosome.PRIMARY : EnumFlowerChromosome.SECONDARY;
|
||||||
|
IAllele allele = getRenderAllele(itemstack, chromosome, true);
|
||||||
|
if (allele instanceof AlleleColor color) {
|
||||||
|
return color.getColor().getColor(itemstack.getTagCompound().getBoolean("Wilt"));
|
||||||
|
}
|
||||||
|
|
||||||
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
||||||
if (flower == null || flower.getGenome() == null) {
|
if (flower == null || flower.getGenome() == null) {
|
||||||
return 0xffffff;
|
return 0xffffff;
|
||||||
@@ -177,19 +229,32 @@ public abstract class ItemBotany extends Item {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(ItemStack itemstack, int renderPass) {
|
public IIcon getIcon(ItemStack itemstack, int renderPass) {
|
||||||
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
IAlleleFlowerSpecies species = FlowerSpecies.POPPY;
|
||||||
if (flower == null || flower.getGenome() == null || flower.getGenome().getPrimary() == null) {
|
boolean flowered = false;
|
||||||
return EnumFlowerType.ALLIUM.getBlank();
|
|
||||||
|
if (itemstack.hasTagCompound()) {
|
||||||
|
IAllele allele = getRenderAllele(itemstack, EnumFlowerChromosome.SPECIES, false);
|
||||||
|
if (allele instanceof IAlleleFlowerSpecies flowerSpecies) {
|
||||||
|
species = flowerSpecies;
|
||||||
|
flowered = itemstack.getTagCompound().getBoolean("Flowered");
|
||||||
|
} else {
|
||||||
|
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
||||||
|
if (flower == null || flower.getGenome() == null || flower.getGenome().getPrimary() == null) {
|
||||||
|
return EnumFlowerType.ALLIUM.getBlank();
|
||||||
|
}
|
||||||
|
species = flower.getGenome().getPrimary();
|
||||||
|
flowered = flower.hasFlowered();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IFlowerType type = flower.getGenome().getPrimary().getType();
|
IFlowerType type = species.getType();
|
||||||
if (renderPass == 0) {
|
if (renderPass == 0) {
|
||||||
return type.getStem(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
return type.getStem(getStage(), flowered, type.getSections() - 1);
|
||||||
}
|
}
|
||||||
if (renderPass == 1) {
|
if (renderPass == 1) {
|
||||||
return type.getPetalIcon(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
return type.getPetalIcon(getStage(), flowered, type.getSections() - 1);
|
||||||
}
|
}
|
||||||
return type.getVariantIcon(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
return type.getVariantIcon(getStage(), flowered, type.getSections() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ public class ItemInsulatedTube extends Item {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||||
for (Material mat : Material.values()) {
|
for (Material mat : Material.VALUES) {
|
||||||
for (Insulate ins : Insulate.values()) {
|
for (Insulate ins : Insulate.VALUES) {
|
||||||
list.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
list.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,6 +97,8 @@ public class ItemInsulatedTube extends Item {
|
|||||||
Bronze(0xddc276, "bronze"),
|
Bronze(0xddc276, "bronze"),
|
||||||
Iron(0xd8d8d8, "iron");
|
Iron(0xd8d8d8, "iron");
|
||||||
|
|
||||||
|
public static final Material[] VALUES = values();
|
||||||
|
|
||||||
private final int color;
|
private final int color;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
@@ -106,7 +108,7 @@ public class ItemInsulatedTube extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Material get(int i) {
|
public static Material get(int i) {
|
||||||
return values()[i % values().length];
|
return VALUES[i % VALUES.length];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getColor() {
|
public int getColor() {
|
||||||
@@ -127,6 +129,8 @@ public class ItemInsulatedTube extends Item {
|
|||||||
Stone(0x6d6d6d, "smoothStone"),
|
Stone(0x6d6d6d, "smoothStone"),
|
||||||
Sandstone(0xc1b989, "sandstone");
|
Sandstone(0xc1b989, "sandstone");
|
||||||
|
|
||||||
|
public static final Insulate[] VALUES = values();
|
||||||
|
|
||||||
private final int color;
|
private final int color;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
@@ -136,7 +140,7 @@ public class ItemInsulatedTube extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Insulate get(int i) {
|
public static Insulate get(int i) {
|
||||||
return values()[i / 128 % values().length];
|
return VALUES[i / 128 % VALUES.length];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getColor() {
|
public int getColor() {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class BlockPlant extends BlockBush {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister register) {
|
public void registerBlockIcons(IIconRegister register) {
|
||||||
for (Type t : Type.values()) {
|
for (Type t : Type.VALUES) {
|
||||||
t.icon = Botany.proxy.getIcon(register, t.name().toLowerCase());
|
t.icon = Botany.proxy.getIcon(register, t.name().toLowerCase());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ public class BlockPlant extends BlockBush {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return Type.values()[meta % Type.values().length].icon;
|
return Type.VALUES[meta % Type.VALUES.length].icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -72,7 +72,7 @@ public class BlockPlant extends BlockBush {
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||||
for (Type type : Type.values()) {
|
for (Type type : Type.VALUES) {
|
||||||
list.add(type.get());
|
list.add(type.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,6 +135,7 @@ public class BlockPlant extends BlockBush {
|
|||||||
DeadFlower("deadFlower"),
|
DeadFlower("deadFlower"),
|
||||||
DecayingFlower("decayingFlower");
|
DecayingFlower("decayingFlower");
|
||||||
|
|
||||||
|
public static final Type[] VALUES = values();
|
||||||
public IIcon icon;
|
public IIcon icon;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
@@ -144,7 +145,7 @@ public class BlockPlant extends BlockBush {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Type get(int id) {
|
public static Type get(int id) {
|
||||||
return values()[id % values().length];
|
return VALUES[id % VALUES.length];
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack get() {
|
public ItemStack get() {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class ItemWeed extends ItemBlock {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName(ItemStack stack) {
|
public String getItemStackDisplayName(ItemStack stack) {
|
||||||
return BlockPlant.Type.values()[stack.getItemDamage()].getName();
|
return BlockPlant.Type.VALUES[stack.getItemDamage()].getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,7 +8,13 @@ import forestry.core.genetics.alleles.EnumAllele;
|
|||||||
|
|
||||||
public class FlowerTemplates {
|
public class FlowerTemplates {
|
||||||
|
|
||||||
|
private static IAllele[] defaultTemplate;
|
||||||
|
|
||||||
public static IAllele[] getDefaultTemplate() {
|
public static IAllele[] getDefaultTemplate() {
|
||||||
|
if (defaultTemplate != null) {
|
||||||
|
return defaultTemplate.clone();
|
||||||
|
}
|
||||||
|
|
||||||
IAllele[] alleles = new IAllele[EnumFlowerChromosome.VALUES.length];
|
IAllele[] alleles = new IAllele[EnumFlowerChromosome.VALUES.length];
|
||||||
alleles[EnumFlowerChromosome.SPECIES.ordinal()] = FlowerSpecies.POPPY;
|
alleles[EnumFlowerChromosome.SPECIES.ordinal()] = FlowerSpecies.POPPY;
|
||||||
alleles[EnumFlowerChromosome.PRIMARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
alleles[EnumFlowerChromosome.PRIMARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
||||||
@@ -22,6 +28,13 @@ public class FlowerTemplates {
|
|||||||
alleles[EnumFlowerChromosome.PH_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
alleles[EnumFlowerChromosome.PH_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
||||||
alleles[EnumFlowerChromosome.SAPPINESS.ordinal()] = AlleleHelper.getAllele(EnumAllele.Sappiness.AVERAGE);
|
alleles[EnumFlowerChromosome.SAPPINESS.ordinal()] = AlleleHelper.getAllele(EnumAllele.Sappiness.AVERAGE);
|
||||||
alleles[EnumFlowerChromosome.STEM.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.GREEN);
|
alleles[EnumFlowerChromosome.STEM.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.GREEN);
|
||||||
return alleles;
|
|
||||||
|
for (IAllele allele : alleles) {
|
||||||
|
// Do not cache a partial template during registry initialization.
|
||||||
|
if (allele == null) return alleles;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultTemplate = alleles;
|
||||||
|
return defaultTemplate.clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,8 @@ public class ItemMetadata extends ItemBlock {
|
|||||||
|
|
||||||
public ItemMetadata(Block block) {
|
public ItemMetadata(Block block) {
|
||||||
super(block);
|
super(block);
|
||||||
|
setMaxDamage(0);
|
||||||
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package binnie.core.craftgui;
|
package binnie.core.craftgui;
|
||||||
|
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Deque;
|
import java.util.Deque;
|
||||||
import java.util.List;
|
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
|
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
@@ -168,17 +165,14 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Deque<IWidget> calculateMousedOverWidgets() {
|
public Deque<IWidget> calculateMousedOverWidgets() {
|
||||||
Deque<IWidget> list = new ArrayDeque<>();
|
Deque<IWidget> widgets = new ArrayDeque<>();
|
||||||
for (IWidget widget : getQueuedWidgets(this)) {
|
addMousedOverWidgets(this, widgets);
|
||||||
if (widget.calculateIsMouseOver()) {
|
return widgets;
|
||||||
list.addLast(widget);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Collection<IWidget> getQueuedWidgets(IWidget widget) {
|
private void addMousedOverWidgets(IWidget widget, Deque<IWidget> widgets) {
|
||||||
List<IWidget> widgets = new ArrayList<>();
|
if (!widget.isVisible()) return;
|
||||||
|
|
||||||
boolean addChildren = true;
|
boolean addChildren = true;
|
||||||
if (widget.isCroppedWidget()) {
|
if (widget.isCroppedWidget()) {
|
||||||
addChildren = widget.getCroppedZone().contains(widget.getCropWidget().getRelativeMousePosition());
|
addChildren = widget.getCroppedZone().contains(widget.getCropWidget().getRelativeMousePosition());
|
||||||
@@ -188,11 +182,12 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
|
|||||||
ListIterator<IWidget> li = widget.getWidgets().listIterator(widget.getWidgets().size());
|
ListIterator<IWidget> li = widget.getWidgets().listIterator(widget.getWidgets().size());
|
||||||
while (li.hasPrevious()) {
|
while (li.hasPrevious()) {
|
||||||
IWidget child = li.previous();
|
IWidget child = li.previous();
|
||||||
widgets.addAll(getQueuedWidgets(child));
|
addMousedOverWidgets(child, widgets);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
widgets.add(widget);
|
if (widget.calculateIsMouseOver()) {
|
||||||
return widgets;
|
widgets.addLast(widget);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ public class Widget implements IWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOffset(IPoint offset) {
|
public void setOffset(IPoint offset) {
|
||||||
if (offset != this.offset) {
|
if (!offset.equals(this.offset)) {
|
||||||
this.offset = new IPoint(offset);
|
this.offset = new IPoint(offset);
|
||||||
callEvent(new EventWidget.ChangeOffset(this));
|
callEvent(new EventWidget.ChangeOffset(this));
|
||||||
}
|
}
|
||||||
@@ -285,6 +285,10 @@ public class Widget implements IWidget {
|
|||||||
onRender(RenderStage.PreChildren);
|
onRender(RenderStage.PreChildren);
|
||||||
|
|
||||||
for (IWidget widget : getWidgets()) {
|
for (IWidget widget : getWidgets()) {
|
||||||
|
if (!widget.isVisible()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
widget.render();
|
widget.render();
|
||||||
CraftGUI.render.preRender(widget);
|
CraftGUI.render.preRender(widget);
|
||||||
widget.onRender(RenderStage.PostSiblings);
|
widget.onRender(RenderStage.PostSiblings);
|
||||||
@@ -306,17 +310,22 @@ public class Widget implements IWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onUpdateClient();
|
onUpdateClient();
|
||||||
List<IWidget> deletedWidgets = new ArrayList<>();
|
List<IWidget> deletedWidgets = null;
|
||||||
for (IWidget widget : getWidgets()) {
|
for (IWidget widget : getWidgets()) {
|
||||||
if (widget.hasAttribute(WidgetAttribute.NEEDS_DELETION)) {
|
if (widget.hasAttribute(WidgetAttribute.NEEDS_DELETION)) {
|
||||||
|
if (deletedWidgets == null) {
|
||||||
|
deletedWidgets = new ArrayList<>();
|
||||||
|
}
|
||||||
deletedWidgets.add(widget);
|
deletedWidgets.add(widget);
|
||||||
} else {
|
} else {
|
||||||
widget.updateClient();
|
widget.updateClient();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (IWidget widget : deletedWidgets) {
|
if (deletedWidgets != null) {
|
||||||
deleteChild(widget);
|
for (IWidget widget : deletedWidgets) {
|
||||||
|
deleteChild(widget);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +347,7 @@ public class Widget implements IWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isMouseOverWidget(IPoint relativeMouse) {
|
public boolean isMouseOverWidget(IPoint relativeMouse) {
|
||||||
return getArea().contains(relativeMouse);
|
return contains(relativeMouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -466,7 +475,8 @@ public class Widget implements IWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(IPoint position) {
|
public boolean contains(IPoint position) {
|
||||||
return getArea().contains(position);
|
IPoint size = size();
|
||||||
|
return position.x() >= 0.0f && position.y() >= 0.0f && position.x() <= size.x() && position.y() <= size.y();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package binnie.core.craftgui.controls.tab;
|
package binnie.core.craftgui.controls.tab;
|
||||||
|
|
||||||
|
import java.util.IdentityHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import binnie.core.craftgui.CraftGUI;
|
import binnie.core.craftgui.CraftGUI;
|
||||||
import binnie.core.craftgui.ITooltip;
|
import binnie.core.craftgui.ITooltip;
|
||||||
import binnie.core.craftgui.Tooltip;
|
import binnie.core.craftgui.Tooltip;
|
||||||
@@ -21,6 +24,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
|||||||
protected T value;
|
protected T value;
|
||||||
|
|
||||||
private final ControlTabBar<T> tabBar;
|
private final ControlTabBar<T> tabBar;
|
||||||
|
private final Map<Texture, Texture> croppedTextures = new IdentityHashMap<>();
|
||||||
|
|
||||||
public ControlTab(ControlTabBar<T> parent, float x, float y, float w, float h, T value) {
|
public ControlTab(ControlTabBar<T> parent, float x, float y, float w, float h, T value) {
|
||||||
super(parent, x, y, w, h);
|
super(parent, x, y, w, h);
|
||||||
@@ -45,9 +49,8 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
|||||||
texture = CraftGUITexture.Tab;
|
texture = CraftGUITexture.Tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture lTexture = CraftGUI.render.getTexture(texture);
|
|
||||||
Position position = getTabPosition();
|
Position position = getTabPosition();
|
||||||
Texture iTexture = lTexture.crop(position, 8.0f);
|
Texture iTexture = getCroppedTexture(texture);
|
||||||
IArea area = getArea();
|
IArea area = getArea();
|
||||||
if (texture == CraftGUITexture.TabDisabled) {
|
if (texture == CraftGUITexture.TabDisabled) {
|
||||||
if (position == Position.TOP || position == Position.LEFT) {
|
if (position == Position.TOP || position == Position.LEFT) {
|
||||||
@@ -68,14 +71,23 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (icon.hasOutline()) {
|
if (icon.hasOutline()) {
|
||||||
iTexture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline);
|
iTexture = getCroppedTexture(CraftGUITexture.TabOutline);
|
||||||
iTexture = iTexture.crop(position, 8.0f);
|
|
||||||
CraftGUI.render.color(icon.getOutlineColor());
|
CraftGUI.render.color(icon.getOutlineColor());
|
||||||
CraftGUI.render.texture(iTexture, area.inset(2));
|
CraftGUI.render.texture(iTexture, area.inset(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Texture getCroppedTexture(Object key) {
|
||||||
|
Texture source = CraftGUI.render.getTexture(key);
|
||||||
|
Texture cropped = croppedTextures.get(source);
|
||||||
|
if (cropped == null) {
|
||||||
|
cropped = source.crop(getTabPosition(), 8.0f);
|
||||||
|
croppedTextures.put(source, cropped);
|
||||||
|
}
|
||||||
|
return cropped;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTooltip(Tooltip tooltip) {
|
public void getTooltip(Tooltip tooltip) {
|
||||||
String name = getName();
|
String name = getName();
|
||||||
|
|||||||