Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dec8c6317 | ||
|
|
2cd0ada1f0 | ||
|
|
7631067bc6 | ||
|
|
36a4b43837 | ||
|
|
c29ac8f8ff | ||
|
|
155fbc7133 | ||
|
|
ce40528f94 | ||
|
|
1c4e9a0edf | ||
|
|
18cdffc3c4 | ||
|
|
1ea465c688 | ||
|
|
cede7b7869 | ||
|
|
60cef50150 | ||
|
|
6c24da5270 | ||
|
|
a52f1b0926 | ||
|
|
2e159f1983 | ||
|
|
dde6c79f9e |
No files matched your search
@@ -32,7 +32,6 @@
|
|||||||
*.[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, release/** ]
|
branches: [ master, main ]
|
||||||
push:
|
push:
|
||||||
branches: [ master, main, release/** ]
|
branches: [ master, main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
name: Optimize images
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [ master, main, release/** ]
|
|
||||||
paths:
|
|
||||||
- "**/*.png"
|
|
||||||
|
|
||||||
push:
|
|
||||||
branches: [ master, main, release/** ]
|
|
||||||
paths:
|
|
||||||
- "**/*.png"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
optimize-images:
|
|
||||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
|
||||||
secrets: inherit
|
|
||||||
@@ -28,7 +28,6 @@ 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
|
||||||
@@ -36,4 +35,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 |
|
Before Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 222 B |
|
Before 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.39:dev')
|
api('com.github.GTNewHorizons:ForestryMC:4.11.7:dev')
|
||||||
implementation('com.github.GTNewHorizons:GTNHLib:0.11.54:dev')
|
implementation('com.github.GTNewHorizons:GTNHLib:0.9.20:dev')
|
||||||
|
|
||||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.162-GTNH:dev')
|
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.68-GTNH:dev')
|
||||||
|
|
||||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.64:api')
|
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.55: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,11 +186,6 @@ 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/539ea72837c6244075f8ee037babc29e/redirect
|
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e1118b4c7c2858d28154d086dbff010e/redirect
|
||||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
|
||||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/832229f0f6f0be60ed817c5a5e5848eb/redirect
|
||||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect
|
||||||
toolchainVersion=25
|
toolchainVersion=25
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.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 @@
|
|||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# gradlew start up script for POSIX generated by Gradle.
|
# Gradle 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 gradlew
|
# ksh Gradle
|
||||||
#
|
#
|
||||||
# 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/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/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 gradlew startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
@rem Set local scope for the variables with windows NT shell
|
||||||
setlocal EnableExtensions
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
"%COMSPEC%" /c exit 1
|
goto fail
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
@@ -65,18 +65,29 @@ 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
|
||||||
|
|
||||||
"%COMSPEC%" /c exit 1
|
goto fail
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute gradlew
|
@rem Execute Gradle
|
||||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
@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
|
|
||||||
|
|
||||||
:exitWithErrorLevel
|
:end
|
||||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
@rem End local scope for the variables with windows NT shell
|
||||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
@@ -17,5 +17,5 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.34'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.20'
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int meta) {
|
public IIcon getIcon(int side, int meta) {
|
||||||
return TileType.get(meta >>> 16 & 0xFF).icons[MultipassBlockRenderer.getLayer()];
|
return getType(meta).getIcon(MultipassBlockRenderer.getLayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -167,10 +167,16 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
|||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getRenderColor(int meta) {
|
public int getRenderColor(int meta) {
|
||||||
|
final BlockType type = this.getType(meta);
|
||||||
if (!MultipassBlockRenderer.isRendering()) {
|
if (!MultipassBlockRenderer.isRendering()) {
|
||||||
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
|
return type.color1.getColor(false);
|
||||||
}
|
}
|
||||||
return colorMultiplier(meta);
|
|
||||||
|
final int layer = MultipassBlockRenderer.getLayer();
|
||||||
|
if (layer == 0) return 0xffffff;
|
||||||
|
if (layer == 1) return type.color1.getColor(false);
|
||||||
|
if (layer == 2) return type.color2.getColor(false);
|
||||||
|
return 0xffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -180,14 +186,14 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int colorMultiplier(int meta) {
|
public int colorMultiplier(int meta) {
|
||||||
int layer = MultipassBlockRenderer.getLayer();
|
BlockType type = getType(meta);
|
||||||
if (layer == 0) {
|
if (MultipassBlockRenderer.getLayer() == 0) {
|
||||||
return 0xffffff;
|
return 0xffffff;
|
||||||
}
|
}
|
||||||
if (layer == 1) {
|
if (MultipassBlockRenderer.getLayer() == 1) {
|
||||||
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
|
return type.color1.getColor(false);
|
||||||
}
|
}
|
||||||
return EnumFlowerColor.get(meta >>> 8 & 0xFF).getColor(false);
|
return type.color2.getColor(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ 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;
|
||||||
@@ -21,25 +19,18 @@ 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;
|
||||||
@@ -70,44 +61,12 @@ 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();
|
||||||
}
|
}
|
||||||
@@ -193,17 +152,6 @@ 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;
|
||||||
@@ -229,32 +177,19 @@ 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) {
|
||||||
IAlleleFlowerSpecies species = FlowerSpecies.POPPY;
|
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
||||||
boolean flowered = false;
|
if (flower == null || flower.getGenome() == null || flower.getGenome().getPrimary() == null) {
|
||||||
|
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 = species.getType();
|
IFlowerType type = flower.getGenome().getPrimary().getType();
|
||||||
if (renderPass == 0) {
|
if (renderPass == 0) {
|
||||||
return type.getStem(getStage(), flowered, type.getSections() - 1);
|
return type.getStem(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
||||||
}
|
}
|
||||||
if (renderPass == 1) {
|
if (renderPass == 1) {
|
||||||
return type.getPetalIcon(getStage(), flowered, type.getSections() - 1);
|
return type.getPetalIcon(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
||||||
}
|
}
|
||||||
return type.getVariantIcon(getStage(), flowered, type.getSections() - 1);
|
return type.getVariantIcon(getStage(), flower.hasFlowered(), 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,8 +97,6 @@ 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;
|
||||||
|
|
||||||
@@ -108,7 +106,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() {
|
||||||
@@ -129,8 +127,6 @@ 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;
|
||||||
|
|
||||||
@@ -140,7 +136,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,7 +135,6 @@ 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;
|
||||||
@@ -145,7 +144,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,13 +8,7 @@ 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);
|
||||||
@@ -28,13 +22,6 @@ 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,8 +17,6 @@ public class ItemMetadata extends ItemBlock {
|
|||||||
|
|
||||||
public ItemMetadata(Block block) {
|
public ItemMetadata(Block block) {
|
||||||
super(block);
|
super(block);
|
||||||
setMaxDamage(0);
|
|
||||||
setHasSubtypes(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,45 +28,64 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
|||||||
return MultipassBlockRenderer.rendering;
|
return MultipassBlockRenderer.rendering;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int getPassesSafe(Block block) {
|
||||||
|
try {
|
||||||
|
return ((IMultipassBlock) block).getNumberOfPasses();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int getColorSafe(Block block, int meta) {
|
||||||
|
try {
|
||||||
|
if (block instanceof IMultipassBlock) {
|
||||||
|
try {
|
||||||
|
java.lang.reflect.Method m = block.getClass().getMethod("colorMultiplier", int.class);
|
||||||
|
Object out = m.invoke(block, Integer.valueOf(meta));
|
||||||
|
if (out instanceof Integer) {
|
||||||
|
return ((Integer) out).intValue();
|
||||||
|
}
|
||||||
|
} catch (Throwable ignored) {}
|
||||||
|
}
|
||||||
|
return block.getRenderColor(meta);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return 16777215;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
||||||
IMultipassBlock multipassBlock = (IMultipassBlock) block;
|
|
||||||
int passes = multipassBlock.getNumberOfPasses();
|
|
||||||
|
|
||||||
block.setBlockBoundsForItemRender();
|
block.setBlockBoundsForItemRender();
|
||||||
renderer.setRenderBoundsFromBlock(block);
|
renderer.setRenderBoundsFromBlock(block);
|
||||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||||
|
|
||||||
MultipassBlockRenderer.rendering = true;
|
MultipassBlockRenderer.rendering = true;
|
||||||
try {
|
MultipassBlockRenderer.layer = 0;
|
||||||
for (int pass = 0; pass < passes; ++pass) {
|
while (MultipassBlockRenderer.layer < getPassesSafe(block)) {
|
||||||
MultipassBlockRenderer.layer = pass;
|
renderItem(block, renderer, meta);
|
||||||
renderItem(block, multipassBlock, renderer, meta);
|
MultipassBlockRenderer.layer++;
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
MultipassBlockRenderer.layer = 0;
|
|
||||||
MultipassBlockRenderer.rendering = false;
|
|
||||||
}
|
}
|
||||||
|
MultipassBlockRenderer.layer = 0;
|
||||||
|
MultipassBlockRenderer.rendering = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||||
RenderBlocks renderer) {
|
RenderBlocks renderer) {
|
||||||
IMultipassBlock multipassBlock = (IMultipassBlock) block;
|
boolean r = true;
|
||||||
int passes = multipassBlock.getNumberOfPasses();
|
|
||||||
boolean rendered = true;
|
|
||||||
|
|
||||||
MultipassBlockRenderer.rendering = true;
|
MultipassBlockRenderer.rendering = true;
|
||||||
try {
|
MultipassBlockRenderer.layer = 0;
|
||||||
for (int pass = 0; pass < passes; ++pass) {
|
while (MultipassBlockRenderer.layer < getPassesSafe(block)) {
|
||||||
MultipassBlockRenderer.layer = pass;
|
try {
|
||||||
rendered = renderer.renderStandardBlock(block, x, y, z);
|
r = renderer.renderStandardBlock(block, x, y, z);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return rendered;
|
MultipassBlockRenderer.layer++;
|
||||||
} finally {
|
|
||||||
MultipassBlockRenderer.layer = 0;
|
|
||||||
MultipassBlockRenderer.rendering = false;
|
|
||||||
}
|
}
|
||||||
|
MultipassBlockRenderer.layer = 0;
|
||||||
|
MultipassBlockRenderer.rendering = false;
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -79,8 +98,8 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
|||||||
return BinnieCore.multipassRenderID;
|
return BinnieCore.multipassRenderID;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderItem(Block block, IMultipassBlock multipassBlock, RenderBlocks renderer, int meta) {
|
public void renderItem(Block block, RenderBlocks renderer, int meta) {
|
||||||
setColor(multipassBlock.colorMultiplier(meta));
|
setColor(getColorSafe(block, meta));
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
tessellator.startDrawingQuads();
|
tessellator.startDrawingQuads();
|
||||||
tessellator.setNormal(0.0f, -1.0f, 0.0f);
|
tessellator.setNormal(0.0f, -1.0f, 0.0f);
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
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;
|
||||||
@@ -165,14 +168,17 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Deque<IWidget> calculateMousedOverWidgets() {
|
public Deque<IWidget> calculateMousedOverWidgets() {
|
||||||
Deque<IWidget> widgets = new ArrayDeque<>();
|
Deque<IWidget> list = new ArrayDeque<>();
|
||||||
addMousedOverWidgets(this, widgets);
|
for (IWidget widget : getQueuedWidgets(this)) {
|
||||||
return widgets;
|
if (widget.calculateIsMouseOver()) {
|
||||||
|
list.addLast(widget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addMousedOverWidgets(IWidget widget, Deque<IWidget> widgets) {
|
private Collection<IWidget> getQueuedWidgets(IWidget widget) {
|
||||||
if (!widget.isVisible()) return;
|
List<IWidget> widgets = new ArrayList<>();
|
||||||
|
|
||||||
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());
|
||||||
@@ -182,12 +188,11 @@ 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();
|
||||||
addMousedOverWidgets(child, widgets);
|
widgets.addAll(getQueuedWidgets(child));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (widget.calculateIsMouseOver()) {
|
widgets.add(widget);
|
||||||
widgets.addLast(widget);
|
return widgets;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@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.equals(this.offset)) {
|
if (offset != this.offset) {
|
||||||
this.offset = new IPoint(offset);
|
this.offset = new IPoint(offset);
|
||||||
callEvent(new EventWidget.ChangeOffset(this));
|
callEvent(new EventWidget.ChangeOffset(this));
|
||||||
}
|
}
|
||||||
@@ -285,10 +285,6 @@ 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);
|
||||||
@@ -310,22 +306,17 @@ public class Widget implements IWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onUpdateClient();
|
onUpdateClient();
|
||||||
List<IWidget> deletedWidgets = null;
|
List<IWidget> deletedWidgets = new ArrayList<>();
|
||||||
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deletedWidgets != null) {
|
for (IWidget widget : deletedWidgets) {
|
||||||
for (IWidget widget : deletedWidgets) {
|
deleteChild(widget);
|
||||||
deleteChild(widget);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +338,7 @@ public class Widget implements IWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isMouseOverWidget(IPoint relativeMouse) {
|
public boolean isMouseOverWidget(IPoint relativeMouse) {
|
||||||
return contains(relativeMouse);
|
return getArea().contains(relativeMouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -475,8 +466,7 @@ public class Widget implements IWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(IPoint position) {
|
public boolean contains(IPoint position) {
|
||||||
IPoint size = size();
|
return getArea().contains(position);
|
||||||
return position.x() >= 0.0f && position.y() >= 0.0f && position.x() <= size.x() && position.y() <= size.y();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -188,9 +188,7 @@ public class WindowFieldKit extends Window {
|
|||||||
glassOffsetX *= 1.0f - analyseProgress;
|
glassOffsetX *= 1.0f - analyseProgress;
|
||||||
glassOffsetY += glassVY;
|
glassOffsetY += glassVY;
|
||||||
glassOffsetY *= 1.0f - analyseProgress;
|
glassOffsetY *= 1.0f - analyseProgress;
|
||||||
if (GlassControl != null) {
|
GlassControl.setOffset(new IPoint(glassOffsetX, glassOffsetY));
|
||||||
GlassControl.setOffset(new IPoint(glassOffsetX, glassOffsetY));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshSpecies() {
|
private void refreshSpecies() {
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
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;
|
||||||
@@ -24,7 +21,6 @@ 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);
|
||||||
@@ -49,8 +45,9 @@ 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 = getCroppedTexture(texture);
|
Texture iTexture = lTexture.crop(position, 8.0f);
|
||||||
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) {
|
||||||
@@ -71,23 +68,14 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (icon.hasOutline()) {
|
if (icon.hasOutline()) {
|
||||||
iTexture = getCroppedTexture(CraftGUITexture.TabOutline);
|
iTexture = CraftGUI.render.getTexture(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();
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import static net.minecraftforge.common.util.Constants.NBT.TAG_COMPOUND;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.IdentityHashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -38,8 +37,6 @@ import binnie.core.machines.power.TankInfo;
|
|||||||
import binnie.core.machines.transfer.TransferRequest;
|
import binnie.core.machines.transfer.TransferRequest;
|
||||||
import binnie.core.network.packet.MessageContainerUpdate;
|
import binnie.core.network.packet.MessageContainerUpdate;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
|
||||||
|
|
||||||
public class ContainerCraftGUI extends Container {
|
public class ContainerCraftGUI extends Container {
|
||||||
|
|
||||||
@@ -83,7 +80,6 @@ public class ContainerCraftGUI extends Container {
|
|||||||
private final Map<String, NBTTagCompound> syncedNBT = new HashMap<>();
|
private final Map<String, NBTTagCompound> syncedNBT = new HashMap<>();
|
||||||
private final Map<String, NBTTagCompound> sentNBT = new HashMap<>();
|
private final Map<String, NBTTagCompound> sentNBT = new HashMap<>();
|
||||||
private final Map<Integer, TankInfo> syncedTanks = new HashMap<>();
|
private final Map<Integer, TankInfo> syncedTanks = new HashMap<>();
|
||||||
private final Map<IInventory, Int2ObjectMap<CustomSlot>> slotsByInventory = new IdentityHashMap<>();
|
|
||||||
private PowerInfo syncedPower = new PowerInfo();
|
private PowerInfo syncedPower = new PowerInfo();
|
||||||
private ProcessInfo syncedProcess = new ProcessInfo();
|
private ProcessInfo syncedProcess = new ProcessInfo();
|
||||||
private int errorType = 0;
|
private int errorType = 0;
|
||||||
@@ -113,17 +109,9 @@ public class ContainerCraftGUI extends Container {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Slot addSlotToContainer(Slot slot) {
|
protected Slot addSlotToContainer(Slot slot) {
|
||||||
indexSlot(slot);
|
|
||||||
return super.addSlotToContainer(slot);
|
return super.addSlotToContainer(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void indexSlot(Slot slot) {
|
|
||||||
if (slot instanceof CustomSlot customSlot) {
|
|
||||||
slotsByInventory.computeIfAbsent(customSlot.inventory, key -> new Int2ObjectOpenHashMap<>())
|
|
||||||
.putIfAbsent(customSlot.getSlotIndex(), customSlot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Side getSide() {
|
private Side getSide() {
|
||||||
return window.isServer() ? Side.SERVER : Side.CLIENT;
|
return window.isServer() ? Side.SERVER : Side.CLIENT;
|
||||||
}
|
}
|
||||||
@@ -213,22 +201,22 @@ public class ContainerCraftGUI extends Container {
|
|||||||
Slot shiftClickedSlot = inventorySlots.get(index);
|
Slot shiftClickedSlot = inventorySlots.get(index);
|
||||||
ItemStack itemstack = null;
|
ItemStack itemstack = null;
|
||||||
if (shiftClickedSlot.getHasStack()) {
|
if (shiftClickedSlot.getHasStack()) {
|
||||||
itemstack = shiftClickedSlot.getStack();
|
itemstack = shiftClickedSlot.getStack().copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
IInventory playerInventory = player.inventory;
|
IInventory playerInventory = player.inventory;
|
||||||
IInventory entityInventory = window.getInventory();
|
IInventory entityInventory = window.getInventory();
|
||||||
IInventory windowInventory = window.getWindowInventory();
|
IInventory windowInventory = window.getWindowInventory();
|
||||||
IInventory fromPlayer = (entityInventory == null) ? windowInventory : entityInventory;
|
IInventory fromPlayer = (entityInventory == null) ? windowInventory : entityInventory;
|
||||||
|
int[] target = new int[36];
|
||||||
|
for (int i = 0; i < target.length; ++i) {
|
||||||
|
target[i] = i;
|
||||||
|
}
|
||||||
|
|
||||||
TransferRequest request;
|
TransferRequest request;
|
||||||
if (shiftClickedSlot.inventory == playerInventory) {
|
if (shiftClickedSlot.inventory == playerInventory) {
|
||||||
request = new TransferRequest(itemstack, fromPlayer).setOrigin(shiftClickedSlot.inventory);
|
request = new TransferRequest(itemstack, fromPlayer).setOrigin(shiftClickedSlot.inventory);
|
||||||
} else {
|
} else {
|
||||||
int[] target = new int[36];
|
|
||||||
for (int i = 0; i < target.length; ++i) {
|
|
||||||
target[i] = i;
|
|
||||||
}
|
|
||||||
request = new TransferRequest(itemstack, playerInventory).setOrigin(shiftClickedSlot.inventory)
|
request = new TransferRequest(itemstack, playerInventory).setOrigin(shiftClickedSlot.inventory)
|
||||||
.setTargetSlots(target);
|
.setTargetSlots(target);
|
||||||
}
|
}
|
||||||
@@ -246,7 +234,7 @@ public class ContainerCraftGUI extends Container {
|
|||||||
ItemStack heldItem = player.inventory.getItemStack().copy();
|
ItemStack heldItem = player.inventory.getItemStack().copy();
|
||||||
IInventory entityInventory = window.getInventory();
|
IInventory entityInventory = window.getInventory();
|
||||||
heldItem = new TransferRequest(heldItem, entityInventory).setOrigin(player.inventory).setTargetSlots(new int[0])
|
heldItem = new TransferRequest(heldItem, entityInventory).setOrigin(player.inventory).setTargetSlots(new int[0])
|
||||||
.setTargetTanks(new int[] { slotID }).dropOverflow(player).transfer(true);
|
.setTargetTanks(new int[] { slotID }).transfer(true);
|
||||||
|
|
||||||
player.inventory.setItemStack(heldItem);
|
player.inventory.setItemStack(heldItem);
|
||||||
|
|
||||||
@@ -258,14 +246,7 @@ public class ContainerCraftGUI extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void handleNBT(Side side, EntityPlayer player, NBTTagCompound action) {
|
public void handleNBT(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||||
if (handleNBTAction(side, player, action)) {
|
|
||||||
sendContainerContents();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean handleNBTAction(Side side, EntityPlayer player, NBTTagCompound action) {
|
|
||||||
final String actionType = action.getString(ACTION_TYPE);
|
final String actionType = action.getString(ACTION_TYPE);
|
||||||
boolean slotRegistered = false;
|
|
||||||
|
|
||||||
if (side == Side.SERVER) {
|
if (side == Side.SERVER) {
|
||||||
switch (actionType) {
|
switch (actionType) {
|
||||||
@@ -275,7 +256,11 @@ public class ContainerCraftGUI extends Container {
|
|||||||
final int slotIndex = action.getShort(SLOT_INDEX);
|
final int slotIndex = action.getShort(SLOT_INDEX);
|
||||||
final int slotNumber = action.getShort(SLOT_NUMBER);
|
final int slotNumber = action.getShort(SLOT_NUMBER);
|
||||||
|
|
||||||
slotRegistered = createSlot(InventoryType.values()[slotType % 4], slotIndex, slotNumber);
|
createSlot(InventoryType.values()[slotType % 4], slotIndex, slotNumber);
|
||||||
|
|
||||||
|
for (ICrafting crafterObject : crafters) {
|
||||||
|
crafterObject.sendContainerAndContentsToPlayer(this, getInventory());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,7 +275,6 @@ public class ContainerCraftGUI extends Container {
|
|||||||
if (actionType.contains(TANK_UPDATE)) onTankUpdate(action);
|
if (actionType.contains(TANK_UPDATE)) onTankUpdate(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return slotRegistered;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -323,7 +307,8 @@ public class ContainerCraftGUI extends Container {
|
|||||||
|
|
||||||
if (machineSync != null) machineSync.sendGuiNBT(syncedNBT);
|
if (machineSync != null) machineSync.sendGuiNBT(syncedNBT);
|
||||||
|
|
||||||
NBTTagList actions = null;
|
Map<String, NBTTagCompound> sentThisTime = new HashMap<>();
|
||||||
|
NBTTagList actions = new NBTTagList();
|
||||||
|
|
||||||
for (Map.Entry<String, NBTTagCompound> entry : syncedNBT.entrySet()) {
|
for (Map.Entry<String, NBTTagCompound> entry : syncedNBT.entrySet()) {
|
||||||
final String actionType = entry.getKey();
|
final String actionType = entry.getKey();
|
||||||
@@ -332,18 +317,12 @@ public class ContainerCraftGUI extends Container {
|
|||||||
|
|
||||||
action.setString(ACTION_TYPE, actionType);
|
action.setString(ACTION_TYPE, actionType);
|
||||||
|
|
||||||
if (action == actionPrev || action.equals(actionPrev)) continue;
|
if (action.equals(actionPrev)) continue;
|
||||||
|
|
||||||
if (actions == null) {
|
|
||||||
actions = new NBTTagList();
|
|
||||||
}
|
|
||||||
actions.appendTag(action);
|
actions.appendTag(action);
|
||||||
sentNBT.put(actionType, action);
|
sentThisTime.put(actionType, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
syncedNBT.clear();
|
|
||||||
if (actions == null) return;
|
|
||||||
|
|
||||||
NBTTagCompound actionsBatch = new NBTTagCompound();
|
NBTTagCompound actionsBatch = new NBTTagCompound();
|
||||||
actionsBatch.setString(ACTION_TYPE, ACTION_BATCH);
|
actionsBatch.setString(ACTION_TYPE, ACTION_BATCH);
|
||||||
actionsBatch.setTag(ACTIONS, actions);
|
actionsBatch.setTag(ACTIONS, actions);
|
||||||
@@ -354,6 +333,9 @@ public class ContainerCraftGUI extends Container {
|
|||||||
BinnieCore.proxy.sendToPlayer(packet, playerMP);
|
BinnieCore.proxy.sendToPlayer(packet, playerMP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sentNBT.putAll(sentThisTime);
|
||||||
|
syncedNBT.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private NBTTagCompound createErrorNBT(IErrorStateSource error) {
|
private NBTTagCompound createErrorNBT(IErrorStateSource error) {
|
||||||
@@ -494,39 +476,29 @@ public class ContainerCraftGUI extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private CustomSlot getSlot(IInventory inventory, int id) {
|
private CustomSlot getSlot(IInventory inventory, int id) {
|
||||||
Int2ObjectMap<CustomSlot> slots = slotsByInventory.get(inventory);
|
for (Object o : inventorySlots) {
|
||||||
return (slots == null) ? null : slots.get(id);
|
CustomSlot slot = (CustomSlot) o;
|
||||||
|
if (slot.inventory == inventory && slot.getSlotIndex() == id) {
|
||||||
|
return slot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void receiveNBT(Side side, EntityPlayer player, NBTTagCompound action) {
|
public void receiveNBT(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||||
if (receiveNBTAction(side, player, action)) {
|
|
||||||
sendContainerContents();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean receiveNBTAction(Side side, EntityPlayer player, NBTTagCompound action) {
|
|
||||||
String actionType = action.getString(ACTION_TYPE);
|
String actionType = action.getString(ACTION_TYPE);
|
||||||
if (actionType.equals(ACTION_BATCH)) {
|
if (actionType.equals(ACTION_BATCH)) {
|
||||||
boolean slotRegistered = false;
|
|
||||||
NBTTagList actionsBatch = action.getTagList(ACTIONS, TAG_COMPOUND);
|
NBTTagList actionsBatch = action.getTagList(ACTIONS, TAG_COMPOUND);
|
||||||
for (int i = 0; i < actionsBatch.tagCount(); i++) {
|
for (int i = 0; i < actionsBatch.tagCount(); i++) {
|
||||||
slotRegistered |= receiveNBTAction(side, player, actionsBatch.getCompoundTagAt(i));
|
receiveNBT(side, player, actionsBatch.getCompoundTagAt(i));
|
||||||
}
|
}
|
||||||
return slotRegistered;
|
return;
|
||||||
}
|
}
|
||||||
boolean slotRegistered = handleNBTAction(side, player, action);
|
handleNBT(side, player, action);
|
||||||
window.receiveGuiNBT(getSide(), player, actionType, action);
|
window.receiveGuiNBT(getSide(), player, actionType, action);
|
||||||
INetwork.ReceiveGuiNBT machine = Machine.getInterface(INetwork.ReceiveGuiNBT.class, window.getInventory());
|
INetwork.ReceiveGuiNBT machine = Machine.getInterface(INetwork.ReceiveGuiNBT.class, window.getInventory());
|
||||||
if (machine != null) {
|
if (machine == null) return;
|
||||||
machine.receiveGuiNBT(getSide(), player, actionType, action);
|
machine.receiveGuiNBT(getSide(), player, actionType, action);
|
||||||
}
|
|
||||||
return slotRegistered;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendContainerContents() {
|
|
||||||
for (ICrafting crafter : crafters) {
|
|
||||||
crafter.sendContainerAndContentsToPlayer(this, getInventory());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Slot getOrCreateSlot(InventoryType inventoryType, int slotIndex) {
|
public Slot getOrCreateSlot(InventoryType inventoryType, int slotIndex) {
|
||||||
@@ -550,16 +522,13 @@ public class ContainerCraftGUI extends Container {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean createSlot(InventoryType type, int index, int slotNumber) {
|
private void createSlot(InventoryType type, int index, int slotNumber) {
|
||||||
if (inventorySlots.get(slotNumber) != null) return false;
|
if (inventorySlots.get(slotNumber) != null) return;
|
||||||
|
|
||||||
IInventory inventory = getInventory(type);
|
IInventory inventory = getInventory(type);
|
||||||
Slot slot = new CustomSlot(inventory, index);
|
Slot slot = new CustomSlot(inventory, index);
|
||||||
slot.slotNumber = slotNumber;
|
slot.slotNumber = slotNumber;
|
||||||
indexSlot(slot);
|
|
||||||
inventorySlots.add(slotNumber, slot);
|
inventorySlots.add(slotNumber, slot);
|
||||||
ItemStack stack = slot.getStack();
|
inventoryItemStacks.add(slotNumber, null);
|
||||||
inventoryItemStacks.add(slotNumber, stack == null ? null : stack.copy());
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,9 +11,6 @@ import binnie.core.machines.inventory.InventorySlot;
|
|||||||
|
|
||||||
public class CustomSlot extends Slot {
|
public class CustomSlot extends Slot {
|
||||||
|
|
||||||
private InventorySlot inventorySlot;
|
|
||||||
private boolean inventorySlotResolved;
|
|
||||||
|
|
||||||
public CustomSlot(IInventory inventory, int index) {
|
public CustomSlot(IInventory inventory, int index) {
|
||||||
super(inventory, index, 0, 0);
|
super(inventory, index, 0, 0);
|
||||||
}
|
}
|
||||||
@@ -24,12 +21,11 @@ public class CustomSlot extends Slot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public InventorySlot getInventorySlot() {
|
public InventorySlot getInventorySlot() {
|
||||||
if (!inventorySlotResolved) {
|
IInventorySlots slots = Machine.getInterface(IInventorySlots.class, inventory);
|
||||||
IInventorySlots slots = Machine.getInterface(IInventorySlots.class, inventory);
|
if (slots != null) {
|
||||||
inventorySlot = (slots == null) ? null : slots.getSlot(getSlotIndex());
|
return slots.getSlot(getSlotIndex());
|
||||||
inventorySlotResolved = true;
|
|
||||||
}
|
}
|
||||||
return inventorySlot;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean handleClick() {
|
public boolean handleClick() {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import net.minecraft.util.ResourceLocation;
|
|||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.GL12;
|
|
||||||
|
|
||||||
import binnie.core.BinnieCore;
|
import binnie.core.BinnieCore;
|
||||||
import binnie.core.craftgui.IWidget;
|
import binnie.core.craftgui.IWidget;
|
||||||
@@ -84,31 +83,29 @@ public class GuiCraftGUI extends GuiContainer {
|
|||||||
window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y());
|
window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y());
|
||||||
drawDefaultBackground();
|
drawDefaultBackground();
|
||||||
|
|
||||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
zLevel = 10.0f;
|
zLevel = 10.0f;
|
||||||
GuiScreen.itemRender.zLevel = zLevel;
|
GuiScreen.itemRender.zLevel = zLevel;
|
||||||
|
|
||||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
|
||||||
window.render();
|
window.render();
|
||||||
|
|
||||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
|
||||||
RenderHelper.enableGUIStandardItemLighting();
|
RenderHelper.enableGUIStandardItemLighting();
|
||||||
|
|
||||||
NEIHook.renderObjects(window, mouseX, mouseY);
|
NEIHook.renderObjects(window, mouseX, mouseY);
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
|
||||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
|
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
|
||||||
InventoryPlayer playerInventory = mc.thePlayer.inventory;
|
InventoryPlayer playerInventory = mc.thePlayer.inventory;
|
||||||
draggedItem = playerInventory.getItemStack();
|
draggedItem = playerInventory.getItemStack();
|
||||||
if (draggedItem != null) {
|
if (draggedItem != null) {
|
||||||
GL11.glTranslatef(0.0f, 0.0f, 200.0f);
|
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
||||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
||||||
}
|
}
|
||||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
@@ -119,6 +116,7 @@ public class GuiCraftGUI extends GuiContainer {
|
|||||||
} else {
|
} else {
|
||||||
tooltip.setType(Tooltip.Type.STANDARD);
|
tooltip.setType(Tooltip.Type.STANDARD);
|
||||||
window.getTooltip(tooltip);
|
window.getTooltip(tooltip);
|
||||||
|
NEIHook.renderToolTips(mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tooltip.exists()) {
|
if (tooltip.exists()) {
|
||||||
@@ -135,7 +133,7 @@ public class GuiCraftGUI extends GuiContainer {
|
|||||||
int mouseX = (int) mousePosition.x();
|
int mouseX = (int) mousePosition.x();
|
||||||
int mouseY = (int) mousePosition.y();
|
int mouseY = (int) mousePosition.y();
|
||||||
FontRenderer font = getFontRenderer();
|
FontRenderer font = getFontRenderer();
|
||||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GL11.glDisable(GL11.GL_LIGHTING);
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||||
@@ -226,7 +224,7 @@ public class GuiCraftGUI extends GuiContainer {
|
|||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||||
RenderHelper.enableStandardItemLighting();
|
RenderHelper.enableStandardItemLighting();
|
||||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -242,16 +240,12 @@ public class GuiCraftGUI extends GuiContainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void keyTyped(char c, int key) {
|
protected void keyTyped(char c, int key) {
|
||||||
boolean noFocusedWidget = window.getFocusedWidget() == null;
|
NEIHook.lastKeyTyped(key, c);
|
||||||
|
|
||||||
if (noFocusedWidget) {
|
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
|
||||||
NEIHook.lastKeyTyped(key, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && noFocusedWidget)) {
|
|
||||||
mc.thePlayer.closeScreen();
|
mc.thePlayer.closeScreen();
|
||||||
}
|
}
|
||||||
IWidget origin = noFocusedWidget ? window : window.getFocusedWidget();
|
IWidget origin = (window.getFocusedWidget() == null) ? window : window.getFocusedWidget();
|
||||||
window.callEvent(new EventKey.Down(origin, c, key));
|
window.callEvent(new EventKey.Down(origin, c, key));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,9 +420,8 @@ public class GuiCraftGUI extends GuiContainer {
|
|||||||
|
|
||||||
public void renderItem(IPoint pos, ItemStack item, boolean rotating) {
|
public void renderItem(IPoint pos, ItemStack item, boolean rotating) {
|
||||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
|
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
|
||||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT);
|
GL11.glPushAttrib(8256);
|
||||||
RenderHelper.enableGUIStandardItemLighting();
|
RenderHelper.enableGUIStandardItemLighting();
|
||||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
|
||||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||||
FontRenderer font = item.getItem().getFontRenderer(item);
|
FontRenderer font = item.getItem().getFontRenderer(item);
|
||||||
if (font == null) {
|
if (font == null) {
|
||||||
@@ -451,7 +444,7 @@ public class GuiCraftGUI extends GuiContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
GL11.glClear(256);
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GL11.glPopAttrib();
|
GL11.glPopAttrib();
|
||||||
}
|
}
|
||||||
@@ -462,11 +455,11 @@ public class GuiCraftGUI extends GuiContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
|
||||||
BinnieCore.proxy.bindTexture(map);
|
BinnieCore.proxy.bindTexture(map);
|
||||||
GuiScreen.itemRender.zLevel = zLevel;
|
GuiScreen.itemRender.zLevel = zLevel;
|
||||||
GuiScreen.itemRender.renderIcon((int) pos.x(), (int) pos.y(), icon, 16, 16);
|
GuiScreen.itemRender.renderIcon((int) pos.x(), (int) pos.y(), icon, 16, 16);
|
||||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import java.util.Map;
|
|||||||
class ListMap<T> implements List<T> {
|
class ListMap<T> implements List<T> {
|
||||||
|
|
||||||
private final LinkedHashMap<Integer, T> map;
|
private final LinkedHashMap<Integer, T> map;
|
||||||
private int size;
|
|
||||||
|
|
||||||
ListMap() {
|
ListMap() {
|
||||||
map = new LinkedHashMap<>();
|
map = new LinkedHashMap<>();
|
||||||
@@ -18,7 +17,13 @@ class ListMap<T> implements List<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return size;
|
int i = -1;
|
||||||
|
for (int k : map.keySet()) {
|
||||||
|
if (k > i) {
|
||||||
|
i = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,7 +93,6 @@ class ListMap<T> implements List<T> {
|
|||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
map.clear();
|
map.clear();
|
||||||
size = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -99,14 +103,12 @@ class ListMap<T> implements List<T> {
|
|||||||
@Override
|
@Override
|
||||||
public T set(int index, T element) {
|
public T set(int index, T element) {
|
||||||
map.put(index, element);
|
map.put(index, element);
|
||||||
size = Math.max(size, index + 1);
|
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(int index, T element) {
|
public void add(int index, T element) {
|
||||||
map.put(index, element);
|
map.put(index, element);
|
||||||
size = Math.max(size, index + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -121,7 +123,7 @@ class ListMap<T> implements List<T> {
|
|||||||
return entry.getKey();
|
return entry.getKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package binnie.core.craftgui.minecraft;
|
package binnie.core.craftgui.minecraft;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Deque;
|
import java.util.Deque;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@@ -46,14 +47,12 @@ import binnie.core.resource.BinnieResource;
|
|||||||
import binnie.core.resource.ResourceType;
|
import binnie.core.resource.ResourceType;
|
||||||
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 it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
|
||||||
|
|
||||||
public abstract class Window extends TopLevelWidget implements INetwork.ReceiveGuiNBT {
|
public abstract class Window extends TopLevelWidget implements INetwork.ReceiveGuiNBT {
|
||||||
|
|
||||||
protected float titleButtonLeft;
|
protected float titleButtonLeft;
|
||||||
protected float titleButtonRight;
|
protected float titleButtonRight;
|
||||||
private GuiCraftGUI gui;
|
private GuiCraftGUI gui;
|
||||||
private Renderer renderer;
|
|
||||||
private final ContainerCraftGUI container;
|
private final ContainerCraftGUI container;
|
||||||
private final WindowInventory windowInventory;
|
private final WindowInventory windowInventory;
|
||||||
private ControlText title;
|
private ControlText title;
|
||||||
@@ -81,11 +80,11 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
|||||||
setSize(new IPoint(width, height));
|
setSize(new IPoint(width, height));
|
||||||
gui = new GuiCraftGUI(this);
|
gui = new GuiCraftGUI(this);
|
||||||
for (EnumHighlighting h : EnumHighlighting.values()) {
|
for (EnumHighlighting h : EnumHighlighting.values()) {
|
||||||
ControlSlot.highlighting.put(h, new IntOpenHashSet());
|
ControlSlot.highlighting.put(h, new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer = new Renderer(gui);
|
CraftGUI.render = new Renderer(gui);
|
||||||
renderer.stylesheet(StyleSheetManager.getDefault());
|
CraftGUI.render.stylesheet(StyleSheetManager.getDefault());
|
||||||
titleButtonLeft = -14.0f;
|
titleButtonLeft = -14.0f;
|
||||||
|
|
||||||
if (showHelpButton()) {
|
if (showHelpButton()) {
|
||||||
@@ -196,9 +195,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
|
|
||||||
CraftGUI.render = renderer;
|
|
||||||
|
|
||||||
if (hasBeenInitialised) {
|
if (hasBeenInitialised) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -271,9 +267,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
|||||||
entityInventory = inventory;
|
entityInventory = inventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClose() {
|
public void onClose() {}
|
||||||
CraftGUI.render = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isServer() {
|
public boolean isServer() {
|
||||||
return !isClient();
|
return !isClient();
|
||||||
|
|||||||
@@ -57,10 +57,9 @@ public class ControlErrorState extends Control implements ITooltip {
|
|||||||
|
|
||||||
ControlEnergyBar.isError = errorState.isPowerError();
|
ControlEnergyBar.isError = errorState.isPowerError();
|
||||||
if (errorState.isItemError()) {
|
if (errorState.isItemError()) {
|
||||||
CustomSlot[] customSlots = Window.get(this).getContainer().getCustomSlots();
|
|
||||||
for (int slot : errorState.getData()) {
|
for (int slot : errorState.getData()) {
|
||||||
int id = -1;
|
int id = -1;
|
||||||
for (CustomSlot cslot : customSlots) {
|
for (CustomSlot cslot : Window.get(this).getContainer().getCustomSlots()) {
|
||||||
if (!(cslot.inventory instanceof InventoryPlayer) && cslot.getSlotIndex() == slot) {
|
if (!(cslot.inventory instanceof InventoryPlayer) && cslot.getSlotIndex() == slot) {
|
||||||
id = cslot.slotNumber;
|
id = cslot.slotNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,16 +47,16 @@ public class ControlItemDisplay extends Control implements ITooltip {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRenderBackground() {
|
public void onRenderBackground() {
|
||||||
if (itemStack == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IPoint relativeToWindow = getAbsolutePosition().sub(getSuperParent().getPosition());
|
IPoint relativeToWindow = getAbsolutePosition().sub(getSuperParent().getPosition());
|
||||||
if (relativeToWindow.x() > Window.get(this).getSize().x() + 100.0f
|
if (relativeToWindow.x() > Window.get(this).getSize().x() + 100.0f
|
||||||
|| relativeToWindow.y() > Window.get(this).getSize().y() + 100.0f) {
|
|| relativeToWindow.y() > Window.get(this).getSize().y() + 100.0f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (itemStack == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (getSize().x() != 16.0f) {
|
if (getSize().x() != 16.0f) {
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
float scale = getSize().x() / 16.0f;
|
float scale = getSize().x() / 16.0f;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import static binnie.core.craftgui.minecraft.ContainerCraftGUI.SLOT_REG;
|
|||||||
import static binnie.core.craftgui.minecraft.ContainerCraftGUI.SLOT_TYPE;
|
import static binnie.core.craftgui.minecraft.ContainerCraftGUI.SLOT_TYPE;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.EnumMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -20,13 +20,10 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
import org.lwjgl.input.Mouse;
|
|
||||||
|
|
||||||
import binnie.core.craftgui.CraftGUI;
|
import binnie.core.craftgui.CraftGUI;
|
||||||
import binnie.core.craftgui.IWidget;
|
import binnie.core.craftgui.IWidget;
|
||||||
import binnie.core.craftgui.Tooltip;
|
import binnie.core.craftgui.Tooltip;
|
||||||
import binnie.core.craftgui.events.EventMouse;
|
import binnie.core.craftgui.events.EventMouse;
|
||||||
import binnie.core.craftgui.events.EventWidget;
|
|
||||||
import binnie.core.craftgui.geometry.IArea;
|
import binnie.core.craftgui.geometry.IArea;
|
||||||
import binnie.core.craftgui.geometry.IPoint;
|
import binnie.core.craftgui.geometry.IPoint;
|
||||||
import binnie.core.craftgui.minecraft.CustomSlot;
|
import binnie.core.craftgui.minecraft.CustomSlot;
|
||||||
@@ -39,17 +36,15 @@ import binnie.core.machines.inventory.MachineSide;
|
|||||||
import binnie.core.machines.inventory.SlotValidator;
|
import binnie.core.machines.inventory.SlotValidator;
|
||||||
import binnie.core.network.packet.MessageCraftGUI;
|
import binnie.core.network.packet.MessageCraftGUI;
|
||||||
import binnie.core.util.I18N;
|
import binnie.core.util.I18N;
|
||||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
|
||||||
|
|
||||||
public class ControlSlot extends ControlSlotBase {
|
public class ControlSlot extends ControlSlotBase {
|
||||||
|
|
||||||
public static Map<EnumHighlighting, IntSet> highlighting = new EnumMap<>(EnumHighlighting.class);
|
public static Map<EnumHighlighting, List<Integer>> highlighting = new HashMap<>();
|
||||||
public static boolean shiftClickActive = false;
|
public static boolean shiftClickActive = false;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for (EnumHighlighting h : EnumHighlighting.values()) {
|
for (EnumHighlighting h : EnumHighlighting.values()) {
|
||||||
ControlSlot.highlighting.put(h, new IntOpenHashSet());
|
ControlSlot.highlighting.put(h, new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,17 +59,22 @@ public class ControlSlot extends ControlSlotBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(EventMouse.Down event) {
|
public void onEvent(EventMouse.Down event) {
|
||||||
clickSlot(event.getButton());
|
if (slot == null) {
|
||||||
}
|
return;
|
||||||
});
|
|
||||||
addSelfEventHandler(new EventWidget.StartMouseOver.Handler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(EventWidget.StartMouseOver event) {
|
|
||||||
if (GuiScreen.isShiftKeyDown() && Mouse.isButtonDown(0)
|
|
||||||
&& Window.get(ControlSlot.this).getDraggedWidget() instanceof ControlSlot) {
|
|
||||||
clickSlot(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlayerControllerMP playerController = ((Window) getSuperParent()).getGui()
|
||||||
|
.getMinecraft().playerController;
|
||||||
|
int windowId = ((Window) getSuperParent()).getContainer().windowId;
|
||||||
|
int slotNumber = slot.slotNumber;
|
||||||
|
int button = event.getButton();
|
||||||
|
Window.get(getWidget()).getGui();
|
||||||
|
playerController.windowClick(
|
||||||
|
windowId,
|
||||||
|
slotNumber,
|
||||||
|
button,
|
||||||
|
GuiScreen.isShiftKeyDown() ? 1 : 0,
|
||||||
|
((Window) getSuperParent()).getGui().getMinecraft().thePlayer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -90,19 +90,6 @@ public class ControlSlot extends ControlSlotBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clickSlot(int button) {
|
|
||||||
if (slot == null) return;
|
|
||||||
|
|
||||||
Window window = (Window) getSuperParent();
|
|
||||||
PlayerControllerMP playerController = window.getGui().getMinecraft().playerController;
|
|
||||||
playerController.windowClick(
|
|
||||||
window.getContainer().windowId,
|
|
||||||
slot.slotNumber,
|
|
||||||
button,
|
|
||||||
GuiScreen.isShiftKeyDown() ? 1 : 0,
|
|
||||||
window.getGui().getMinecraft().thePlayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRenderBackground() {
|
public void onRenderBackground() {
|
||||||
CraftGUI.render.texture(slotTexture, IPoint.ZERO);
|
CraftGUI.render.texture(slotTexture, IPoint.ZERO);
|
||||||
@@ -119,7 +106,7 @@ public class ControlSlot extends ControlSlotBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean highlighted = false;
|
boolean highlighted = false;
|
||||||
for (Map.Entry<EnumHighlighting, IntSet> highlight : ControlSlot.highlighting.entrySet()) {
|
for (Map.Entry<EnumHighlighting, List<Integer>> highlight : ControlSlot.highlighting.entrySet()) {
|
||||||
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
|
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -148,7 +135,7 @@ public class ControlSlot extends ControlSlotBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean highlighted = false;
|
boolean highlighted = false;
|
||||||
for (Map.Entry<EnumHighlighting, IntSet> highlight : ControlSlot.highlighting.entrySet()) {
|
for (Map.Entry<EnumHighlighting, List<Integer>> highlight : ControlSlot.highlighting.entrySet()) {
|
||||||
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
|
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void onUpdateClient() {
|
||||||
|
super.onUpdateClient();
|
||||||
itemDisplay.setItemStack(getItemStack());
|
itemDisplay.setItemStack(getItemStack());
|
||||||
super.render();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -9,17 +9,15 @@ class ParsedTextureSheet implements IBinnieTexture {
|
|||||||
private final String name;
|
private final String name;
|
||||||
private final String modid;
|
private final String modid;
|
||||||
private final String path;
|
private final String path;
|
||||||
private final BinnieResource texture;
|
|
||||||
|
|
||||||
public ParsedTextureSheet(String name, String modid, String path) {
|
public ParsedTextureSheet(String name, String modid, String path) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.modid = modid;
|
this.modid = modid;
|
||||||
this.path = path;
|
this.path = path;
|
||||||
texture = new BinnieResource(modid, ResourceType.GUI, path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BinnieResource getTexture() {
|
public BinnieResource getTexture() {
|
||||||
return texture;
|
return new BinnieResource(modid, ResourceType.GUI, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
package binnie.core.liquid;
|
package binnie.core.liquid;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
@@ -11,62 +9,32 @@ import net.minecraftforge.fluids.FluidRegistry;
|
|||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
import binnie.core.ManagerBase;
|
import binnie.core.ManagerBase;
|
||||||
import cpw.mods.fml.common.FMLLog;
|
|
||||||
import cpw.mods.fml.common.Loader;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ManagerLiquid extends ManagerBase {
|
public class ManagerLiquid extends ManagerBase {
|
||||||
|
|
||||||
private static final Set<String> EXTERNAL_FLUIDS = new HashSet<>();
|
|
||||||
|
|
||||||
static {
|
|
||||||
EXTERNAL_FLUIDS.add("liquidnitrogen");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isExternalFluid(String identifier) {
|
|
||||||
return EXTERNAL_FLUIDS.contains(identifier) && Loader.isModLoaded("gregtech_nh");
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, IFluidType> fluids;
|
public Map<String, IFluidType> fluids;
|
||||||
private final Set<String> ownedFluids;
|
|
||||||
|
|
||||||
public ManagerLiquid() {
|
public ManagerLiquid() {
|
||||||
fluids = new LinkedHashMap<>();
|
fluids = new LinkedHashMap<>();
|
||||||
ownedFluids = new HashSet<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createLiquids(IFluidType[] liquids, int startID) {
|
public void createLiquids(IFluidType[] liquids, int startID) {
|
||||||
for (IFluidType liquid : liquids) {
|
for (IFluidType liquid : liquids) {
|
||||||
String identifier = liquid.getIdentifier().toLowerCase();
|
BinnieFluid fluid = createLiquid(liquid, startID++);
|
||||||
Fluid fluid = createOrGetLiquid(liquid, startID++);
|
if (fluid == null) {
|
||||||
if (fluid == null && !isExternalFluid(identifier)) {
|
|
||||||
throw new RuntimeException("Liquid registered incorrectly - " + liquid.getIdentifier());
|
throw new RuntimeException("Liquid registered incorrectly - " + liquid.getIdentifier());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BinnieFluid createLiquid(IFluidType fluid, int id) {
|
public BinnieFluid createLiquid(IFluidType fluid, int id) {
|
||||||
Fluid registeredFluid = createOrGetLiquid(fluid, id);
|
fluids.put(fluid.getIdentifier().toLowerCase(), fluid);
|
||||||
return (registeredFluid instanceof BinnieFluid) ? (BinnieFluid) registeredFluid : null;
|
BinnieFluid binnieFluid = new BinnieFluid(fluid);
|
||||||
}
|
FluidRegistry.registerFluid(binnieFluid);
|
||||||
|
|
||||||
private Fluid createOrGetLiquid(IFluidType fluid, int id) {
|
|
||||||
String identifier = fluid.getIdentifier().toLowerCase();
|
|
||||||
fluids.put(identifier, fluid);
|
|
||||||
Fluid registeredFluid = FluidRegistry.getFluid(identifier);
|
|
||||||
if (registeredFluid == null && !isExternalFluid(identifier)) {
|
|
||||||
BinnieFluid binnieFluid = new BinnieFluid(fluid);
|
|
||||||
FluidRegistry.registerFluid(binnieFluid);
|
|
||||||
registeredFluid = FluidRegistry.getFluid(identifier);
|
|
||||||
ownedFluids.add(identifier);
|
|
||||||
} else if (registeredFluid == null) {
|
|
||||||
FMLLog.warning(
|
|
||||||
"[Binnie] External liquid %s is not registered yet. Waiting for the owning mod to register it before postInit.",
|
|
||||||
identifier);
|
|
||||||
}
|
|
||||||
ItemFluidContainer.registerFluid(fluid, id);
|
ItemFluidContainer.registerFluid(fluid, id);
|
||||||
return registeredFluid;
|
return binnieFluid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluidStack getLiquidStack(String name, int amount) {
|
public FluidStack getLiquidStack(String name, int amount) {
|
||||||
@@ -76,26 +44,18 @@ public class ManagerLiquid extends ManagerBase {
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void reloadIcons(IIconRegister register) {
|
public void reloadIcons(IIconRegister register) {
|
||||||
for (IFluidType type : fluids.values()) {
|
for (IFluidType type : fluids.values()) {
|
||||||
String identifier = type.getIdentifier().toLowerCase();
|
Fluid fluid = getLiquidStack(type.getIdentifier(), 1).getFluid();
|
||||||
FluidStack stack = getLiquidStack(identifier, 1);
|
|
||||||
Fluid fluid = stack == null ? null : stack.getFluid();
|
|
||||||
type.registerIcon(register);
|
type.registerIcon(register);
|
||||||
if (fluid == null) {
|
if (fluid == null) {
|
||||||
throw new RuntimeException("[Binnie] Liquid not registered properly - " + type.getIdentifier());
|
throw new RuntimeException("[Binnie] Liquid not registered properly - " + type.getIdentifier());
|
||||||
}
|
}
|
||||||
if (ownedFluids.contains(identifier)) {
|
fluid.setIcons(type.getIcon());
|
||||||
fluid.setIcons(type.getIcon());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postInit() {
|
public void postInit() {
|
||||||
for (IFluidType fluid : fluids.values()) {
|
for (IFluidType fluid : fluids.values()) {
|
||||||
String identifier = fluid.getIdentifier().toLowerCase();
|
|
||||||
if (isExternalFluid(identifier) && FluidRegistry.getFluid(identifier) == null) {
|
|
||||||
throw new RuntimeException("[Binnie] External liquid not registered - " + identifier);
|
|
||||||
}
|
|
||||||
for (FluidContainer container : FluidContainer.values()) {
|
for (FluidContainer container : FluidContainer.values()) {
|
||||||
if (container.isActive() && fluid.canPlaceIn(container)) {
|
if (container.isActive() && fluid.canPlaceIn(container)) {
|
||||||
container.registerContainerData(fluid);
|
container.registerContainerData(fluid);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package binnie.core.machines;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -72,9 +71,8 @@ public class Machine implements INetworkedEntity, INBTTagable, INetwork.TilePack
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T getInterface(Class<T> cls) {
|
public <T> T getInterface(Class<T> cls) {
|
||||||
List<MachineComponent> components = componentInterfaceMap.get(cls);
|
if (hasInterface(cls)) {
|
||||||
if (components != null && !components.isEmpty()) {
|
return getInterfaces(cls).get(0);
|
||||||
return cls.cast(components.get(0));
|
|
||||||
}
|
}
|
||||||
if (cls.isInstance(getPackage())) {
|
if (cls.isInstance(getPackage())) {
|
||||||
return cls.cast(getPackage());
|
return cls.cast(getPackage());
|
||||||
@@ -90,13 +88,11 @@ public class Machine implements INetworkedEntity, INBTTagable, INetwork.TilePack
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> List<T> getInterfaces(Class<T> cls) {
|
public <T> List<T> getInterfaces(Class<T> cls) {
|
||||||
List<MachineComponent> components = componentInterfaceMap.get(cls);
|
ArrayList<T> interfaces = new ArrayList<>();
|
||||||
if (components == null) {
|
if (!hasInterface(cls)) {
|
||||||
return Collections.emptyList();
|
return interfaces;
|
||||||
}
|
}
|
||||||
|
for (MachineComponent component : componentInterfaceMap.get(cls)) {
|
||||||
List<T> interfaces = new ArrayList<>(components.size());
|
|
||||||
for (MachineComponent component : components) {
|
|
||||||
interfaces.add(cls.cast(component));
|
interfaces.add(cls.cast(component));
|
||||||
}
|
}
|
||||||
return interfaces;
|
return interfaces;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package binnie.core.machines;
|
package binnie.core.machines;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import binnie.core.util.I18N;
|
import binnie.core.util.I18N;
|
||||||
@@ -27,12 +28,6 @@ public abstract class MachinePackage {
|
|||||||
|
|
||||||
public abstract TileEntity createTileEntity();
|
public abstract TileEntity createTileEntity();
|
||||||
|
|
||||||
/// Whether this machine's tile entity needs {@link net.minecraft.tileentity.TileEntity#updateEntity()}.
|
|
||||||
/// Override to false only when no component implements onUpdate, onInventoryUpdate or a client display tick.
|
|
||||||
public boolean isTickable() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID());
|
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID());
|
||||||
}
|
}
|
||||||
@@ -58,7 +53,8 @@ public abstract class MachinePackage {
|
|||||||
this.group = group;
|
this.group = group;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void renderMachine(Machine machine, double x, double y, double z, float partialTick);
|
public abstract void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||||
|
RenderBlocks renderer);
|
||||||
|
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return active;
|
return active;
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package binnie.core.machines;
|
package binnie.core.machines;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import binnie.Binnie;
|
import binnie.Binnie;
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
@@ -15,41 +13,30 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|||||||
// Hmm. It's used class
|
// Hmm. It's used class
|
||||||
public class RendererMachine extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
public class RendererMachine extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||||
|
|
||||||
private final Map<Block, Map<Integer, TileEntityMachine>> inventoryTiles = new HashMap<>();
|
RenderBlocks blockRenderer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float partialTick) {
|
public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float partialTick) {
|
||||||
renderTileEntity((TileEntityMachine) entity, x, y, z, partialTick);
|
renderTileEntity((TileEntityMachine) entity, x, y, z, partialTick, blockRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderTileEntity(TileEntityMachine entity, double x, double y, double z, float partialTick) {
|
public void renderTileEntity(TileEntityMachine entity, double x, double y, double z, float partialTick,
|
||||||
|
RenderBlocks renderer) {
|
||||||
if (entity != null && entity.getMachine() != null) {
|
if (entity != null && entity.getMachine() != null) {
|
||||||
MachinePackage machinePackage = entity.getMachine().getPackage();
|
MachinePackage machinePackage = entity.getMachine().getPackage();
|
||||||
machinePackage.renderMachine(entity.getMachine(), x, y, z, partialTick);
|
machinePackage.renderMachine(entity.getMachine(), x, y, z, partialTick, renderer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderInvBlock(Block block, int i, int j) {
|
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) {
|
||||||
renderTileEntity(getInventoryTile(block, i), 0.0, -0.1, 0.0, 0.0625f);
|
TileEntity entity = block.createTileEntity(null, i);
|
||||||
}
|
renderTileEntity((TileEntityMachine) entity, 0.0, -0.1, 0.0, 0.0625f, renderblocks);
|
||||||
|
|
||||||
private TileEntityMachine getInventoryTile(Block block, int metadata) {
|
|
||||||
Map<Integer, TileEntityMachine> tiles = inventoryTiles.computeIfAbsent(block, key -> new HashMap<>());
|
|
||||||
TileEntityMachine tile = tiles.get(metadata);
|
|
||||||
if (tile == null) {
|
|
||||||
if (!(block.createTileEntity(null, metadata) instanceof TileEntityMachine created)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
tile = created;
|
|
||||||
tiles.put(metadata, tile);
|
|
||||||
}
|
|
||||||
return tile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||||
if (modelID == Binnie.Machine.getMachineRenderID()) {
|
if (modelID == Binnie.Machine.getMachineRenderID()) {
|
||||||
renderInvBlock(block, metadata, modelID);
|
renderInvBlock(renderer, block, metadata, modelID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +48,7 @@ public class RendererMachine extends TileEntitySpecialRenderer implements ISimpl
|
|||||||
&& tile.getMachine().getPackage() != null
|
&& tile.getMachine().getPackage() != null
|
||||||
&& tile.getMachine().getPackage().getGroup() != null
|
&& tile.getMachine().getPackage().getGroup() != null
|
||||||
&& !tile.getMachine().getPackage().getGroup().customRenderer) {
|
&& !tile.getMachine().getPackage().getGroup().customRenderer) {
|
||||||
renderTileEntity(tile, x, y, z, 1.0f);
|
renderTileEntity(tile, x, y, z, 1.0f, renderer);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -75,4 +62,9 @@ public class RendererMachine extends TileEntitySpecialRenderer implements ISimpl
|
|||||||
public int getRenderId() {
|
public int getRenderId() {
|
||||||
return Binnie.Machine.getMachineRenderID();
|
return Binnie.Machine.getMachineRenderID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void func_147496_a(World par1World) {
|
||||||
|
blockRenderer = new RenderBlocks(par1World);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -21,11 +21,6 @@ public class TileEntityMachine extends TileEntityMachineBase implements INetwork
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canUpdate() {
|
|
||||||
return machine == null || machine.getPackage() == null || machine.getPackage().isTickable();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TileEntityMachine(MachinePackage pack) {
|
public TileEntityMachine(MachinePackage pack) {
|
||||||
setMachine(pack);
|
setMachine(pack);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,23 +21,19 @@ import cpw.mods.fml.common.Optional;
|
|||||||
|
|
||||||
public class TileEntityMachineBase extends TileEntity implements IInventoryMachine, ITankMachine, IPoweredMachine {
|
public class TileEntityMachineBase extends TileEntity implements IInventoryMachine, ITankMachine, IPoweredMachine {
|
||||||
|
|
||||||
private static final DefaultInventory DEFAULT_INVENTORY = new DefaultInventory();
|
|
||||||
private static final DefaultTankContainer DEFAULT_TANK_CONTAINER = new DefaultTankContainer();
|
|
||||||
private static final DefaultPower DEFAULT_POWER = new DefaultPower();
|
|
||||||
|
|
||||||
public IInventoryMachine getInventory() {
|
public IInventoryMachine getInventory() {
|
||||||
IInventoryMachine inv = Machine.getInterface(IInventoryMachine.class, this);
|
IInventoryMachine inv = Machine.getInterface(IInventoryMachine.class, this);
|
||||||
return (inv == null || inv == this) ? DEFAULT_INVENTORY : inv;
|
return (inv == null || inv == this) ? new DefaultInventory() : inv;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ITankMachine getTankContainer() {
|
public ITankMachine getTankContainer() {
|
||||||
ITankMachine inv = Machine.getInterface(ITankMachine.class, this);
|
ITankMachine inv = Machine.getInterface(ITankMachine.class, this);
|
||||||
return (inv == null || inv == this) ? DEFAULT_TANK_CONTAINER : inv;
|
return (inv == null || inv == this) ? new DefaultTankContainer() : inv;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPoweredMachine getPower() {
|
public IPoweredMachine getPower() {
|
||||||
IPoweredMachine inv = Machine.getInterface(IPoweredMachine.class, this);
|
IPoweredMachine inv = Machine.getInterface(IPoweredMachine.class, this);
|
||||||
return (inv == null || inv == this) ? DEFAULT_POWER : inv;
|
return (inv == null || inv == this) ? new DefaultPower() : inv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||||
int index = getTankIndexToDrain(from, resource);
|
int index = getTankIndexToDrain(from, null);
|
||||||
if (!tanks.containsKey(index)) {
|
if (!tanks.containsKey(index)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
@@ -153,8 +152,7 @@ public class ComponentPowerReceptor extends MachineComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addToEnergyNet() {
|
private void addToEnergyNet() {
|
||||||
World world = getMachine().getWorld();
|
if (getMachine().getWorld() == null) {
|
||||||
if (world == null || world.isRemote) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Mods.ic2.active()) {
|
if (Mods.ic2.active()) {
|
||||||
@@ -163,8 +161,7 @@ public class ComponentPowerReceptor extends MachineComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeFromEnergyNet() {
|
private void removeFromEnergyNet() {
|
||||||
World world = getMachine().getWorld();
|
if (getMachine().getWorld() == null) {
|
||||||
if (world == null || world.isRemote) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Mods.ic2.active()) {
|
if (Mods.ic2.active()) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package binnie.core.machines.storage;
|
package binnie.core.machines.storage;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
@@ -50,12 +51,8 @@ enum Compartment implements IMachineType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTickable() {
|
public void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||||
return false;
|
RenderBlocks renderer) {
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
|
||||||
MachineRendererCompartment.instance.renderMachine(machine, renderTexture, x, y, z);
|
MachineRendererCompartment.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
|
|||||||
private final int numberOfTabs;
|
private final int numberOfTabs;
|
||||||
private final int slotsPerPage;
|
private final int slotsPerPage;
|
||||||
private final Map<Integer, CompartmentTab> tabs;
|
private final Map<Integer, CompartmentTab> tabs;
|
||||||
private NBTTagCompound cachedGuiNBT;
|
|
||||||
|
|
||||||
public ComponentCompartmentInventory(IMachine machine, int sections) {
|
public ComponentCompartmentInventory(IMachine machine, int sections) {
|
||||||
this(machine, sections, 4);
|
this(machine, sections, 4);
|
||||||
@@ -52,24 +51,21 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
|
|||||||
public CompartmentTab getTab(int i) {
|
public CompartmentTab getTab(int i) {
|
||||||
if (!tabs.containsKey(i)) {
|
if (!tabs.containsKey(i)) {
|
||||||
tabs.put(i, new CompartmentTab(i));
|
tabs.put(i, new CompartmentTab(i));
|
||||||
cachedGuiNBT = null;
|
|
||||||
}
|
}
|
||||||
return tabs.get(i);
|
return tabs.get(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendGuiNBT(Map<String, NBTTagCompound> nbts) {
|
public void sendGuiNBT(Map<String, NBTTagCompound> nbts) {
|
||||||
if (cachedGuiNBT == null) {
|
NBTTagList list = new NBTTagList();
|
||||||
NBTTagList list = new NBTTagList();
|
for (int i = 0; i < numberOfTabs; ++i) {
|
||||||
for (int i = 0; i < numberOfTabs; ++i) {
|
NBTTagCompound nbt2 = new NBTTagCompound();
|
||||||
NBTTagCompound tabNBT = new NBTTagCompound();
|
getTab(i).writeToNBT(nbt2);
|
||||||
getTab(i).writeToNBT(tabNBT);
|
list.appendTag(nbt2);
|
||||||
list.appendTag(tabNBT);
|
|
||||||
}
|
|
||||||
cachedGuiNBT = new NBTTagCompound();
|
|
||||||
cachedGuiNBT.setTag("tabs", list);
|
|
||||||
}
|
}
|
||||||
nbts.put("comp-tabs", cachedGuiNBT);
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
|
tag.setTag("tabs", list);
|
||||||
|
nbts.put("comp-tabs", tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -82,13 +78,11 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
|
|||||||
tab.readFromNBT(tag);
|
tab.readFromNBT(tag);
|
||||||
tabs.put(tab.getId(), tab);
|
tabs.put(tab.getId(), tab);
|
||||||
}
|
}
|
||||||
cachedGuiNBT = null;
|
|
||||||
}
|
}
|
||||||
if (name.equals("comp-change-tab")) {
|
if (name.equals("comp-change-tab")) {
|
||||||
CompartmentTab tab2 = new CompartmentTab(0);
|
CompartmentTab tab2 = new CompartmentTab(0);
|
||||||
tab2.readFromNBT(nbt);
|
tab2.readFromNBT(nbt);
|
||||||
tabs.put(tab2.getId(), tab2);
|
tabs.put(tab2.getId(), tab2);
|
||||||
cachedGuiNBT = null;
|
|
||||||
getMachine().getTileEntity().markDirty();
|
getMachine().getTileEntity().markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,7 +97,6 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
|
|||||||
tab.readFromNBT(tag);
|
tab.readFromNBT(tag);
|
||||||
tabs.put(tab.getId(), tab);
|
tabs.put(tab.getId(), tab);
|
||||||
}
|
}
|
||||||
cachedGuiNBT = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import binnie.core.craftgui.events.EventMouse;
|
|||||||
import binnie.core.craftgui.events.EventTextEdit;
|
import binnie.core.craftgui.events.EventTextEdit;
|
||||||
import binnie.core.craftgui.events.EventValueChanged;
|
import binnie.core.craftgui.events.EventValueChanged;
|
||||||
import binnie.core.craftgui.geometry.CraftGUIUtil;
|
import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||||
import binnie.core.craftgui.geometry.IArea;
|
|
||||||
import binnie.core.craftgui.geometry.IBorder;
|
import binnie.core.craftgui.geometry.IBorder;
|
||||||
import binnie.core.craftgui.geometry.IPoint;
|
import binnie.core.craftgui.geometry.IPoint;
|
||||||
import binnie.core.craftgui.geometry.Position;
|
import binnie.core.craftgui.geometry.Position;
|
||||||
@@ -174,7 +173,6 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
|||||||
}
|
}
|
||||||
CraftGUIUtil.linkWidgets(tab, compartmentPages);
|
CraftGUIUtil.linkWidgets(tab, compartmentPages);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
final NBTTagList actions = new NBTTagList();
|
|
||||||
for (int p2 = 0; p2 < inv.getTabNumber(); ++p2) {
|
for (int p2 = 0; p2 < inv.getTabNumber(); ++p2) {
|
||||||
ControlPage thisPage = page[p2];
|
ControlPage thisPage = page[p2];
|
||||||
Panel panel = new Panel(thisPage, 0.0f, 0.0f, thisPage.w(), thisPage.h(), MinecraftGUI.PanelType.Black) {
|
Panel panel = new Panel(thisPage, 0.0f, 0.0f, thisPage.w(), thisPage.h(), MinecraftGUI.PanelType.Black) {
|
||||||
@@ -193,10 +191,11 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
|||||||
slotsIDs[k] = i++;
|
slotsIDs[k] = i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final NBTTagList actions = new NBTTagList();
|
||||||
new ControlSlotArray(thisPage, 8, 8, inv.getPageSize() / 5, 5)
|
new ControlSlotArray(thisPage, 8, 8, inv.getPageSize() / 5, 5)
|
||||||
.create(actions, InventoryType.Machine, slotsIDs);
|
.create(actions, InventoryType.Machine, slotsIDs);
|
||||||
|
MessageCraftGUI.sendToServer(actions);
|
||||||
}
|
}
|
||||||
MessageCraftGUI.sendToServer(actions);
|
|
||||||
x += compartmentPageWidth;
|
x += compartmentPageWidth;
|
||||||
if (tabs2.length > 0) {
|
if (tabs2.length > 0) {
|
||||||
ControlTabBar<Integer> tab2 = new ControlTabBar<Integer>(
|
ControlTabBar<Integer> tab2 = new ControlTabBar<Integer>(
|
||||||
@@ -257,8 +256,8 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
|||||||
ControlSlide slide = new ControlSlide(this, 0.0f, 134.0f, 136.0f, 92.0f, Position.LEFT);
|
ControlSlide slide = new ControlSlide(this, 0.0f, 134.0f, 136.0f, 92.0f, Position.LEFT);
|
||||||
slide.setLabel(I18N.localise("binniecore.machine.storage.tab.properties"));
|
slide.setLabel(I18N.localise("binniecore.machine.storage.tab.properties"));
|
||||||
slide.setSlide(false);
|
slide.setSlide(false);
|
||||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tab.properties"));
|
slide.addHelp(I18N.localise("binniecore.machine.storage.tooltip.properties"));
|
||||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tab.properties.desc"));
|
slide.addHelp(I18N.localise("binniecore.machine.storage.tooltip.properties.desc"));
|
||||||
Panel tabPropertyPanel = new Panel(slide, 16.0f, 8.0f, 112.0f, 76.0f, MinecraftGUI.PanelType.Gray);
|
Panel tabPropertyPanel = new Panel(slide, 16.0f, 8.0f, 112.0f, 76.0f, MinecraftGUI.PanelType.Gray);
|
||||||
int y2 = 4;
|
int y2 = 4;
|
||||||
new ControlText(tabPropertyPanel, new IPoint(4.0f, y2), I18N.localise("binniecore.machine.storage.tab.name"));
|
new ControlText(tabPropertyPanel, new IPoint(4.0f, y2), I18N.localise("binniecore.machine.storage.tab.name"));
|
||||||
@@ -373,20 +372,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
|||||||
.texture(CraftGUITexture.Outline, getArea().inset(new IBorder(0.0f, 6.0f, 0.0f, 0.0f)));
|
.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) {
|
slotGrid = new Control(scroll, 1.0f, 1.0f, 108.0f, 18.0f);
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isChildVisible(IWidget child) {
|
|
||||||
IArea visible = getCroppedZone();
|
|
||||||
if (visible == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float top = -getOffset().y();
|
|
||||||
float childTop = child.getOriginalPosition().y() + child.getOffset().y();
|
|
||||||
return childTop + child.getSize().y() > top && childTop < top + visible.h();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
scroll.setScrollableContent(slotGrid);
|
scroll.setScrollableContent(slotGrid);
|
||||||
new ControlPlayerInventory(this, true).createAndRegister();
|
new ControlPlayerInventory(this, true).createAndRegister();
|
||||||
new ControlTextEdit(this, 16.0f, 16.0f, 100.0f, 14.0f).addEventHandler(new EventTextEdit.Handler() {
|
new ControlTextEdit(this, 16.0f, 16.0f, 100.0f, 14.0f).addEventHandler(new EventTextEdit.Handler() {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package binnie.core.machines.transfer;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
@@ -26,20 +25,23 @@ public class TransferRequest {
|
|||||||
private int[] targetTanks;
|
private int[] targetTanks;
|
||||||
private boolean transferLiquids;
|
private boolean transferLiquids;
|
||||||
private boolean ignoreReadOnly;
|
private boolean ignoreReadOnly;
|
||||||
private EntityPlayer overflowPlayer;
|
private final List<TransferSlot> insertedSlots;
|
||||||
private List<TransferSlot> insertedSlots;
|
private final List<Integer> insertedTanks;
|
||||||
private List<Integer> insertedTanks;
|
|
||||||
|
|
||||||
public TransferRequest(ItemStack toTransfer, IInventory destination) {
|
public TransferRequest(ItemStack toTransfer, IInventory destination) {
|
||||||
itemToTransfer = null;
|
itemToTransfer = null;
|
||||||
returnItem = null;
|
returnItem = null;
|
||||||
targetSlots = null;
|
targetSlots = new int[0];
|
||||||
targetTanks = new int[0];
|
targetTanks = new int[0];
|
||||||
transferLiquids = true;
|
transferLiquids = true;
|
||||||
ignoreReadOnly = false;
|
ignoreReadOnly = false;
|
||||||
overflowPlayer = null;
|
insertedSlots = new ArrayList<>();
|
||||||
insertedSlots = null;
|
insertedTanks = new ArrayList<>();
|
||||||
insertedTanks = null;
|
int[] target = new int[destination.getSizeInventory()];
|
||||||
|
|
||||||
|
for (int i = 0; i < target.length; ++i) {
|
||||||
|
target[i] = i;
|
||||||
|
}
|
||||||
|
|
||||||
int[] targetTanks = new int[0];
|
int[] targetTanks = new int[0];
|
||||||
if (destination instanceof ITankMachine) {
|
if (destination instanceof ITankMachine) {
|
||||||
@@ -56,6 +58,7 @@ public class TransferRequest {
|
|||||||
|
|
||||||
setOrigin(null);
|
setOrigin(null);
|
||||||
setDestination(destination);
|
setDestination(destination);
|
||||||
|
setTargetSlots(target);
|
||||||
setTargetTanks(targetTanks);
|
setTargetTanks(targetTanks);
|
||||||
transferLiquids = true;
|
transferLiquids = true;
|
||||||
}
|
}
|
||||||
@@ -92,71 +95,59 @@ public class TransferRequest {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransferRequest dropOverflow(EntityPlayer player) {
|
|
||||||
overflowPlayer = player;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack getReturnItem() {
|
public ItemStack getReturnItem() {
|
||||||
return returnItem;
|
return returnItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack transfer(boolean doAdd) {
|
public ItemStack transfer(boolean doAdd) {
|
||||||
ItemStack item = doAdd || returnItem == null ? returnItem : returnItem.copy();
|
ItemStack item = returnItem;
|
||||||
if (item == null || destination == null) {
|
if (item == null || destination == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transferLiquids && destination instanceof ITankMachine) {
|
if (transferLiquids && destination instanceof ITankMachine) {
|
||||||
for (int tankID : targetTanks) {
|
for (int tankID : targetTanks) {
|
||||||
ItemStack itemBeforeTransfer = item.copy();
|
|
||||||
item = transferToTank(item, origin, (ITankMachine) destination, tankID, doAdd);
|
item = transferToTank(item, origin, (ITankMachine) destination, tankID, doAdd);
|
||||||
if (item == null || !ItemStack.areItemStacksEqual(item, itemBeforeTransfer)) {
|
if (item != null) {
|
||||||
break;
|
item = transferFromTank(item, origin, (ITankMachine) destination, tankID, doAdd);
|
||||||
}
|
|
||||||
|
|
||||||
item = transferFromTank(item, origin, (ITankMachine) destination, tankID, doAdd);
|
|
||||||
if (item == null || !ItemStack.areItemStacksEqual(item, itemBeforeTransfer)) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO simplify
|
// TODO simplify
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
int[] slots = getTargetSlots();
|
for (int slot : targetSlots) {
|
||||||
for (int slot : slots) {
|
|
||||||
if (destination.isItemValidForSlot(slot, item) || ignoreReadOnly) {
|
if (destination.isItemValidForSlot(slot, item) || ignoreReadOnly) {
|
||||||
if (!(destination instanceof IInventorySlots)
|
if (!(destination instanceof IInventorySlots)
|
||||||
|| ((IInventorySlots) destination).getSlot(slot) == null
|
|| ((IInventorySlots) destination).getSlot(slot) == null
|
||||||
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
|
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
|
||||||
ItemStack merged = destination.getStackInSlot(slot);
|
if (destination.getStackInSlot(slot) != null) {
|
||||||
if (merged != null && item.isStackable()
|
if (item.isStackable() && destination.getInventoryStackLimit() > 1) {
|
||||||
&& destination.getInventoryStackLimit() > 1
|
ItemStack merged = destination.getStackInSlot(slot).copy();
|
||||||
&& areItemsEqual(item, merged)) {
|
ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy());
|
||||||
int amount = Math.min(item.stackSize, merged.getMaxStackSize() - merged.stackSize);
|
item = newStacks[0];
|
||||||
if (amount > 0) {
|
if (!areItemsEqual(merged, newStacks[1])) {
|
||||||
getInsertedSlots().add(new TransferSlot(slot, destination));
|
insertedSlots.add(new TransferSlot(slot, destination));
|
||||||
if (doAdd) {
|
}
|
||||||
ItemStack newStack = merged.copy();
|
if (doAdd) {
|
||||||
newStack.stackSize += amount;
|
destination.setInventorySlotContents(slot, newStacks[1]);
|
||||||
destination.setInventorySlotContents(slot, newStack);
|
}
|
||||||
|
if (item == null) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
item.stackSize -= amount;
|
|
||||||
if (item.stackSize <= 0) return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int slot : slots) {
|
for (int slot : targetSlots) {
|
||||||
if (destination.isItemValidForSlot(slot, item) || ignoreReadOnly) {
|
if (destination.isItemValidForSlot(slot, item) || ignoreReadOnly) {
|
||||||
if (!(destination instanceof IInventorySlots)
|
if (!(destination instanceof IInventorySlots)
|
||||||
|| ((IInventorySlots) destination).getSlot(slot) == null
|
|| ((IInventorySlots) destination).getSlot(slot) == null
|
||||||
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
|
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
|
||||||
if (destination.getStackInSlot(slot) == null) {
|
if (destination.getStackInSlot(slot) == null) {
|
||||||
getInsertedSlots().add(new TransferSlot(slot, destination));
|
insertedSlots.add(new TransferSlot(slot, destination));
|
||||||
if (doAdd) {
|
if (doAdd) {
|
||||||
ItemStack movedStack = item.copy();
|
ItemStack movedStack = item.copy();
|
||||||
if (movedStack.stackSize > destination.getInventoryStackLimit()) {
|
if (movedStack.stackSize > destination.getInventoryStackLimit()) {
|
||||||
@@ -209,13 +200,11 @@ public class TransferRequest {
|
|||||||
|
|
||||||
private ItemStack transferToTankUsingFluidContainer(ItemStack item, IInventory origin, ITankMachine destination,
|
private ItemStack transferToTankUsingFluidContainer(ItemStack item, IInventory origin, ITankMachine destination,
|
||||||
int tankID, boolean doAdd) {
|
int tankID, boolean doAdd) {
|
||||||
if (item == null || origin == null || !(item.getItem() instanceof IFluidContainerItem fluidContainer)) {
|
if (item == null || !(item.getItem() instanceof IFluidContainerItem fluidContainer)) {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack singleContainer = item.copy();
|
FluidStack fluid = fluidContainer.getFluid(item);
|
||||||
singleContainer.stackSize = 1;
|
|
||||||
FluidStack fluid = fluidContainer.getFluid(singleContainer);
|
|
||||||
if (fluid == null) {
|
if (fluid == null) {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
@@ -227,22 +216,11 @@ public class TransferRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int maxFill = tank.fill(fluid, false);
|
int maxFill = tank.fill(fluid, false);
|
||||||
FluidStack toTake = fluidContainer.drain(singleContainer, maxFill, true);
|
FluidStack toTake = fluidContainer.drain(item, maxFill, true);
|
||||||
if (toTake == null || toTake.amount <= 0) {
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
TransferRequest containerDump = createContainerDump(singleContainer, origin);
|
|
||||||
boolean dropContainer = containerDump.transfer(false) != null;
|
|
||||||
if (dropContainer && overflowPlayer == null) {
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doAdd) {
|
if (doAdd) {
|
||||||
tank.fill(toTake, true);
|
tank.fill(toTake, true);
|
||||||
dumpContainer(singleContainer, containerDump, dropContainer);
|
|
||||||
}
|
}
|
||||||
return removeSingleContainer(item);
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack transferToTankUsingContainerData(ItemStack item, IInventory origin, ITankMachine destination,
|
private ItemStack transferToTankUsingContainerData(ItemStack item, IInventory origin, ITankMachine destination,
|
||||||
@@ -327,69 +305,24 @@ public class TransferRequest {
|
|||||||
|
|
||||||
private ItemStack transferFromTankUsingFluidContainer(ItemStack item, IInventory origin, ITankMachine destination,
|
private ItemStack transferFromTankUsingFluidContainer(ItemStack item, IInventory origin, ITankMachine destination,
|
||||||
int tankID, boolean doAdd) {
|
int tankID, boolean doAdd) {
|
||||||
if (item == null || origin == null || !(item.getItem() instanceof IFluidContainerItem fluidContainer)) {
|
if (item == null || !(item.getItem() instanceof IFluidContainerItem fluidContainer)) {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack singleContainer = item.copy();
|
|
||||||
singleContainer.stackSize = 1;
|
|
||||||
IFluidTank tank = destination.getTanks()[tankID];
|
IFluidTank tank = destination.getTanks()[tankID];
|
||||||
FluidStack fluid = tank.getFluid();
|
FluidStack fluid = tank.getFluid();
|
||||||
if (fluid == null) {
|
if (fluid == null) {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
int amount = fluidContainer.fill(singleContainer, fluid, false);
|
int amount = fluidContainer.fill(item, fluid, false);
|
||||||
FluidStack drained = tank.drain(amount, false);
|
amount = Math.min(amount, (tank.drain(amount, false) == null) ? 0 : tank.drain(amount, false).amount);
|
||||||
if (drained == null || drained.amount <= 0) {
|
if (amount <= 0) {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
int amountFilled = fluidContainer.fill(singleContainer, drained, true);
|
fluidContainer.fill(item, tank.drain(amount, doAdd), doAdd);
|
||||||
if (amountFilled <= 0) {
|
return item;
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
TransferRequest containerDump = createContainerDump(singleContainer, origin);
|
|
||||||
boolean dropContainer = containerDump.transfer(false) != null;
|
|
||||||
if (dropContainer && overflowPlayer == null) {
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doAdd) {
|
|
||||||
tank.drain(amountFilled, true);
|
|
||||||
dumpContainer(singleContainer, containerDump, dropContainer);
|
|
||||||
}
|
|
||||||
return removeSingleContainer(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
private TransferRequest createContainerDump(ItemStack container, IInventory origin) {
|
|
||||||
TransferRequest containerDump = new TransferRequest(container, origin).setTargetTanks(new int[0]);
|
|
||||||
if (overflowPlayer != null && origin == overflowPlayer.inventory) {
|
|
||||||
int[] mainInventorySlots = new int[overflowPlayer.inventory.mainInventory.length];
|
|
||||||
for (int i = 0; i < mainInventorySlots.length; ++i) {
|
|
||||||
mainInventorySlots[i] = i;
|
|
||||||
}
|
|
||||||
containerDump.setTargetSlots(mainInventorySlots);
|
|
||||||
}
|
|
||||||
return containerDump;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dumpContainer(ItemStack container, TransferRequest containerDump, boolean dropContainer) {
|
|
||||||
if (dropContainer) {
|
|
||||||
overflowPlayer.dropPlayerItemWithRandomChoice(container.copy(), false);
|
|
||||||
} else {
|
|
||||||
containerDump.transfer(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static ItemStack removeSingleContainer(ItemStack item) {
|
|
||||||
if (item.stackSize <= 1) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
ItemStack leftover = item.copy();
|
|
||||||
--leftover.stackSize;
|
|
||||||
return leftover;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack transferFromTankUsingContainerData(ItemStack item, IInventory origin, ITankMachine destination,
|
private ItemStack transferFromTankUsingContainerData(ItemStack item, IInventory origin, ITankMachine destination,
|
||||||
@@ -466,16 +399,10 @@ public class TransferRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<TransferSlot> getInsertedSlots() {
|
public List<TransferSlot> getInsertedSlots() {
|
||||||
if (insertedSlots == null) {
|
|
||||||
insertedSlots = new ArrayList<>();
|
|
||||||
}
|
|
||||||
return insertedSlots;
|
return insertedSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Integer> getInsertedTanks() {
|
public List<Integer> getInsertedTanks() {
|
||||||
if (insertedTanks == null) {
|
|
||||||
insertedTanks = new ArrayList<>();
|
|
||||||
}
|
|
||||||
return insertedTanks;
|
return insertedTanks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,12 +419,6 @@ public class TransferRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int[] getTargetSlots() {
|
public int[] getTargetSlots() {
|
||||||
if (targetSlots == null) {
|
|
||||||
targetSlots = new int[destination.getSizeInventory()];
|
|
||||||
for (int i = 0; i < targetSlots.length; ++i) {
|
|
||||||
targetSlots[i] = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return targetSlots;
|
return targetSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ public class BinnieResource {
|
|||||||
String mod;
|
String mod;
|
||||||
private final ResourceType type;
|
private final ResourceType type;
|
||||||
String path;
|
String path;
|
||||||
private final String shortPath;
|
|
||||||
private final ResourceLocation resourceLocation;
|
|
||||||
|
|
||||||
public BinnieResource(AbstractMod mod, ResourceType type, String path) {
|
public BinnieResource(AbstractMod mod, ResourceType type, String path) {
|
||||||
this(mod.getModID(), type, path);
|
this(mod.getModID(), type, path);
|
||||||
@@ -20,15 +18,13 @@ public class BinnieResource {
|
|||||||
mod = modid;
|
mod = modid;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.path = path;
|
this.path = path;
|
||||||
shortPath = "textures/" + type + "/" + path;
|
|
||||||
resourceLocation = new ResourceLocation(modid, shortPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResourceLocation getResourceLocation() {
|
public ResourceLocation getResourceLocation() {
|
||||||
return resourceLocation;
|
return new ResourceLocation(mod, "textures/" + type.toString() + "/" + path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getShortPath() {
|
public String getShortPath() {
|
||||||
return shortPath;
|
return "textures/" + type.toString() + "/" + path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package binnie.extrabees.apiary.machine;
|
package binnie.extrabees.apiary.machine;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
@@ -65,7 +66,8 @@ public enum AlvearyMachine implements IMachineType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
public void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||||
|
RenderBlocks renderer) {
|
||||||
MachineRendererBlock.instance.renderMachine(machineTexture, x, y, z, partialTick);
|
MachineRendererBlock.instance.renderMachine(machineTexture, x, y, z, partialTick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package binnie.genetics.config;
|
package binnie.extrabees.config;
|
||||||
|
|
||||||
import static binnie.genetics.Genetics.GENETICS_MODID;
|
import static binnie.extrabees.ExtraBees.EB_MODID;
|
||||||
|
|
||||||
import com.gtnewhorizon.gtnhlib.config.Config;
|
import com.gtnewhorizon.gtnhlib.config.Config;
|
||||||
|
|
||||||
@Config(modid = GENETICS_MODID)
|
@Config(modid = EB_MODID)
|
||||||
public class GeneticsConfig {
|
public class EBConfigMachines {
|
||||||
|
|
||||||
@Config.Comment("Percentage chance of Isolator consuming bee. 0 never consumes, 1 always does.")
|
@Config.Comment("Percentage chance of Isolator consuming bee. 0 never consumes, 1 always does.")
|
||||||
@Config.RangeFloat(min = 0f, max = 1f)
|
@Config.RangeFloat(min = 0f, max = 1f)
|
||||||
@@ -108,11 +108,7 @@ public enum ExtraBeeItems implements IItemMisc {
|
|||||||
if (!OreDictionary.getOres("ingot" + item.metalString).isEmpty()) {
|
if (!OreDictionary.getOres("ingot" + item.metalString).isEmpty()) {
|
||||||
ingot = OreDictionary.getOres("ingot" + item.metalString).get(0).copy();
|
ingot = OreDictionary.getOres("ingot" + item.metalString).get(0).copy();
|
||||||
}
|
}
|
||||||
if (item == ExtraBeeItems.PlatinumDust
|
if (!OreDictionary.getOres("dust" + item.metalString).isEmpty()) {
|
||||||
&& !OreDictionary.getOres("dustPlatinumMetallicPowder").isEmpty()) {
|
|
||||||
dust = OreDictionary.getOres("dustPlatinumMetallicPowder").get(0).copy();
|
|
||||||
dust.stackSize = 2;
|
|
||||||
} else if (!OreDictionary.getOres("dust" + item.metalString).isEmpty()) {
|
|
||||||
dust = OreDictionary.getOres("dust" + item.metalString).get(0).copy();
|
dust = OreDictionary.getOres("dust" + item.metalString).get(0).copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import binnie.extrabees.genetics.ExtraBeesFlowers;
|
|||||||
import cofh.api.energy.IEnergyReceiver;
|
import cofh.api.energy.IEnergyReceiver;
|
||||||
import forestry.api.apiculture.BeeManager;
|
import forestry.api.apiculture.BeeManager;
|
||||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||||
|
import forestry.api.apiculture.IArmorApiarist;
|
||||||
import forestry.api.apiculture.IBeeGenome;
|
import forestry.api.apiculture.IBeeGenome;
|
||||||
import forestry.api.apiculture.IBeeHousing;
|
import forestry.api.apiculture.IBeeHousing;
|
||||||
import forestry.api.genetics.AlleleManager;
|
import forestry.api.genetics.AlleleManager;
|
||||||
@@ -110,6 +111,43 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean wearsHelmet(EntityPlayer player) {
|
||||||
|
ItemStack armorItem = player.inventory.armorInventory[3];
|
||||||
|
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean wearsChest(EntityPlayer player) {
|
||||||
|
ItemStack armorItem = player.inventory.armorInventory[2];
|
||||||
|
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean wearsLegs(EntityPlayer player) {
|
||||||
|
ItemStack armorItem = player.inventory.armorInventory[1];
|
||||||
|
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean wearsBoots(EntityPlayer player) {
|
||||||
|
ItemStack armorItem = player.inventory.armorInventory[0];
|
||||||
|
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int wearsItems(EntityPlayer player) {
|
||||||
|
int count = 0;
|
||||||
|
if (wearsHelmet(player)) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (wearsChest(player)) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (wearsLegs(player)) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (wearsBoots(player)) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
public void register() {
|
public void register() {
|
||||||
AlleleManager.alleleRegistry.registerAllele(this);
|
AlleleManager.alleleRegistry.registerAllele(this);
|
||||||
}
|
}
|
||||||
@@ -333,7 +371,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
|||||||
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
||||||
int damage = 4;
|
int damage = 4;
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
int count = BeeManager.armorApiaristHelper.wearsItems(entity, getUID(), true);
|
int count = wearsItems((EntityPlayer) entity);
|
||||||
if (count > 3) {
|
if (count > 3) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -358,8 +396,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
|||||||
|
|
||||||
private void onHungerEffect(IBeeGenome genome, IBeeHousing housing, World world) {
|
private void onHungerEffect(IBeeGenome genome, IBeeHousing housing, World world) {
|
||||||
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
||||||
if (world.rand.nextInt(4)
|
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||||
< BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
player.addExhaustion(4.0f);
|
player.addExhaustion(4.0f);
|
||||||
@@ -369,8 +406,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
|||||||
|
|
||||||
private void onPotionEffect(IBeeGenome genome, IBeeHousing housing, World world, PotionEffect potion) {
|
private void onPotionEffect(IBeeGenome genome, IBeeHousing housing, World world, PotionEffect potion) {
|
||||||
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
||||||
if (world.rand.nextInt(4)
|
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||||
< BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
player.addPotionEffect(potion);
|
player.addPotionEffect(potion);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public enum EnumHoneyDrop implements IItemEnum {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return liquidName == null || liquidName.isEmpty() || FluidRegistry.isFluidRegistered(liquidName);
|
return liquidName == null || FluidRegistry.isFluidRegistered(liquidName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ public class ItemHoneyComb extends ItemProduct {
|
|||||||
OreDictionary.registerOre("gemEmerald", Items.emerald);
|
OreDictionary.registerOre("gemEmerald", Items.emerald);
|
||||||
OreDictionary.registerOre("gemLapis", new ItemStack(Items.dye, 1, 4));
|
OreDictionary.registerOre("gemLapis", new ItemStack(Items.dye, 1, 4));
|
||||||
|
|
||||||
EnumHoneyComb.BARREN.tryAddProduct(beeswax, 1.00f);
|
EnumHoneyComb.BARREN.addProduct(beeswax, 1.00f);
|
||||||
EnumHoneyComb.BARREN.addProduct(honeyDrop, 0.50f);
|
EnumHoneyComb.BARREN.addProduct(honeyDrop, 0.50f);
|
||||||
|
|
||||||
EnumHoneyComb.ROTTEN.tryAddProduct(beeswax, 0.20f);
|
EnumHoneyComb.ROTTEN.addProduct(beeswax, 0.20f);
|
||||||
EnumHoneyComb.ROTTEN.addProduct(honeyDrop, 0.20f);
|
EnumHoneyComb.ROTTEN.addProduct(honeyDrop, 0.20f);
|
||||||
EnumHoneyComb.ROTTEN.addProduct(new ItemStack(Items.rotten_flesh, 1, 0), 0.80f);
|
EnumHoneyComb.ROTTEN.addProduct(new ItemStack(Items.rotten_flesh, 1, 0), 0.80f);
|
||||||
|
|
||||||
EnumHoneyComb.BONE.tryAddProduct(beeswax, 0.20f);
|
EnumHoneyComb.BONE.addProduct(beeswax, 0.20f);
|
||||||
EnumHoneyComb.BONE.addProduct(honeyDrop, 0.20f);
|
EnumHoneyComb.BONE.addProduct(honeyDrop, 0.20f);
|
||||||
EnumHoneyComb.BONE.addProduct(new ItemStack(Items.dye, 1, 15), 0.80f);
|
EnumHoneyComb.BONE.addProduct(new ItemStack(Items.dye, 1, 15), 0.80f);
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public class ItemHoneyComb extends ItemProduct {
|
|||||||
EnumHoneyComb.WATER.tryAddProduct(EnumPropolis.WATER, 1.00f);
|
EnumHoneyComb.WATER.tryAddProduct(EnumPropolis.WATER, 1.00f);
|
||||||
EnumHoneyComb.WATER.addProduct(honeyDrop, 0.90f);
|
EnumHoneyComb.WATER.addProduct(honeyDrop, 0.90f);
|
||||||
|
|
||||||
EnumHoneyComb.STONE.tryAddProduct(beeswax, 0.50f);
|
EnumHoneyComb.STONE.addProduct(beeswax, 0.50f);
|
||||||
EnumHoneyComb.STONE.addProduct(honeyDrop, 0.25f);
|
EnumHoneyComb.STONE.addProduct(honeyDrop, 0.25f);
|
||||||
|
|
||||||
EnumHoneyComb.MILK.tryAddProduct(EnumHoneyDrop.MILK, 1.00f);
|
EnumHoneyComb.MILK.tryAddProduct(EnumHoneyDrop.MILK, 1.00f);
|
||||||
@@ -84,7 +84,7 @@ public class ItemHoneyComb extends ItemProduct {
|
|||||||
EnumHoneyComb.LATEX.active = false;
|
EnumHoneyComb.LATEX.active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnumHoneyComb.REDSTONE.tryAddProduct(beeswax, 0.80f);
|
EnumHoneyComb.REDSTONE.addProduct(beeswax, 0.80f);
|
||||||
EnumHoneyComb.REDSTONE.addProduct(new ItemStack(Items.redstone, 1, 0), 1.00f);
|
EnumHoneyComb.REDSTONE.addProduct(new ItemStack(Items.redstone, 1, 0), 1.00f);
|
||||||
EnumHoneyComb.REDSTONE.addProduct(honeyDrop, 0.50f);
|
EnumHoneyComb.REDSTONE.addProduct(honeyDrop, 0.50f);
|
||||||
|
|
||||||
@@ -119,14 +119,14 @@ public class ItemHoneyComb extends ItemProduct {
|
|||||||
EnumHoneyComb.URANIUM.tryAddProduct(OreDictionary.getOres("crushedUranium").get(0), 0.50f);
|
EnumHoneyComb.URANIUM.tryAddProduct(OreDictionary.getOres("crushedUranium").get(0), 0.50f);
|
||||||
}
|
}
|
||||||
|
|
||||||
EnumHoneyComb.CLAY.tryAddProduct(beeswax, 0.25f);
|
EnumHoneyComb.CLAY.addProduct(beeswax, 0.25f);
|
||||||
EnumHoneyComb.CLAY.addProduct(honeyDrop, 0.80f);
|
EnumHoneyComb.CLAY.addProduct(honeyDrop, 0.80f);
|
||||||
EnumHoneyComb.CLAY.addProduct(new ItemStack(Items.clay_ball), 0.80f);
|
EnumHoneyComb.CLAY.addProduct(new ItemStack(Items.clay_ball), 0.80f);
|
||||||
|
|
||||||
EnumHoneyComb.OLD.tryAddProduct(beeswax, 1.00f);
|
EnumHoneyComb.OLD.addProduct(beeswax, 1.00f);
|
||||||
EnumHoneyComb.OLD.addProduct(honeyDrop, 0.90f);
|
EnumHoneyComb.OLD.addProduct(honeyDrop, 0.90f);
|
||||||
|
|
||||||
EnumHoneyComb.FUNGAL.tryAddProduct(beeswax, 0.90f);
|
EnumHoneyComb.FUNGAL.addProduct(beeswax, 0.90f);
|
||||||
EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.brown_mushroom_block, 1, 0), 1.00f);
|
EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.brown_mushroom_block, 1, 0), 1.00f);
|
||||||
EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.red_mushroom_block, 1, 0), 0.75f);
|
EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.red_mushroom_block, 1, 0), 0.75f);
|
||||||
|
|
||||||
@@ -139,11 +139,11 @@ public class ItemHoneyComb extends ItemProduct {
|
|||||||
EnumHoneyComb.VENOMOUS.addProduct(beeswax, 0.80f);
|
EnumHoneyComb.VENOMOUS.addProduct(beeswax, 0.80f);
|
||||||
EnumHoneyComb.VENOMOUS.tryAddProduct(EnumHoneyDrop.POISON, 0.80f);
|
EnumHoneyComb.VENOMOUS.tryAddProduct(EnumHoneyDrop.POISON, 0.80f);
|
||||||
|
|
||||||
EnumHoneyComb.SLIME.tryAddProduct(beeswax, 1.00f);
|
EnumHoneyComb.SLIME.addProduct(beeswax, 1.00f);
|
||||||
EnumHoneyComb.SLIME.addProduct(honeyDrop, 0.75f);
|
EnumHoneyComb.SLIME.addProduct(honeyDrop, 0.75f);
|
||||||
EnumHoneyComb.SLIME.addProduct(new ItemStack(Items.slime_ball, 1, 0), 0.75f);
|
EnumHoneyComb.SLIME.addProduct(new ItemStack(Items.slime_ball, 1, 0), 0.75f);
|
||||||
|
|
||||||
EnumHoneyComb.BLAZE.tryAddProduct(beeswax, 0.75f);
|
EnumHoneyComb.BLAZE.addProduct(beeswax, 0.75f);
|
||||||
EnumHoneyComb.BLAZE.addProduct(new ItemStack(Items.blaze_powder, 1, 0), 1.00f);
|
EnumHoneyComb.BLAZE.addProduct(new ItemStack(Items.blaze_powder, 1, 0), 1.00f);
|
||||||
|
|
||||||
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
||||||
@@ -178,7 +178,7 @@ public class ItemHoneyComb extends ItemProduct {
|
|||||||
EnumHoneyComb.PLATINUM.tryAddProduct(ExtraBeeItems.PlatinumDust, 1.00f);
|
EnumHoneyComb.PLATINUM.tryAddProduct(ExtraBeeItems.PlatinumDust, 1.00f);
|
||||||
|
|
||||||
EnumHoneyComb.LAPIS.copyProducts(EnumHoneyComb.STONE);
|
EnumHoneyComb.LAPIS.copyProducts(EnumHoneyComb.STONE);
|
||||||
EnumHoneyComb.LAPIS.tryAddProduct(new ItemStack(Items.dye, 6, 4), 1.00f);
|
EnumHoneyComb.LAPIS.addProduct(new ItemStack(Items.dye, 6, 4), 1.00f);
|
||||||
|
|
||||||
EnumHoneyComb.EMERALD.copyProducts(EnumHoneyComb.STONE);
|
EnumHoneyComb.EMERALD.copyProducts(EnumHoneyComb.STONE);
|
||||||
EnumHoneyComb.EMERALD.tryAddProduct(ExtraBeeItems.EmeraldShard, 1.00f);
|
EnumHoneyComb.EMERALD.tryAddProduct(ExtraBeeItems.EmeraldShard, 1.00f);
|
||||||
@@ -195,7 +195,7 @@ public class ItemHoneyComb extends ItemProduct {
|
|||||||
EnumHoneyComb.RED.addProduct(honeyDrop, 0.80f);
|
EnumHoneyComb.RED.addProduct(honeyDrop, 0.80f);
|
||||||
EnumHoneyComb.RED.addProduct(beeswax, 0.80f);
|
EnumHoneyComb.RED.addProduct(beeswax, 0.80f);
|
||||||
|
|
||||||
EnumHoneyComb.GLOWSTONE.tryAddProduct(honeyDrop, 0.25f);
|
EnumHoneyComb.GLOWSTONE.addProduct(honeyDrop, 0.25f);
|
||||||
EnumHoneyComb.GLOWSTONE.addProduct(new ItemStack(Items.glowstone_dust), 1.00f);
|
EnumHoneyComb.GLOWSTONE.addProduct(new ItemStack(Items.glowstone_dust), 1.00f);
|
||||||
|
|
||||||
EnumHoneyComb.SALTPETER.addProduct(honeyDrop, 0.25f);
|
EnumHoneyComb.SALTPETER.addProduct(honeyDrop, 0.25f);
|
||||||
@@ -254,7 +254,7 @@ public class ItemHoneyComb extends ItemProduct {
|
|||||||
case 15 -> ExtraBeeItems.WhiteDye.get(1);
|
case 15 -> ExtraBeeItems.WhiteDye.get(1);
|
||||||
default -> new ItemStack(Items.dye, 1, k);
|
default -> new ItemStack(Items.dye, 1, k);
|
||||||
};
|
};
|
||||||
type.tryAddProduct(drop.get(1), 1.00f);
|
type.addProduct(drop.get(1), 1.00f);
|
||||||
drop.addRemenant(dye);
|
drop.addRemenant(dye);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public interface ILogType {
|
|||||||
Rosewood("rosewood", 0x998666, PlankType.ExtraTreePlanks.Rosewood),
|
Rosewood("rosewood", 0x998666, PlankType.ExtraTreePlanks.Rosewood),
|
||||||
Purpleheart("purpleheart", 0x9392a2, PlankType.ExtraTreePlanks.Purpleheart),
|
Purpleheart("purpleheart", 0x9392a2, PlankType.ExtraTreePlanks.Purpleheart),
|
||||||
Iroko("iroko", 0x605c5b, PlankType.ExtraTreePlanks.Iroko),
|
Iroko("iroko", 0x605c5b, PlankType.ExtraTreePlanks.Iroko),
|
||||||
Ginkgo("ginkgo", 0xadae9c, PlankType.ExtraTreePlanks.Ginkgo),
|
Gingko("gingko", 0xadae9c, PlankType.ExtraTreePlanks.Gingko),
|
||||||
Eucalyptus("eucalyptus", 0xeadeda, PlankType.ExtraTreePlanks.Eucalyptus),
|
Eucalyptus("eucalyptus", 0xeadeda, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||||
Eucalyptus2("eucalyptus", 0x867e65, PlankType.ExtraTreePlanks.Eucalyptus),
|
Eucalyptus2("eucalyptus", 0x867e65, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||||
Box("box", 0xab6f57, PlankType.ExtraTreePlanks.Box),
|
Box("box", 0xab6f57, PlankType.ExtraTreePlanks.Box),
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ public class ItemETSlab extends ItemMetadata {
|
|||||||
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
||||||
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
||||||
isFullBlock = (block != theHalfSlab);
|
isFullBlock = (block != theHalfSlab);
|
||||||
|
setMaxDamage(0);
|
||||||
|
setHasSubtypes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ public class ItemETStairs extends ItemBlock {
|
|||||||
super(block);
|
super(block);
|
||||||
setCreativeTab(CreativeTabs.tabBlock);
|
setCreativeTab(CreativeTabs.tabBlock);
|
||||||
setUnlocalizedName("stairs");
|
setUnlocalizedName("stairs");
|
||||||
setMaxDamage(0);
|
|
||||||
setHasSubtypes(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class PlankType {
|
|||||||
Olive(0xb0ad88),
|
Olive(0xb0ad88),
|
||||||
Sweetgum(0xd59658),
|
Sweetgum(0xd59658),
|
||||||
Rosewood(0x761500),
|
Rosewood(0x761500),
|
||||||
Ginkgo(0xf4e7ba),
|
Gingko(0xf4e7ba),
|
||||||
PinkIvory(0xec8ca0);
|
PinkIvory(0xec8ca0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
|||||||
Acorn(6, 0x72b226, 0xad6a1d, FruitSprite.Tiny),
|
Acorn(6, 0x72b226, 0xad6a1d, FruitSprite.Tiny),
|
||||||
Elderberry(9, 0x71975d, 0x515b43, FruitSprite.Tiny),
|
Elderberry(9, 0x71975d, 0x515b43, FruitSprite.Tiny),
|
||||||
Olive(9, 0x879e35, 0x62572a, FruitSprite.Small),
|
Olive(9, 0x879e35, 0x62572a, FruitSprite.Small),
|
||||||
GinkgoNut(7, 0x8c975b, 0xe5daad, FruitSprite.Tiny),
|
GingkoNut(7, 0x8c975b, 0xe5daad, FruitSprite.Tiny),
|
||||||
Coffee(8, 0x716d1d, 0xf84f66, FruitSprite.Tiny),
|
Coffee(8, 0x716d1d, 0xf84f66, FruitSprite.Tiny),
|
||||||
Pear(10, 0x9f8f51, 0x9fd551, FruitSprite.Pear),
|
Pear(10, 0x9f8f51, 0x9fd551, FruitSprite.Pear),
|
||||||
OsangeOsange(10, 0x979752, 0xa2bf27, FruitSprite.Larger),
|
OsangeOsange(10, 0x979752, 0xa2bf27, FruitSprite.Larger),
|
||||||
@@ -205,8 +205,8 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
|||||||
ExtraTreeFruitGene.Elderberry.setFamily(familyPrune);
|
ExtraTreeFruitGene.Elderberry.setFamily(familyPrune);
|
||||||
ExtraTreeFruitGene.Olive.addProduct(Food.Olive.get(1), 1.0f);
|
ExtraTreeFruitGene.Olive.addProduct(Food.Olive.get(1), 1.0f);
|
||||||
ExtraTreeFruitGene.Olive.setFamily(familyPrune);
|
ExtraTreeFruitGene.Olive.setFamily(familyPrune);
|
||||||
ExtraTreeFruitGene.GinkgoNut.addProduct(Food.GinkgoNut.get(1), 1.0f);
|
ExtraTreeFruitGene.GingkoNut.addProduct(Food.GingkoNut.get(1), 1.0f);
|
||||||
ExtraTreeFruitGene.GinkgoNut.setFamily(familyNuts);
|
ExtraTreeFruitGene.GingkoNut.setFamily(familyNuts);
|
||||||
ExtraTreeFruitGene.Coffee.addProduct(Food.Coffee.get(1), 1.0f);
|
ExtraTreeFruitGene.Coffee.addProduct(Food.Coffee.get(1), 1.0f);
|
||||||
ExtraTreeFruitGene.Coffee.setFamily(familyJungle);
|
ExtraTreeFruitGene.Coffee.setFamily(familyJungle);
|
||||||
ExtraTreeFruitGene.Pear.addProduct(Food.Pear.get(1), 1.0f);
|
ExtraTreeFruitGene.Pear.addProduct(Food.Pear.get(1), 1.0f);
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class ExtraTreeMutation implements ITreeMutation {
|
|||||||
new ExtraTreeMutation(ExtraTreeSpecies.Brazilwood, getVanilla("Kapok"), ExtraTreeSpecies.Purpleheart, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.Brazilwood, getVanilla("Kapok"), ExtraTreeSpecies.Purpleheart, 10);
|
||||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Rosewood, 10);
|
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Rosewood, 10);
|
||||||
new ExtraTreeMutation(ExtraTreeSpecies.Rosewood, getVanilla("Kapok"), ExtraTreeSpecies.Logwood, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.Rosewood, getVanilla("Kapok"), ExtraTreeSpecies.Logwood, 10);
|
||||||
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ExtraTreeSpecies.Ginkgo, 10);
|
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ExtraTreeSpecies.Gingko, 10);
|
||||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Jungle"), ExtraTreeSpecies.Brazilnut, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Jungle"), ExtraTreeSpecies.Brazilnut, 10);
|
||||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.RoseGum, 10);
|
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.RoseGum, 10);
|
||||||
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Mahogony"), ExtraTreeSpecies.SwampGum, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Mahogony"), ExtraTreeSpecies.SwampGum, 10);
|
||||||
@@ -165,8 +165,8 @@ public class ExtraTreeMutation implements ITreeMutation {
|
|||||||
new ExtraTreeMutation(ExtraTreeSpecies.Allspice, ExtraTreeSpecies.Clove, ExtraTreeSpecies.StarAnise, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.Allspice, ExtraTreeSpecies.Clove, ExtraTreeSpecies.StarAnise, 10);
|
||||||
new ExtraTreeMutation(getVanilla("Jungle"), ExtraTreeSpecies.Orange, ExtraTreeSpecies.Mango, 10);
|
new ExtraTreeMutation(getVanilla("Jungle"), ExtraTreeSpecies.Orange, ExtraTreeSpecies.Mango, 10);
|
||||||
new ExtraTreeMutation(ExtraTreeSpecies.StarAnise, ExtraTreeSpecies.Mango, ExtraTreeSpecies.Starfruit, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.StarAnise, ExtraTreeSpecies.Mango, ExtraTreeSpecies.Starfruit, 10);
|
||||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Ginkgo, ExtraTreeSpecies.Candlenut, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Candlenut, 10);
|
||||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Ginkgo, ExtraTreeSpecies.Chilli, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Chilli, 10);
|
||||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Alder, ExtraTreeSpecies.DwarfHazel, 10);
|
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Alder, ExtraTreeSpecies.DwarfHazel, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
|||||||
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenRosewood.class),
|
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenRosewood.class),
|
||||||
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenPurpleheart.class),
|
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenPurpleheart.class),
|
||||||
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenIroko.class),
|
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenIroko.class),
|
||||||
Ginkgo("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Ginkgo, ExtraTreeFruitGene.GinkgoNut,
|
Gingko("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Gingko, ExtraTreeFruitGene.GingkoNut,
|
||||||
WorldGenGingko.class),
|
WorldGenGingko.class),
|
||||||
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut,
|
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut,
|
||||||
WorldGenBrazilNut.class),
|
WorldGenBrazilNut.class),
|
||||||
@@ -548,7 +548,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
|||||||
ExtraTreeSpecies.Iroko.addFamily(familyNuts).addFamily(familyJungle).setHeight(EnumAllele.Height.AVERAGE)
|
ExtraTreeSpecies.Iroko.addFamily(familyNuts).addFamily(familyJungle).setHeight(EnumAllele.Height.AVERAGE)
|
||||||
.setFertility(EnumAllele.Saplings.LOW);
|
.setFertility(EnumAllele.Saplings.LOW);
|
||||||
|
|
||||||
ExtraTreeSpecies.Ginkgo.addFamily(familyNuts).addFamily(familyJungle).setLeafType(LeafType.JUNGLE)
|
ExtraTreeSpecies.Gingko.addFamily(familyNuts).addFamily(familyJungle).setLeafType(LeafType.JUNGLE)
|
||||||
.setHeight(EnumAllele.Height.LARGE).setYield(EnumAllele.Yield.LOWER)
|
.setHeight(EnumAllele.Height.LARGE).setYield(EnumAllele.Yield.LOWER)
|
||||||
.setSappiness(EnumAllele.Sappiness.LOW);
|
.setSappiness(EnumAllele.Sappiness.LOW);
|
||||||
|
|
||||||
@@ -902,7 +902,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerIcons(IIconRegister register) {
|
public void registerIcons(IIconRegister register) {
|
||||||
for (SaplingType type : SaplingType.VALUES) {
|
for (SaplingType type : SaplingType.values()) {
|
||||||
type.icon = new IIcon[2];
|
type.icon = new IIcon[2];
|
||||||
type.icon[0] = ExtraTrees.proxy.getIcon(register, "saplings/" + type.toString().toLowerCase() + ".trunk");
|
type.icon[0] = ExtraTrees.proxy.getIcon(register, "saplings/" + type.toString().toLowerCase() + ".trunk");
|
||||||
type.icon[1] = ExtraTrees.proxy.getIcon(register, "saplings/" + type.toString().toLowerCase() + ".leaves");
|
type.icon[1] = ExtraTrees.proxy.getIcon(register, "saplings/" + type.toString().toLowerCase() + ".leaves");
|
||||||
|
|||||||
@@ -12,7 +12,5 @@ public enum SaplingType {
|
|||||||
PALM,
|
PALM,
|
||||||
SHRUB;
|
SHRUB;
|
||||||
|
|
||||||
public static final SaplingType[] VALUES = values();
|
|
||||||
|
|
||||||
public IIcon[] icon;
|
public IIcon[] icon;
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ public enum Food implements IItemMisc {
|
|||||||
Acorn(0),
|
Acorn(0),
|
||||||
Elderberry(1),
|
Elderberry(1),
|
||||||
Olive(1),
|
Olive(1),
|
||||||
GinkgoNut(1),
|
GingkoNut(1),
|
||||||
Coffee(0),
|
Coffee(0),
|
||||||
OsangeOrange(1),
|
OsangeOrange(1),
|
||||||
Clove(0),
|
Clove(0),
|
||||||
@@ -129,7 +129,7 @@ public enum Food implements IItemMisc {
|
|||||||
Food.Acorn.ore("Acorn");
|
Food.Acorn.ore("Acorn");
|
||||||
Food.Elderberry.ore("Elderberry");
|
Food.Elderberry.ore("Elderberry");
|
||||||
Food.Olive.ore("Olive");
|
Food.Olive.ore("Olive");
|
||||||
Food.GinkgoNut.ore("GinkgoNut");
|
Food.GingkoNut.ore("GingkoNut");
|
||||||
Food.Coffee.ore("Coffee");
|
Food.Coffee.ore("Coffee");
|
||||||
Food.OsangeOrange.ore("OsangeOrange");
|
Food.OsangeOrange.ore("OsangeOrange");
|
||||||
Food.Clove.ore("Clove");
|
Food.Clove.ore("Clove");
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class ModuleItems implements IInitializable {
|
|||||||
Food.Acorn.addOil(20, 50, 3);
|
Food.Acorn.addOil(20, 50, 3);
|
||||||
Food.Elderberry.addJuice(10, 100, 5);
|
Food.Elderberry.addJuice(10, 100, 5);
|
||||||
Food.Olive.addOil(20, 50, 3);
|
Food.Olive.addOil(20, 50, 3);
|
||||||
Food.GinkgoNut.addOil(20, 50, 5);
|
Food.GingkoNut.addOil(20, 50, 5);
|
||||||
Food.Coffee.addOil(15, 20, 2);
|
Food.Coffee.addOil(15, 20, 2);
|
||||||
Food.OsangeOrange.addJuice(10, 300, 15);
|
Food.OsangeOrange.addJuice(10, 300, 15);
|
||||||
Food.Clove.addOil(10, 25, 2);
|
Food.Clove.addOil(10, 25, 2);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package binnie.extratrees.machines;
|
package binnie.extratrees.machines;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@@ -80,7 +81,8 @@ public enum ExtraTreeMachine implements IMachineType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
public void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||||
|
RenderBlocks renderer) {
|
||||||
MachineRendererForestry.renderMachine(textureName.getShortPath(), x, y, z);
|
MachineRendererForestry.renderMachine(textureName.getShortPath(), x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,7 @@ public class Lumbermill {
|
|||||||
|
|
||||||
private static Collection<ItemStack> getRecipeResult(ItemStack output) {
|
private static Collection<ItemStack> getRecipeResult(ItemStack output) {
|
||||||
List<ItemStack> list = new ArrayList<>();
|
List<ItemStack> list = new ArrayList<>();
|
||||||
List<IRecipe> iRecipes = new ArrayList<>(CraftingManager.getInstance().getRecipeList());
|
for (IRecipe iRecipe : CraftingManager.getInstance().getRecipeList()) {
|
||||||
for (IRecipe iRecipe : iRecipes) {
|
|
||||||
if (iRecipe instanceof ShapelessRecipes shapeless) {
|
if (iRecipe instanceof ShapelessRecipes shapeless) {
|
||||||
if (shapeless.recipeItems.size() != 1 || !(shapeless.recipeItems.get(0) instanceof ItemStack)) {
|
if (shapeless.recipeItems.size() != 1 || !(shapeless.recipeItems.get(0) instanceof ItemStack)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package binnie.genetics;
|
package binnie.genetics;
|
||||||
|
|
||||||
import com.gtnewhorizon.gtnhlib.config.ConfigException;
|
|
||||||
import com.gtnewhorizon.gtnhlib.config.ConfigurationManager;
|
|
||||||
|
|
||||||
import binnie.core.AbstractMod;
|
import binnie.core.AbstractMod;
|
||||||
import binnie.core.Tags;
|
import binnie.core.Tags;
|
||||||
import binnie.core.gui.IBinnieGUID;
|
import binnie.core.gui.IBinnieGUID;
|
||||||
@@ -11,7 +8,6 @@ import binnie.core.machines.MachineGroup;
|
|||||||
import binnie.core.network.BinniePacketHandler;
|
import binnie.core.network.BinniePacketHandler;
|
||||||
import binnie.core.network.IPacketID;
|
import binnie.core.network.IPacketID;
|
||||||
import binnie.core.proxy.IProxyCore;
|
import binnie.core.proxy.IProxyCore;
|
||||||
import binnie.genetics.config.GeneticsConfig;
|
|
||||||
import binnie.genetics.core.GeneticsGUI;
|
import binnie.genetics.core.GeneticsGUI;
|
||||||
import binnie.genetics.core.GeneticsPacket;
|
import binnie.genetics.core.GeneticsPacket;
|
||||||
import binnie.genetics.item.ItemAnalyst;
|
import binnie.genetics.item.ItemAnalyst;
|
||||||
@@ -32,29 +28,19 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
|
||||||
@Mod(
|
@Mod(
|
||||||
modid = Genetics.GENETICS_MODID,
|
modid = "Genetics",
|
||||||
name = "Genetics",
|
name = "Genetics",
|
||||||
version = Tags.VERSION,
|
version = Tags.VERSION,
|
||||||
useMetadata = true,
|
useMetadata = true,
|
||||||
dependencies = "after:BinnieCore")
|
dependencies = "after:BinnieCore")
|
||||||
public class Genetics extends AbstractMod {
|
public class Genetics extends AbstractMod {
|
||||||
|
|
||||||
public static final String GENETICS_MODID = "Genetics";
|
|
||||||
|
|
||||||
@Mod.Instance("Genetics")
|
@Mod.Instance("Genetics")
|
||||||
public static Genetics instance;
|
public static Genetics instance;
|
||||||
|
|
||||||
@SidedProxy(clientSide = "binnie.genetics.proxy.ProxyClient", serverSide = "binnie.genetics.proxy.ProxyServer")
|
@SidedProxy(clientSide = "binnie.genetics.proxy.ProxyClient", serverSide = "binnie.genetics.proxy.ProxyServer")
|
||||||
public static Proxy proxy;
|
public static Proxy proxy;
|
||||||
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
ConfigurationManager.registerConfig(GeneticsConfig.class);
|
|
||||||
} catch (ConfigException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final String CHANNEL = "GEN";
|
public static final String CHANNEL = "GEN";
|
||||||
|
|
||||||
public static ItemSerumArray itemSerumArray = null;
|
public static ItemSerumArray itemSerumArray = null;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package binnie.genetics.machine;
|
package binnie.genetics.machine;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import binnie.core.machines.Machine;
|
import binnie.core.machines.Machine;
|
||||||
@@ -25,7 +26,7 @@ public abstract class PackageGeneticBase extends MachinePackage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
public void renderMachine(Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||||
MachineRendererGenetics.instance.renderMachine(machine, renderTexture, x, y, z);
|
MachineRendererGenetics.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,14 @@ public class AnalyserComponentFX extends MachineComponent
|
|||||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer
|
BinnieCore.proxy.getMinecraftInstance().effectRenderer
|
||||||
.addEffect(new EntityFX(world, x + 0.5, y + 1.3 + rand.nextDouble() * 0.2, z + 0.5, 0.0, 0.0, 0.0) {
|
.addEffect(new EntityFX(world, x + 0.5, y + 1.3 + rand.nextDouble() * 0.2, z + 0.5, 0.0, 0.0, 0.0) {
|
||||||
|
|
||||||
|
double axisX = posX;
|
||||||
|
double axisZ = posZ;
|
||||||
|
double angle = rand.nextDouble() * 2.0 * 3.1415;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
axisX = 0.0;
|
||||||
|
axisZ = 0.0;
|
||||||
|
angle = 0.0;
|
||||||
motionX = 0.05 * (rand.nextDouble() - 0.5);
|
motionX = 0.05 * (rand.nextDouble() - 0.5);
|
||||||
motionZ = 0.05 * (rand.nextDouble() - 0.5);
|
motionZ = 0.05 * (rand.nextDouble() - 0.5);
|
||||||
motionY = 0.0;
|
motionY = 0.0;
|
||||||
|
|||||||
@@ -39,13 +39,6 @@ public class Inoculator {
|
|||||||
NBTTagList chromosomes = genomeNBT.getTagList("Chromosomes", 10);
|
NBTTagList chromosomes = genomeNBT.getTagList("Chromosomes", 10);
|
||||||
NBTTagCompound chromosomeNBT = chromosomes.getCompoundTagAt(chromosomeID);
|
NBTTagCompound chromosomeNBT = chromosomes.getCompoundTagAt(chromosomeID);
|
||||||
chromosomeNBT.setString("UID" + chromoN, gene.getAllele().getUID());
|
chromosomeNBT.setString("UID" + chromoN, gene.getAllele().getUID());
|
||||||
if (gene.getChromosome() == EnumBeeChromosome.LIFESPAN && gene.getSpeciesRoot() instanceof IBeeRoot beeRoot) {
|
|
||||||
int lifespan = beeRoot.getMember(target).getGenome().getLifespan();
|
|
||||||
beeNBT.setInteger(
|
|
||||||
"Health",
|
|
||||||
Math.max(0, beeNBT.getInteger("Health") + lifespan - beeNBT.getInteger("MaxH")));
|
|
||||||
beeNBT.setInteger("MaxH", lifespan);
|
|
||||||
}
|
|
||||||
target.setTagCompound(beeNBT);
|
target.setTagCompound(beeNBT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,6 +48,9 @@ public class InoculatorComponentFX extends MachineComponent
|
|||||||
double angle = (int) (worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
double angle = (int) (worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
axisX = 0.0;
|
||||||
|
axisZ = 0.0;
|
||||||
|
angle = 0.0;
|
||||||
motionX = 0.0;
|
motionX = 0.0;
|
||||||
motionZ = 0.0;
|
motionZ = 0.0;
|
||||||
motionY = 0.007 + rand.nextDouble() * 0.002;
|
motionY = 0.007 + rand.nextDouble() * 0.002;
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ public class IsolatorComponentFX extends MachineComponent implements IRender.Ran
|
|||||||
}
|
}
|
||||||
|
|
||||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer
|
BinnieCore.proxy.getMinecraftInstance().effectRenderer
|
||||||
.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.75, 0.0, 0.0, 0.0) {
|
.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.5, 0.0, 0.0, 0.0) {
|
||||||
|
|
||||||
final double axisX = posX;
|
final double axisX = 0.0;
|
||||||
final double axisZ = posZ - 0.25;
|
final double axisZ = 0.0;
|
||||||
double angle = 0.0;
|
double angle = 0.0;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import binnie.core.machines.power.ComponentProcessSetCost;
|
|||||||
import binnie.core.machines.power.ErrorState;
|
import binnie.core.machines.power.ErrorState;
|
||||||
import binnie.core.machines.power.IProcess;
|
import binnie.core.machines.power.IProcess;
|
||||||
import binnie.core.util.I18N;
|
import binnie.core.util.I18N;
|
||||||
import binnie.genetics.config.GeneticsConfig;
|
import binnie.extrabees.config.EBConfigMachines;
|
||||||
import binnie.genetics.item.ItemSequence;
|
import binnie.genetics.item.ItemSequence;
|
||||||
import forestry.api.genetics.AlleleManager;
|
import forestry.api.genetics.AlleleManager;
|
||||||
import forestry.api.genetics.IAllele;
|
import forestry.api.genetics.IAllele;
|
||||||
@@ -100,7 +100,7 @@ public class IsolatorComponentLogic extends ComponentProcessSetCost implements I
|
|||||||
ItemStack serum = ItemSequence.create(gene);
|
ItemStack serum = ItemSequence.create(gene);
|
||||||
getUtil().setStack(Isolator.SLOT_RESULT, serum);
|
getUtil().setStack(Isolator.SLOT_RESULT, serum);
|
||||||
getUtil().decreaseStack(Isolator.SLOT_SEQUENCER_VIAL, 1);
|
getUtil().decreaseStack(Isolator.SLOT_SEQUENCER_VIAL, 1);
|
||||||
if (rand.nextFloat() < GeneticsConfig.isolatorConsumptionChance) {
|
if (rand.nextFloat() < EBConfigMachines.isolatorConsumptionChance) {
|
||||||
getUtil().decreaseStack(Isolator.SLOT_TARGET, 1);
|
getUtil().decreaseStack(Isolator.SLOT_TARGET, 1);
|
||||||
}
|
}
|
||||||
getUtil().drainTank(Isolator.TANK_ETHANOL, (int) ethanolPerProcess);
|
getUtil().drainTank(Isolator.TANK_ETHANOL, (int) ethanolPerProcess);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package binnie.genetics.machine.lab;
|
package binnie.genetics.machine.lab;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
|
||||||
import binnie.core.machines.Machine;
|
import binnie.core.machines.Machine;
|
||||||
import binnie.genetics.core.GeneticsTexture;
|
import binnie.genetics.core.GeneticsTexture;
|
||||||
import binnie.genetics.machine.ComponentGUIHolder;
|
import binnie.genetics.machine.ComponentGUIHolder;
|
||||||
@@ -18,7 +20,7 @@ public class LabMachinePackage extends PackageGeneticBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
public void renderMachine(Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||||
MachineRendererLab.instance.renderMachine(machine, renderTexture, x, y, z);
|
MachineRendererLab.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,6 +37,9 @@ public class PolymeriserComponentFX extends MachineComponent implements IRender.
|
|||||||
double angle = 0.7 + (int) (worldObj.getTotalWorldTime() % 2L) * 3.1415;
|
double angle = 0.7 + (int) (worldObj.getTotalWorldTime() % 2L) * 3.1415;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
axisX = 0.0;
|
||||||
|
axisZ = 0.0;
|
||||||
|
angle = 0.0;
|
||||||
motionX = 0.0;
|
motionX = 0.0;
|
||||||
motionZ = 0.0;
|
motionZ = 0.0;
|
||||||
motionY = -0.006;
|
motionY = -0.006;
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ public class SequencerComponentFX extends MachineComponent implements IRender.Ra
|
|||||||
double angle = rand.nextDouble() * 2.0 * 3.1415;
|
double angle = rand.nextDouble() * 2.0 * 3.1415;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
axisX = 0.0;
|
||||||
|
axisZ = 0.0;
|
||||||
|
angle = 0.0;
|
||||||
motionX = 0.0;
|
motionX = 0.0;
|
||||||
motionZ = 0.0;
|
motionZ = 0.0;
|
||||||
motionY = 0.0;
|
motionY = 0.0;
|
||||||
|
|||||||
@@ -37,13 +37,6 @@ public class Splicer {
|
|||||||
NBTTagList chromosomes = genomeNBT.getTagList("Chromosomes", 10);
|
NBTTagList chromosomes = genomeNBT.getTagList("Chromosomes", 10);
|
||||||
NBTTagCompound chromosomeNBT = chromosomes.getCompoundTagAt(chromosomeID);
|
NBTTagCompound chromosomeNBT = chromosomes.getCompoundTagAt(chromosomeID);
|
||||||
chromosomeNBT.setString("UID" + chromoN, gene.getAllele().getUID());
|
chromosomeNBT.setString("UID" + chromoN, gene.getAllele().getUID());
|
||||||
if (gene.getChromosome() == EnumBeeChromosome.LIFESPAN && gene.getSpeciesRoot() instanceof IBeeRoot beeRoot) {
|
|
||||||
int lifespan = beeRoot.getMember(target).getGenome().getLifespan();
|
|
||||||
beeNBT.setInteger(
|
|
||||||
"Health",
|
|
||||||
Math.max(0, beeNBT.getInteger("Health") + lifespan - beeNBT.getInteger("MaxH")));
|
|
||||||
beeNBT.setInteger("MaxH", lifespan);
|
|
||||||
}
|
|
||||||
target.setTagCompound(beeNBT);
|
target.setTagCompound(beeNBT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,6 +49,9 @@ public class SplicerComponentFX extends MachineComponent
|
|||||||
double angle = (int) (worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
double angle = (int) (worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
axisX = 0.0;
|
||||||
|
axisZ = 0.0;
|
||||||
|
angle = 0.0;
|
||||||
motionX = 0.0;
|
motionX = 0.0;
|
||||||
motionZ = 0.0;
|
motionZ = 0.0;
|
||||||
motionY = (rand.nextDouble() - 0.5) * 0.02;
|
motionY = (rand.nextDouble() - 0.5) * 0.02;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import binnie.core.nei.RecipeHandlerBase;
|
|||||||
import binnie.genetics.Genetics;
|
import binnie.genetics.Genetics;
|
||||||
import binnie.genetics.item.GeneticsItems;
|
import binnie.genetics.item.GeneticsItems;
|
||||||
import binnie.genetics.item.ItemSerumArray;
|
import binnie.genetics.item.ItemSerumArray;
|
||||||
import binnie.genetics.nei.helper.ColorUtils;
|
|
||||||
import codechicken.lib.gui.GuiDraw;
|
import codechicken.lib.gui.GuiDraw;
|
||||||
import codechicken.nei.ItemList;
|
import codechicken.nei.ItemList;
|
||||||
import codechicken.nei.NEIServerUtils;
|
import codechicken.nei.NEIServerUtils;
|
||||||
@@ -61,7 +60,7 @@ public class DatabaseRecipeHandler extends RecipeHandlerBase {
|
|||||||
StatCollector.translateToLocalFormatted("genetics.nei.tip.databaseDesc"),
|
StatCollector.translateToLocalFormatted("genetics.nei.tip.databaseDesc"),
|
||||||
140);
|
140);
|
||||||
for (int i = 0; i < desc.size(); i++) {
|
for (int i = 0; i < desc.size(); i++) {
|
||||||
GuiDraw.drawStringC(desc.get(i), 88, 44 + 12 * (i - 1), ColorUtils.neiDisplayText.getColor());
|
GuiDraw.drawStringC(desc.get(i), 88, 44 + 12 * (i - 1), 0xFFFFFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import binnie.core.nei.PositionedFluidTank;
|
|||||||
import binnie.core.nei.RecipeHandlerBase;
|
import binnie.core.nei.RecipeHandlerBase;
|
||||||
import binnie.genetics.api.IIncubatorRecipe;
|
import binnie.genetics.api.IIncubatorRecipe;
|
||||||
import binnie.genetics.machine.incubator.Incubator;
|
import binnie.genetics.machine.incubator.Incubator;
|
||||||
import binnie.genetics.nei.helper.ColorUtils;
|
|
||||||
import codechicken.lib.gui.GuiDraw;
|
import codechicken.lib.gui.GuiDraw;
|
||||||
import codechicken.nei.NEIServerUtils;
|
import codechicken.nei.NEIServerUtils;
|
||||||
import codechicken.nei.PositionedStack;
|
import codechicken.nei.PositionedStack;
|
||||||
@@ -49,16 +48,8 @@ public class IncubatorRecipeHandler extends RecipeHandlerBase {
|
|||||||
@Override
|
@Override
|
||||||
public void drawExtras(int recipe) {
|
public void drawExtras(int recipe) {
|
||||||
this.drawProgressBar(75, 27, 176, 0, 24, 17, 40, 0);
|
this.drawProgressBar(75, 27, 176, 0, 24, 17, 40, 0);
|
||||||
GuiDraw.drawStringC(
|
GuiDraw.drawStringC(StatCollector.translateToLocal("genetics.nei.tip.loss"), 62, 5, 0xFFFFFF);
|
||||||
StatCollector.translateToLocal("genetics.nei.tip.loss"),
|
GuiDraw.drawStringC(((CachedIncubatorRecipe) arecipes.get(recipe)).lossChance, 62, 15, 0xFFFFFF);
|
||||||
62,
|
|
||||||
5,
|
|
||||||
ColorUtils.neiDisplayText.getColor());
|
|
||||||
GuiDraw.drawStringC(
|
|
||||||
((CachedIncubatorRecipe) arecipes.get(recipe)).lossChance,
|
|
||||||
62,
|
|
||||||
15,
|
|
||||||
ColorUtils.neiDisplayText.getColor());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
package binnie.genetics.nei.helper;
|
|
||||||
|
|
||||||
import com.gtnewhorizon.gtnhlib.color.ColorResource;
|
|
||||||
|
|
||||||
public class ColorUtils {
|
|
||||||
|
|
||||||
private static final ColorResource.Factory color = new ColorResource.Factory("binniecore");
|
|
||||||
|
|
||||||
public static final ColorResource
|
|
||||||
// spotless:off
|
|
||||||
neiDisplayText = color.rgb("neiDisplayText", "0xFFFFFF");
|
|
||||||
// spotless:on
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 408 B |
|
Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 417 B |
|
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 325 B |
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 372 B |
|
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 457 B |