mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 17:56:34 -04:00
Merge branch 'master-MC1.7.10' into onesix
Conflicts: src/main/scala/li/cil/oc/integration/opencomputers/DriverFileSystem.scala
This commit is contained in:
commit
d1563e10b0
@ -1,7 +1,7 @@
|
||||
minecraft.version=1.7.10
|
||||
forge.version=10.13.4.1448-1.7.10
|
||||
|
||||
oc.version=1.5.19
|
||||
oc.version=1.5.20
|
||||
oc.subversion=dev
|
||||
|
||||
ae2.version=rv2-beta-26
|
||||
@ -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
|
||||
|
@ -14,7 +14,7 @@ abstract class SimpleCommand(val name: String) extends CommandBase {
|
||||
|
||||
override def getCommandAliases = aliases
|
||||
|
||||
override def canCommandSenderUseCommand(source: ICommandSender) = MinecraftServer.getServer.isSinglePlayer || super.canCommandSenderUseCommand(source)
|
||||
override def canCommandSenderUseCommand(source: ICommandSender) = super.canCommandSenderUseCommand(source) || (MinecraftServer.getServer != null && MinecraftServer.getServer.isSinglePlayer)
|
||||
|
||||
override def isUsernameIndex(command: Array[String], i: Int) = false
|
||||
|
||||
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
@ -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")()
|
||||
|
@ -61,6 +61,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))
|
||||
@ -73,7 +75,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) = {
|
||||
|
@ -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<Object, Object> output) {
|
||||
if (value instanceof IMutation) {
|
||||
IMutation mutation = (IMutation) value;
|
||||
final IMutation mutation = (IMutation) value;
|
||||
|
||||
IAllele allele1 = mutation.getAllele0();
|
||||
if (allele1 instanceof IAlleleSpecies) {
|
||||
Map<Object, Object> allelMap1 = Maps.newHashMap();
|
||||
final IAlleleSpecies allele1 = mutation.getAllele0();
|
||||
if (allele1 != null) {
|
||||
final Map<Object, Object> allelMap1 = Maps.newHashMap();
|
||||
convert(allele1, allelMap1);
|
||||
output.put("allele1", allelMap1);
|
||||
}
|
||||
IAllele allele2 = mutation.getAllele1();
|
||||
if (allele2 instanceof IAlleleSpecies) {
|
||||
Map<Object, Object> allelMap2 = Maps.newHashMap();
|
||||
final IAlleleSpecies allele2 = mutation.getAllele1();
|
||||
if (allele2 != null) {
|
||||
final Map<Object, Object> allelMap2 = Maps.newHashMap();
|
||||
convert(allele2, allelMap2);
|
||||
output.put("allele2", allelMap2);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class ConverterIIndividual implements Converter {
|
||||
};
|
||||
|
||||
private interface IAlleleConverter<A extends IAllele> {
|
||||
public Object convert(A allele);
|
||||
Object convert(A allele);
|
||||
}
|
||||
|
||||
private static final Map<Class<? extends IAllele>, IAlleleConverter<?>> converters =
|
||||
|
@ -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))
|
||||
}
|
||||
|
||||
|
@ -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<Map<String, Object>> result = Sets.newHashSet();
|
||||
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) {
|
||||
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());
|
||||
}
|
||||
|
@ -66,10 +66,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) {
|
||||
new Drive(capacity, platterCount, label, Option(host), Option(sound), speed)
|
||||
new 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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user