Update for latest Forestry, add modId to genetic item tooltips

This commit is contained in:
mezz committed 2017-10-03 00:25:17 -07:00
1 parent de6028e85d
commit 1ef2f23604
11 files changed
+38 -22

No files matched your search

@@ -6,7 +6,7 @@ import forestry.api.genetics.IAllele;
import forestry.api.genetics.IClassification;
public interface IFlowerFactory {
IAlleleFlowerSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean isDominant, IClassification branch, String binomial, IFlowerType flowerType);
IAlleleFlowerSpeciesBuilder createSpecies(String modId, String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean isDominant, IClassification branch, String binomial, IFlowerType flowerType);
IFlowerMutationBuilder createMutation(IAlleleFlowerSpecies allele0, IAlleleFlowerSpecies allele1, IAllele[] result, int chance);
@@ -965,7 +965,8 @@ public enum FlowerDefinition implements IFlowerDefinition {
}
FlowerDefinition(String name, String branch, String binomial, IFlowerType<EnumFlowerType> flowerType, boolean isDominant, EnumFlowerColor primaryColor, EnumFlowerColor secondaryColor) {
String uid = Constants.BOTANY_MOD_ID + ".flower" + this;
String modId = Constants.BOTANY_MOD_ID;
String uid = modId + ".flower" + this;
String unlocalizedDescription = "botany.description.flower" + this;
String unlocalizedName = "botany.flowers.species." + name;
@@ -977,7 +978,7 @@ public enum FlowerDefinition implements IFlowerDefinition {
this.primaryColor = primaryColor;
this.secondaryColor = secondaryColor;
IAlleleFlowerSpeciesBuilder speciesBuilder = BotanyAPI.flowerFactory.createSpecies(uid, unlocalizedName, "Binnie's Mod Team", unlocalizedDescription, isDominant, getBranch(), binomial, flowerType);
IAlleleFlowerSpeciesBuilder speciesBuilder = BotanyAPI.flowerFactory.createSpecies(modId, uid, unlocalizedName, "Binnie's Mod Team", unlocalizedDescription, isDominant, getBranch(), binomial, flowerType);
setSpeciesProperties(speciesBuilder);
species = speciesBuilder.build();
if (this.branch != null) {
@@ -17,9 +17,9 @@ import binnie.botany.models.FlowerSpriteManager;
public class FlowerFactory implements IFlowerFactory {
@Override
public IAlleleFlowerSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean isDominant, IClassification branch, String binomial, IFlowerType flowerType) {
public IAlleleFlowerSpeciesBuilder createSpecies(String modId, String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean isDominant, IClassification branch, String binomial, IFlowerType flowerType) {
FlowerSpriteManager.initSprites(flowerType);
return new AlleleFlowerSpecies(uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial, flowerType);
return new AlleleFlowerSpecies(modId, uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial, flowerType);
}
@Override
@@ -27,6 +27,7 @@ public class AlleleFlowerSpecies extends AlleleSpecies implements IAlleleFlowerS
private EnumMoisture moisture = EnumMoisture.NORMAL;
public AlleleFlowerSpecies(
String modId,
String uid,
String unlocalizedName,
String authority,
@@ -35,7 +36,7 @@ public class AlleleFlowerSpecies extends AlleleSpecies implements IAlleleFlowerS
IClassification branch,
String binomial,
IFlowerType flowerType) {
super(uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial);
super(modId, uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial);
this.flowerType = flowerType;
}
@@ -6,6 +6,7 @@ import com.google.common.base.Preconditions;
import javax.annotation.Nullable;
import java.util.List;
import forestry.api.genetics.IAlleleSpecies;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.state.IBlockState;
@@ -122,6 +123,17 @@ public class ItemFlowerGE extends Item implements IColoredItem, IItemModelRegist
}
}
@Nullable
@Override
public String getCreatorModId(ItemStack itemStack) {
IIndividual individual = getIndividual(itemStack);
if (individual != null) {
IAlleleSpecies species = individual.getGenome().getPrimary();
return species.getModID();
}
return super.getCreatorModId(itemStack);
}
@Nullable
protected IIndividual getIndividual(ItemStack itemstack) {
NBTTagCompound tagCompound = itemstack.getTagCompound();
-1
View File
@@ -161,7 +161,6 @@ curseforge {
relations {
requiredLibrary 'forestry'
}
addGameVersion '1.12'
}
}
@@ -58,8 +58,8 @@ import binnie.core.modules.ModuleManager;
name = "Binnie Core",
version = "@VERSION@",
acceptedMinecraftVersions = Constants.ACCEPTED_MINECRAFT_VERSIONS,
dependencies = "required-after:forge@[13.20.0.2279,);" +
"required-after:forestry@[5.5.0.176,);" +
dependencies = "required-after:forge@[14.23.0.2500,);" +
"required-after:forestry@[5.6.0.199,);" +
"after:jei@[4.7.8,);"
)
public final class BinnieCore extends AbstractMod {
@@ -7,10 +7,11 @@ public final class Constants {
public static final String CORE_MOD_ID = "binniecore";
public static final String BOTANY_MOD_ID = "botany";
public static final String DESIGN_MOD_ID = "binniedesign";
public static final String EXTRA_BEES_MOD_ID = "extrabees";
public static final String EXTRA_TREES_MOD_ID = "extratrees";
public static final String GENETICS_MOD_ID = "genetics";
public static final String ACCEPTED_MINECRAFT_VERSIONS = "[1.12,1.12.2]";
public static final String ACCEPTED_MINECRAFT_VERSIONS = "[1.12.2,1.13)";
public static final float SPAWN_KOEF = 1365.3999f;
}
@@ -1,5 +1,6 @@
package binnie.extrabees.genetics;
import binnie.core.Constants;
import com.google.common.base.Preconditions;
import java.awt.Color;
@@ -1881,13 +1882,14 @@ public enum ExtraBeeDefinition implements IBeeDefinition {
ExtraBeeDefinition(IBranchDefinition branch, String binomial, boolean dominant, Color primary, Color secondary) {
String species = toString().toLowerCase(Locale.ENGLISH);
String uid = "extrabees.species." + species;
String description = "extrabees.species." + species + ".desc";
String name = "extrabees.species." + species + ".name";
String modId = Constants.EXTRA_BEES_MOD_ID;
String uid = modId + ".species." + species;
String description = modId + ".species." + species + ".desc";
String name = modId + ".species." + species + ".name";
this.branch = branch;
if (branch != null) {
this.speciesBuilder = new ExtraBeeSpecies(uid, name, "Binnie", description, dominant, branch.getBranch(), binomial, primary.getRGB(), secondary.getRGB());
this.speciesBuilder = new ExtraBeeSpecies(modId, uid, name, "Binnie", description, dominant, branch.getBranch(), binomial, primary.getRGB(), secondary.getRGB());
} else {
this.speciesBuilder = null;
}
@@ -13,8 +13,8 @@ import binnie.extrabees.items.ItemHoneyComb;
public class ExtraBeeSpecies extends AlleleBeeSpecies {
private State state;
public ExtraBeeSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, int primaryColor, int secondaryColor) {
super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor, secondaryColor);
public ExtraBeeSpecies(String modId, String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, int primaryColor, int secondaryColor) {
super(modId, uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor, secondaryColor);
this.state = State.ACTIVE;
}
+6 -6
View File
@@ -4,20 +4,20 @@ org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
mcversion=1.12.2
forgeversion=14.23.0.2486
forgeversion=14.23.0.2501
mcp_mappings=snapshot_20170918
curse_project_id=223525
forestry_version=5.5.6.197
forestry_version=5.6.0.199
forestry_mcversion=1.12.2
ic2_version=2.8.17-ex112
version_major=2
version_minor=3
version_patch=1
version_minor=4
version_patch=0
jei_version=4.7.8.91
jei_mcversion=1.12.1
jei_version=4.8.0.103
jei_mcversion=1.12.2
jeibees_version=0.9.0.2
jeibees_mcversion=1.12
crafttweaker_version=4.0.3.247