diff --git a/build.properties b/build.properties index 853b21675..3f8d32e65 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.8 forge.version=11.14.3.1450 -oc.version=1.5.19 +oc.version=1.5.20 oc.subversion=dev ae2.version=rv2-beta-26 @@ -22,7 +22,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/common/command/SimpleCommand.scala b/src/main/scala/li/cil/oc/common/command/SimpleCommand.scala index aa670f2dc..f23bc9523 100644 --- a/src/main/scala/li/cil/oc/common/command/SimpleCommand.scala +++ b/src/main/scala/li/cil/oc/common/command/SimpleCommand.scala @@ -15,7 +15,7 @@ abstract class SimpleCommand(val name: String) extends CommandBase { override def getAliases = aliases - override def canCommandSenderUse(source: ICommandSender) = MinecraftServer.getServer.isSinglePlayer || super.canCommandSenderUse(source) + override def canCommandSenderUse(source: ICommandSender) = super.canCommandSenderUse(source) || (MinecraftServer.getServer != null && MinecraftServer.getServer.isSinglePlayer) override def isUsernameIndex(command: Array[String], i: Int) = false diff --git a/src/main/scala/li/cil/oc/common/item/HoverBoots.scala b/src/main/scala/li/cil/oc/common/item/HoverBoots.scala index becc96703..e2a300954 100644 --- a/src/main/scala/li/cil/oc/common/item/HoverBoots.scala +++ b/src/main/scala/li/cil/oc/common/item/HoverBoots.scala @@ -67,7 +67,7 @@ class HoverBoots extends ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 0, 3) with t override def onArmorTick(world: World, player: EntityPlayer, stack: ItemStack): Unit = { super.onArmorTick(world, player, stack) - if (player.getActivePotionEffect(Potion.moveSlowdown) == null && getCharge(stack) == 0) { + if (!Settings.get.ignorePower && player.getActivePotionEffect(Potion.moveSlowdown) == null && getCharge(stack) == 0) { player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId, 20, 1)) } } diff --git a/src/main/scala/li/cil/oc/integration/Mods.scala b/src/main/scala/li/cil/oc/integration/Mods.scala index 52fb2b544..f7d540bb2 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/fmp/CablePart.scala b/src/main/scala/li/cil/oc/integration/fmp/CablePart.scala index da2c66455..8a3a11960 100644 --- a/src/main/scala/li/cil/oc/integration/fmp/CablePart.scala +++ b/src/main/scala/li/cil/oc/integration/fmp/CablePart.scala @@ -60,6 +60,8 @@ class CablePart(val original: Option[tileentity.Cable] = None) extends SimpleBlo def getType = Settings.namespace + Constants.BlockName.Cable + override def getStrength(hit: MovingObjectPosition, player: EntityPlayer): Float = api.Items.get(Constants.BlockName.Cable).block().getBlockHardness(world, hit.blockX, hit.blockY, hit.blockZ) + override def doesTick = false override def getBounds = new Cuboid6(Cable.bounds(world, x, y, z)) @@ -72,7 +74,6 @@ class CablePart(val original: Option[tileentity.Cable] = None) extends SimpleBlo override def getSlotMask = 1 << 6 // 6 is center part. - // ----------------------------------------------------------------------- // override def activate(player: EntityPlayer, hit: MovingObjectPosition, item: ItemStack) = { 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()); } diff --git a/src/main/scala/li/cil/oc/integration/opencomputers/DriverFileSystem.scala b/src/main/scala/li/cil/oc/integration/opencomputers/DriverFileSystem.scala index 2837c38a0..7afd775ad 100644 --- a/src/main/scala/li/cil/oc/integration/opencomputers/DriverFileSystem.scala +++ b/src/main/scala/li/cil/oc/integration/opencomputers/DriverFileSystem.scala @@ -68,10 +68,10 @@ object DriverFileSystem extends Item { val sound = Settings.resourceDomain + ":" + (if (isFloppy) "floppy_access" else "hdd_access") val drive = new DriveData(stack) val environment = if (drive.isUnmanaged) { - Drive(capacity, platterCount, label, Option(host), Option(sound), speed) + Drive(capacity max 0, platterCount, label, Option(host), Option(sound), speed) } else { - val fs = oc.api.FileSystem.fromSaveDirectory(address, capacity, Settings.get.bufferChanges) + val fs = oc.api.FileSystem.fromSaveDirectory(address, capacity max 0, Settings.get.bufferChanges) oc.api.FileSystem.asManagedEnvironment(fs, label, host, sound, speed) } if (environment != null && environment.node != null) {