mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-14 09:14:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
750239cc04 | ||
|
|
71f71514ae | ||
|
|
74a0fcd883 | ||
|
|
3f8b5d2032 | ||
|
|
e2d7843159 | ||
|
|
eb36ee9260 | ||
|
|
5988871448 | ||
|
|
5bb88e9115 | ||
|
|
1591cdab8b |
No files matched your search
+2
-1
@@ -28,6 +28,7 @@ whitelist.json
|
||||
*.iws
|
||||
src/main/resources/mixins.*([!.]).json
|
||||
*.bat
|
||||
*.sh
|
||||
*.DS_Store
|
||||
!gradlew.bat
|
||||
.factorypath
|
||||
@@ -35,4 +36,4 @@ addon.local.gradle
|
||||
addon.local.gradle.kts
|
||||
addon.late.local.gradle
|
||||
addon.late.local.gradle.kts
|
||||
layout.json
|
||||
layout.json
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.32:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.11.35:dev')
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.39:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.11.54:dev')
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.118-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.162-GTNH:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.63:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.64:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||
}
|
||||
@@ -186,6 +186,11 @@ modrinthRelations =
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
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.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1df82b76031285ef2e6a4f59ffe9299d/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/c7d5be6a02945ac2e045048ee54a7d32/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/643f404f769811f5f265fd66f7af5d89/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/38256085a73e137cb4937ea9c4807fec/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
Vendored
+12
-23
@@ -19,12 +19,12 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
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 location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,29 +65,18 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
+1
-1
@@ -17,5 +17,5 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.27'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.34'
|
||||
}
|
||||
@@ -11,6 +11,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -19,18 +21,25 @@ import net.minecraft.world.World;
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.api.IFlowerGenome;
|
||||
import binnie.botany.api.IFlowerType;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.genetics.AlleleColor;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.botany.genetics.EnumFlowerType;
|
||||
import binnie.botany.genetics.Flower;
|
||||
import binnie.botany.genetics.FlowerSpecies;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
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.IPollinatable;
|
||||
import forestry.core.config.Config;
|
||||
@@ -61,12 +70,44 @@ public abstract class ItemBotany extends Item {
|
||||
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
|
||||
public boolean hasEffect(ItemStack stack, int pass) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
IAllele allele = getRenderAllele(stack, EnumFlowerChromosome.SPECIES, false);
|
||||
if (allele instanceof IAlleleFlowerSpecies species) {
|
||||
return species.hasEffect();
|
||||
}
|
||||
|
||||
IIndividual individual = getIndividual(stack);
|
||||
return individual != null && individual.getGenome() != null && individual.hasEffect();
|
||||
}
|
||||
@@ -152,6 +193,17 @@ public abstract class ItemBotany extends Item {
|
||||
|
||||
@Override
|
||||
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);
|
||||
if (flower == null || flower.getGenome() == null) {
|
||||
return 0xffffff;
|
||||
@@ -177,19 +229,32 @@ public abstract class ItemBotany extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack itemstack, int renderPass) {
|
||||
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
||||
if (flower == null || flower.getGenome() == null || flower.getGenome().getPrimary() == null) {
|
||||
return EnumFlowerType.ALLIUM.getBlank();
|
||||
IAlleleFlowerSpecies species = FlowerSpecies.POPPY;
|
||||
boolean flowered = false;
|
||||
|
||||
if (itemstack.hasTagCompound()) {
|
||||
IAllele allele = getRenderAllele(itemstack, EnumFlowerChromosome.SPECIES, false);
|
||||
if (allele instanceof IAlleleFlowerSpecies flowerSpecies) {
|
||||
species = flowerSpecies;
|
||||
flowered = itemstack.getTagCompound().getBoolean("Flowered");
|
||||
} else {
|
||||
IFlower flower = BotanyCore.speciesRoot.getMember(itemstack);
|
||||
if (flower == null || flower.getGenome() == null || flower.getGenome().getPrimary() == null) {
|
||||
return EnumFlowerType.ALLIUM.getBlank();
|
||||
}
|
||||
species = flower.getGenome().getPrimary();
|
||||
flowered = flower.hasFlowered();
|
||||
}
|
||||
}
|
||||
|
||||
IFlowerType type = flower.getGenome().getPrimary().getType();
|
||||
IFlowerType type = species.getType();
|
||||
if (renderPass == 0) {
|
||||
return type.getStem(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
||||
return type.getStem(getStage(), flowered, type.getSections() - 1);
|
||||
}
|
||||
if (renderPass == 1) {
|
||||
return type.getPetalIcon(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
||||
return type.getPetalIcon(getStage(), flowered, type.getSections() - 1);
|
||||
}
|
||||
return type.getVariantIcon(getStage(), flower.hasFlowered(), type.getSections() - 1);
|
||||
return type.getVariantIcon(getStage(), flowered, type.getSections() - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,13 @@ import forestry.core.genetics.alleles.EnumAllele;
|
||||
|
||||
public class FlowerTemplates {
|
||||
|
||||
private static IAllele[] defaultTemplate;
|
||||
|
||||
public static IAllele[] getDefaultTemplate() {
|
||||
if (defaultTemplate != null) {
|
||||
return defaultTemplate.clone();
|
||||
}
|
||||
|
||||
IAllele[] alleles = new IAllele[EnumFlowerChromosome.VALUES.length];
|
||||
alleles[EnumFlowerChromosome.SPECIES.ordinal()] = FlowerSpecies.POPPY;
|
||||
alleles[EnumFlowerChromosome.PRIMARY.ordinal()] = AlleleHelper.getAllele(EnumFlowerColor.RED);
|
||||
@@ -22,6 +28,13 @@ public class FlowerTemplates {
|
||||
alleles[EnumFlowerChromosome.PH_TOLERANCE.ordinal()] = AlleleHelper.getAllele(EnumTolerance.NONE);
|
||||
alleles[EnumFlowerChromosome.SAPPINESS.ordinal()] = AlleleHelper.getAllele(EnumAllele.Sappiness.AVERAGE);
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -94,6 +94,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
window.render();
|
||||
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
|
||||
NEIHook.renderObjects(window, mouseX, mouseY);
|
||||
|
||||
@@ -121,7 +121,7 @@ class ListMap<T> implements List<T> {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,7 +33,6 @@ import binnie.extrabees.genetics.ExtraBeesFlowers;
|
||||
import cofh.api.energy.IEnergyReceiver;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
@@ -111,43 +110,6 @@ 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() {
|
||||
AlleleManager.alleleRegistry.registerAllele(this);
|
||||
}
|
||||
@@ -371,7 +333,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
int damage = 4;
|
||||
if (entity instanceof EntityPlayer) {
|
||||
int count = wearsItems((EntityPlayer) entity);
|
||||
int count = BeeManager.armorApiaristHelper.wearsItems(entity, getUID(), true);
|
||||
if (count > 3) {
|
||||
continue;
|
||||
}
|
||||
@@ -396,7 +358,8 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
private void onHungerEffect(IBeeGenome genome, IBeeHousing housing, World world) {
|
||||
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||
if (world.rand.nextInt(4)
|
||||
< BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true)) {
|
||||
continue;
|
||||
}
|
||||
player.addExhaustion(4.0f);
|
||||
@@ -406,7 +369,8 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
private void onPotionEffect(IBeeGenome genome, IBeeHousing housing, World world, PotionEffect potion) {
|
||||
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
|
||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||
if (world.rand.nextInt(4)
|
||||
< BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true)) {
|
||||
continue;
|
||||
}
|
||||
player.addPotionEffect(potion);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -11,6 +13,7 @@ import binnie.core.BinnieCore;
|
||||
import binnie.core.Mods;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.core.ExtraBeeItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
@@ -79,7 +82,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyComb.LATEX.addProduct(honeyDrop, 0.50f);
|
||||
EnumHoneyComb.LATEX.addProduct(beeswax, 0.85f);
|
||||
if (!OreDictionary.getOres("itemRubber").isEmpty()) {
|
||||
EnumHoneyComb.LATEX.tryAddProduct(OreDictionary.getOres("itemRubber").get(0), 1.00f);
|
||||
EnumHoneyComb.LATEX.tryAddProduct(getOreDictionary("itemRubber"), 1.00f);
|
||||
} else {
|
||||
EnumHoneyComb.LATEX.active = false;
|
||||
}
|
||||
@@ -116,7 +119,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.URANIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
if (!OreDictionary.getOres("crushedUranium").isEmpty()) {
|
||||
EnumHoneyComb.URANIUM.tryAddProduct(OreDictionary.getOres("crushedUranium").get(0), 0.50f);
|
||||
EnumHoneyComb.URANIUM.tryAddProduct(getOreDictionary("crushedUranium"), 0.50f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.CLAY.addProduct(beeswax, 0.25f);
|
||||
@@ -133,7 +136,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyComb.ACIDIC.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.ACIDIC.tryAddProduct(EnumHoneyDrop.ACID, 0.50f);
|
||||
if (!OreDictionary.getOres("dustSulfur").isEmpty()) {
|
||||
EnumHoneyComb.ACIDIC.addProduct(OreDictionary.getOres("dustSulfur").get(0), 0.75f);
|
||||
EnumHoneyComb.ACIDIC.addProduct(getOreDictionary("dustSulfur"), 0.75f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.VENOMOUS.addProduct(beeswax, 0.80f);
|
||||
@@ -149,7 +152,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.COFFEE.addProduct(honeyDrop, 0.75f);
|
||||
if (!OreDictionary.getOres("dustCoffee").isEmpty()) {
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(OreDictionary.getOres("dustCoffee").get(0), 0.75f);
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(getOreDictionary("dustCoffee"), 0.75f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.GLACIAL.tryAddProduct(EnumHoneyDrop.ICE, 0.80f);
|
||||
@@ -157,7 +160,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.SHADOW.addProduct(honeyDrop, 0.50f);
|
||||
if (!OreDictionary.getOres("dustObsidian").isEmpty()) {
|
||||
EnumHoneyComb.SHADOW.tryAddProduct(OreDictionary.getOres("dustObsidian").get(0), 0.75f);
|
||||
EnumHoneyComb.SHADOW.tryAddProduct(getOreDictionary("dustObsidian"), 0.75f);
|
||||
} else {
|
||||
EnumHoneyComb.SHADOW.active = false;
|
||||
}
|
||||
@@ -206,20 +209,20 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.SAWDUST.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustSawdust").isEmpty()) {
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(OreDictionary.getOres("dustSawdust").get(0), 1.00f);
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(getOreDictionary("dustSawdust"), 1.00f);
|
||||
} else if (!OreDictionary.getOres("sawdust").isEmpty()) {
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(OreDictionary.getOres("sawdust").get(0), 1.00f);
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(getOreDictionary("sawdust"), 1.00f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.CERTUS.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.CERTUS.addProduct(new ItemStack(Items.quartz), 0.25f);
|
||||
if (!OreDictionary.getOres("dustCertusQuartz").isEmpty()) {
|
||||
EnumHoneyComb.CERTUS.tryAddProduct(OreDictionary.getOres("dustCertusQuartz").get(0), 0.20f);
|
||||
EnumHoneyComb.CERTUS.tryAddProduct(getOreDictionary("dustCertusQuartz"), 0.20f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.ENDERPEARL.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustEnderPearl").isEmpty()) {
|
||||
EnumHoneyComb.ENDERPEARL.tryAddProduct(OreDictionary.getOres("dustEnderPearl").get(0), 0.25f);
|
||||
EnumHoneyComb.ENDERPEARL.tryAddProduct(getOreDictionary("dustEnderPearl"), 0.25f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.YELLORIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
@@ -259,11 +262,15 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
}
|
||||
}
|
||||
|
||||
/// The item registered under `string`: MaterialLib's when it registers one, since other mods' items under the
|
||||
/// same name are copies of it, else the first registered.
|
||||
private static ItemStack getOreDictionary(String string) {
|
||||
if (!OreDictionary.getOres(string).isEmpty()) {
|
||||
return OreDictionary.getOres(string).get(0);
|
||||
List<ItemStack> ores = OreDictionary.getOres(string);
|
||||
for (ItemStack ore : ores) {
|
||||
GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(ore.getItem());
|
||||
if (id != null && "materiallib".equals(id.modId)) return ore;
|
||||
}
|
||||
return null;
|
||||
return ores.isEmpty() ? null : ores.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -366,7 +366,7 @@ for.extratrees.item.food.gooseberry=Gooseberry
|
||||
for.extratrees.item.food.goldenraspberry=Golden Raspberry
|
||||
for.extratrees.item.food.coconut=Coconut
|
||||
for.extratrees.item.food.cashew=Cashew
|
||||
for.extratrees.item.food.avacado=Avacado
|
||||
for.extratrees.item.food.avacado=Avocado
|
||||
for.extratrees.item.food.nutmeg=Nutmeg
|
||||
for.extratrees.item.food.allspice=Allspice
|
||||
for.extratrees.item.food.chilli=Chilli
|
||||
|
||||
@@ -282,7 +282,7 @@ extratrees.species.goldenraspberry.name=Golden Raspberry
|
||||
extratrees.species.cinnamon.name=Cinnamon
|
||||
extratrees.species.coconut.name=Coconut
|
||||
extratrees.species.cashew.name=Cashew
|
||||
extratrees.species.avacado.name=Avacado
|
||||
extratrees.species.avacado.name=Avocado
|
||||
extratrees.species.nutmeg.name=Nutmeg
|
||||
extratrees.species.allspice.name=Allspice
|
||||
extratrees.species.chilli.name=Chilli Pepper
|
||||
@@ -386,7 +386,7 @@ for.extratrees.item.food.gooseberry=Gooseberry
|
||||
for.extratrees.item.food.goldenraspberry=Golden Raspberry
|
||||
for.extratrees.item.food.coconut=Coconut
|
||||
for.extratrees.item.food.cashew=Cashew
|
||||
for.extratrees.item.food.avacado=Avacado
|
||||
for.extratrees.item.food.avacado=Avocado
|
||||
for.extratrees.item.food.nutmeg=Nutmeg
|
||||
for.extratrees.item.food.allspice=Allspice
|
||||
for.extratrees.item.food.chilli=Chilli
|
||||
|
||||
Reference in new issue
Block a user