diff --git a/build.properties b/build.properties index 7796d6a7d..bd44a1418 100644 --- a/build.properties +++ b/build.properties @@ -21,7 +21,7 @@ eio.cf=2219/296 eio.version=1.7.10-2.2.1.276 es.version=1.4.5.24 fmp.version=1.1.0.308 -forestry.version=3.5.7.16 +forestry.version=4.1.0.44 gc.build=3 gc.version=3.0.7 gt.version=5.04.06 diff --git a/src/main/scala/li/cil/oc/integration/Mods.scala b/src/main/scala/li/cil/oc/integration/Mods.scala index e158b119b..b09fdb6e6 100644 --- a/src/main/scala/li/cil/oc/integration/Mods.scala +++ b/src/main/scala/li/cil/oc/integration/Mods.scala @@ -44,7 +44,7 @@ object Mods { val EnderStorage = new SimpleMod(IDs.EnderStorage) val ExtraCells = new SimpleMod(IDs.ExtraCells, version = "@[2.2.73,)") val Factorization = new SimpleMod(IDs.Factorization, providesPower = true) - val Forestry = new SimpleMod(IDs.Forestry) + val Forestry = new SimpleMod(IDs.Forestry, version = "@[4.0,)") val ForgeMultipart = new SimpleMod(IDs.ForgeMultipart) val Galacticraft = new SimpleMod(IDs.Galacticraft, providesPower = true) val GregTech = new ClassBasedMod(IDs.GregTech, "gregtech.api.GregTech_API")() diff --git a/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java b/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java index 0b705b577..d89a64df3 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java +++ b/src/main/scala/li/cil/oc/integration/forestry/ConverterIAlleles.java @@ -1,7 +1,6 @@ package li.cil.oc.integration.forestry; import com.google.common.collect.Maps; -import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IMutation; import li.cil.oc.api.driver.Converter; @@ -12,17 +11,17 @@ public class ConverterIAlleles implements Converter { @Override public void convert(final Object value, final Map output) { if (value instanceof IMutation) { - IMutation mutation = (IMutation) value; + final IMutation mutation = (IMutation) value; - IAllele allele1 = mutation.getAllele0(); - if (allele1 instanceof IAlleleSpecies) { - Map allelMap1 = Maps.newHashMap(); + final IAlleleSpecies allele1 = mutation.getAllele0(); + if (allele1 != null) { + final Map allelMap1 = Maps.newHashMap(); convert(allele1, allelMap1); output.put("allele1", allelMap1); } - IAllele allele2 = mutation.getAllele1(); - if (allele2 instanceof IAlleleSpecies) { - Map allelMap2 = Maps.newHashMap(); + final IAlleleSpecies allele2 = mutation.getAllele1(); + if (allele2 != null) { + final Map allelMap2 = Maps.newHashMap(); convert(allele2, allelMap2); output.put("allele2", allelMap2); } diff --git a/src/main/scala/li/cil/oc/integration/forestry/ConverterIIndividual.java b/src/main/scala/li/cil/oc/integration/forestry/ConverterIIndividual.java index 8635de86e..981675d44 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/ConverterIIndividual.java +++ b/src/main/scala/li/cil/oc/integration/forestry/ConverterIIndividual.java @@ -68,7 +68,7 @@ public class ConverterIIndividual implements Converter { }; private interface IAlleleConverter { - public Object convert(A allele); + Object convert(A allele); } private static final Map, IAlleleConverter> converters = diff --git a/src/main/scala/li/cil/oc/integration/forestry/DriverAnalyzer.scala b/src/main/scala/li/cil/oc/integration/forestry/DriverAnalyzer.scala index 7454de712..5d0789582 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/DriverAnalyzer.scala +++ b/src/main/scala/li/cil/oc/integration/forestry/DriverAnalyzer.scala @@ -1,7 +1,7 @@ package li.cil.oc.integration.forestry import forestry.api.genetics.AlleleManager -import forestry.core.gadgets.TileAnalyzer +import forestry.core.tiles.TileAnalyzer import li.cil.oc.api.driver.NamedBlock import li.cil.oc.api.machine.Arguments import li.cil.oc.api.machine.Callback @@ -21,13 +21,13 @@ class DriverAnalyzer extends DriverTileEntity { override def priority = 0 - @Callback(doc = "function():boolean -- Can the bees breed?") - def isWorking(context: Context, args: Arguments): Array[AnyRef] = result(tileEntity.isWorking) + @Callback(doc = "function():boolean -- Get whether the analyzer can work.") + def isWorking(context: Context, args: Arguments): Array[AnyRef] = result(tileEntity.hasWork) - @Callback(doc = "function():boolean -- Can the bees breed?") + @Callback(doc = "function():boolean -- Get the progress of the current operation.") def getProgress(context: Context, args: Arguments): Array[AnyRef] = result(1.0 - tileEntity.getProgressScaled(100) / 100.0) - @Callback(doc = "function():boolean -- Can the bees breed?") + @Callback(doc = "function():boolean -- Get info on the currently present bee.") def getIndividualOnDisplay(context: Context, args: Arguments): Array[AnyRef] = result(AlleleManager.alleleRegistry.getIndividual(tileEntity.getIndividualOnDisplay)) } diff --git a/src/main/scala/li/cil/oc/integration/forestry/DriverBeeHouse.java b/src/main/scala/li/cil/oc/integration/forestry/DriverBeeHouse.java index cc1eed27d..462c27837 100644 --- a/src/main/scala/li/cil/oc/integration/forestry/DriverBeeHouse.java +++ b/src/main/scala/li/cil/oc/integration/forestry/DriverBeeHouse.java @@ -38,12 +38,12 @@ public class DriverBeeHouse extends DriverTileEntity { @Callback(doc = "function():boolean -- Can the bees breed?") public Object[] canBreed(final Context context, final Arguments args) { - return new Object[]{tileEntity.canBreed()}; + return new Object[]{tileEntity.getBeekeepingLogic().canWork()}; } @Callback(doc = "function():table -- Get the drone") public Object[] getDrone(final Context context, final Arguments args) { - final ItemStack drone = tileEntity.getDrone(); + final ItemStack drone = tileEntity.getBeeInventory().getDrone(); if (drone != null) { return new Object[]{AlleleManager.alleleRegistry.getIndividual(drone)}; } @@ -52,7 +52,7 @@ public class DriverBeeHouse extends DriverTileEntity { @Callback(doc = "function():table -- Get the queen") public Object[] getQueen(final Context context, final Arguments args) { - final ItemStack queen = tileEntity.getQueen(); + final ItemStack queen = tileEntity.getBeeInventory().getQueen(); if (queen != null) { return new Object[]{AlleleManager.alleleRegistry.getIndividual(queen)}; } @@ -68,14 +68,14 @@ public class DriverBeeHouse extends DriverTileEntity { final Set> result = Sets.newHashSet(); for (IMutation mutation : beeRoot.getMutations(false)) { - HashMap mutationMap = new HashMap(); + final HashMap mutationMap = new HashMap(); - IAllele allele1 = mutation.getAllele0(); + final IAllele allele1 = mutation.getAllele0(); if (allele1 != null) { mutationMap.put("allele1", allele1.getName()); } - IAllele allele2 = mutation.getAllele1(); + final IAllele allele2 = mutation.getAllele1(); if (allele2 != null) { mutationMap.put("allele2", allele2.getName()); } @@ -84,7 +84,7 @@ public class DriverBeeHouse extends DriverTileEntity { mutationMap.put("specialConditions", mutation .getSpecialConditions().toArray()); - IAllele[] template = mutation.getTemplate(); + final IAllele[] template = mutation.getTemplate(); if (template != null && template.length > 0) { mutationMap.put("result", template[0].getName()); }