Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.8

Conflicts:
	src/main/scala/li/cil/oc/common/command/SimpleCommand.scala
This commit is contained in:
Florian Nücke 2015-10-28 20:07:06 +01:00
commit a09c38b18b
10 changed files with 29 additions and 29 deletions

View File

@ -1,7 +1,7 @@
minecraft.version=1.8 minecraft.version=1.8
forge.version=11.14.3.1450 forge.version=11.14.3.1450
oc.version=1.5.19 oc.version=1.5.20
oc.subversion=dev oc.subversion=dev
ae2.version=rv2-beta-26 ae2.version=rv2-beta-26
@ -22,7 +22,7 @@ eio.cf=2219/296
eio.version=1.7.10-2.2.1.276 eio.version=1.7.10-2.2.1.276
es.version=1.4.5.24 es.version=1.4.5.24
fmp.version=1.1.0.308 fmp.version=1.1.0.308
forestry.version=3.5.7.16 forestry.version=4.1.0.44
gc.build=3 gc.build=3
gc.version=3.0.7 gc.version=3.0.7
gt.version=5.04.06 gt.version=5.04.06

View File

@ -15,7 +15,7 @@ abstract class SimpleCommand(val name: String) extends CommandBase {
override def getAliases = aliases 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 override def isUsernameIndex(command: Array[String], i: Int) = false

View File

@ -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 = { override def onArmorTick(world: World, player: EntityPlayer, stack: ItemStack): Unit = {
super.onArmorTick(world, player, stack) 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)) player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId, 20, 1))
} }
} }

View File

@ -44,7 +44,7 @@ object Mods {
val EnderStorage = new SimpleMod(IDs.EnderStorage) val EnderStorage = new SimpleMod(IDs.EnderStorage)
val ExtraCells = new SimpleMod(IDs.ExtraCells, version = "@[2.2.73,)") val ExtraCells = new SimpleMod(IDs.ExtraCells, version = "@[2.2.73,)")
val Factorization = new SimpleMod(IDs.Factorization, providesPower = true) 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 ForgeMultipart = new SimpleMod(IDs.ForgeMultipart)
val Galacticraft = new SimpleMod(IDs.Galacticraft, providesPower = true) val Galacticraft = new SimpleMod(IDs.Galacticraft, providesPower = true)
val GregTech = new ClassBasedMod(IDs.GregTech, "gregtech.api.GregTech_API")() val GregTech = new ClassBasedMod(IDs.GregTech, "gregtech.api.GregTech_API")()

View File

@ -60,6 +60,8 @@ class CablePart(val original: Option[tileentity.Cable] = None) extends SimpleBlo
def getType = Settings.namespace + Constants.BlockName.Cable 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 doesTick = false
override def getBounds = new Cuboid6(Cable.bounds(world, x, y, z)) 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 getSlotMask = 1 << 6 // 6 is center part.
// ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- //
override def activate(player: EntityPlayer, hit: MovingObjectPosition, item: ItemStack) = { override def activate(player: EntityPlayer, hit: MovingObjectPosition, item: ItemStack) = {

View File

@ -1,7 +1,6 @@
package li.cil.oc.integration.forestry; package li.cil.oc.integration.forestry;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IMutation; import forestry.api.genetics.IMutation;
import li.cil.oc.api.driver.Converter; import li.cil.oc.api.driver.Converter;
@ -12,17 +11,17 @@ public class ConverterIAlleles implements Converter {
@Override @Override
public void convert(final Object value, final Map<Object, Object> output) { public void convert(final Object value, final Map<Object, Object> output) {
if (value instanceof IMutation) { if (value instanceof IMutation) {
IMutation mutation = (IMutation) value; final IMutation mutation = (IMutation) value;
IAllele allele1 = mutation.getAllele0(); final IAlleleSpecies allele1 = mutation.getAllele0();
if (allele1 instanceof IAlleleSpecies) { if (allele1 != null) {
Map<Object, Object> allelMap1 = Maps.newHashMap(); final Map<Object, Object> allelMap1 = Maps.newHashMap();
convert(allele1, allelMap1); convert(allele1, allelMap1);
output.put("allele1", allelMap1); output.put("allele1", allelMap1);
} }
IAllele allele2 = mutation.getAllele1(); final IAlleleSpecies allele2 = mutation.getAllele1();
if (allele2 instanceof IAlleleSpecies) { if (allele2 != null) {
Map<Object, Object> allelMap2 = Maps.newHashMap(); final Map<Object, Object> allelMap2 = Maps.newHashMap();
convert(allele2, allelMap2); convert(allele2, allelMap2);
output.put("allele2", allelMap2); output.put("allele2", allelMap2);
} }

View File

@ -68,7 +68,7 @@ public class ConverterIIndividual implements Converter {
}; };
private interface IAlleleConverter<A extends IAllele> { private interface IAlleleConverter<A extends IAllele> {
public Object convert(A allele); Object convert(A allele);
} }
private static final Map<Class<? extends IAllele>, IAlleleConverter<?>> converters = private static final Map<Class<? extends IAllele>, IAlleleConverter<?>> converters =

View File

@ -1,7 +1,7 @@
package li.cil.oc.integration.forestry package li.cil.oc.integration.forestry
import forestry.api.genetics.AlleleManager 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.driver.NamedBlock
import li.cil.oc.api.machine.Arguments import li.cil.oc.api.machine.Arguments
import li.cil.oc.api.machine.Callback import li.cil.oc.api.machine.Callback
@ -21,13 +21,13 @@ class DriverAnalyzer extends DriverTileEntity {
override def priority = 0 override def priority = 0
@Callback(doc = "function():boolean -- Can the bees breed?") @Callback(doc = "function():boolean -- Get whether the analyzer can work.")
def isWorking(context: Context, args: Arguments): Array[AnyRef] = result(tileEntity.isWorking) 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) 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)) def getIndividualOnDisplay(context: Context, args: Arguments): Array[AnyRef] = result(AlleleManager.alleleRegistry.getIndividual(tileEntity.getIndividualOnDisplay))
} }

View File

@ -38,12 +38,12 @@ public class DriverBeeHouse extends DriverTileEntity {
@Callback(doc = "function():boolean -- Can the bees breed?") @Callback(doc = "function():boolean -- Can the bees breed?")
public Object[] canBreed(final Context context, final Arguments args) { 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") @Callback(doc = "function():table -- Get the drone")
public Object[] getDrone(final Context context, final Arguments args) { public Object[] getDrone(final Context context, final Arguments args) {
final ItemStack drone = tileEntity.getDrone(); final ItemStack drone = tileEntity.getBeeInventory().getDrone();
if (drone != null) { if (drone != null) {
return new Object[]{AlleleManager.alleleRegistry.getIndividual(drone)}; return new Object[]{AlleleManager.alleleRegistry.getIndividual(drone)};
} }
@ -52,7 +52,7 @@ public class DriverBeeHouse extends DriverTileEntity {
@Callback(doc = "function():table -- Get the queen") @Callback(doc = "function():table -- Get the queen")
public Object[] getQueen(final Context context, final Arguments args) { public Object[] getQueen(final Context context, final Arguments args) {
final ItemStack queen = tileEntity.getQueen(); final ItemStack queen = tileEntity.getBeeInventory().getQueen();
if (queen != null) { if (queen != null) {
return new Object[]{AlleleManager.alleleRegistry.getIndividual(queen)}; return new Object[]{AlleleManager.alleleRegistry.getIndividual(queen)};
} }
@ -68,14 +68,14 @@ public class DriverBeeHouse extends DriverTileEntity {
final Set<Map<String, Object>> result = Sets.newHashSet(); final Set<Map<String, Object>> result = Sets.newHashSet();
for (IMutation mutation : beeRoot.getMutations(false)) { for (IMutation mutation : beeRoot.getMutations(false)) {
HashMap<String, Object> mutationMap = new HashMap<String, Object>(); final HashMap<String, Object> mutationMap = new HashMap<String, Object>();
IAllele allele1 = mutation.getAllele0(); final IAllele allele1 = mutation.getAllele0();
if (allele1 != null) { if (allele1 != null) {
mutationMap.put("allele1", allele1.getName()); mutationMap.put("allele1", allele1.getName());
} }
IAllele allele2 = mutation.getAllele1(); final IAllele allele2 = mutation.getAllele1();
if (allele2 != null) { if (allele2 != null) {
mutationMap.put("allele2", allele2.getName()); mutationMap.put("allele2", allele2.getName());
} }
@ -84,7 +84,7 @@ public class DriverBeeHouse extends DriverTileEntity {
mutationMap.put("specialConditions", mutation mutationMap.put("specialConditions", mutation
.getSpecialConditions().toArray()); .getSpecialConditions().toArray());
IAllele[] template = mutation.getTemplate(); final IAllele[] template = mutation.getTemplate();
if (template != null && template.length > 0) { if (template != null && template.length > 0) {
mutationMap.put("result", template[0].getName()); mutationMap.put("result", template[0].getName());
} }

View File

@ -68,10 +68,10 @@ object DriverFileSystem extends Item {
val sound = Settings.resourceDomain + ":" + (if (isFloppy) "floppy_access" else "hdd_access") val sound = Settings.resourceDomain + ":" + (if (isFloppy) "floppy_access" else "hdd_access")
val drive = new DriveData(stack) val drive = new DriveData(stack)
val environment = if (drive.isUnmanaged) { 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 { 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) oc.api.FileSystem.asManagedEnvironment(fs, label, host, sound, speed)
} }
if (environment != null && environment.node != null) { if (environment != null && environment.node != null) {