mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 10:21:45 -04:00
Housekeeping (typos, formatting, ...)
This commit is contained in:
parent
b31e0506f8
commit
f4258aa719
@ -55,7 +55,7 @@ private[oc] class Proxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.Hologram], HologramRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.PowerDistributor], PowerDistributorRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.ServerRack], ServerRackRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.Assembler], RobotAssemblerRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.Assembler], AssemblerRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.Switch], SwitchRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.AccessPoint], SwitchRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.RobotProxy], RobotRenderer)
|
||||
|
@ -72,7 +72,7 @@ object Textures {
|
||||
val icons = Array.fill[IIcon](6)(null)
|
||||
}
|
||||
|
||||
object RobotAssembler {
|
||||
object Assembler {
|
||||
var iconSideAssembling: IIcon = _
|
||||
var iconSideOn: IIcon = _
|
||||
var iconTopOn: IIcon = _
|
||||
|
@ -57,11 +57,11 @@ object Assembler {
|
||||
RenderState.makeItBlend()
|
||||
RenderState.disableLighting()
|
||||
|
||||
renderer.setOverrideBlockTexture(Textures.RobotAssembler.iconTopOn)
|
||||
renderer.setOverrideBlockTexture(Textures.Assembler.iconTopOn)
|
||||
renderer.setRenderBounds(0, 0, 0, 1, 1.05, 1)
|
||||
BlockRenderer.renderFaceYPos(block, metadata, renderer)
|
||||
|
||||
renderer.setOverrideBlockTexture(Textures.RobotAssembler.iconSideOn)
|
||||
renderer.setOverrideBlockTexture(Textures.Assembler.iconSideOn)
|
||||
renderer.setRenderBounds(-0.005, 0, 0, 1.005, 1, 1)
|
||||
BlockRenderer.renderFaceXPos(block, metadata, renderer)
|
||||
BlockRenderer.renderFaceXNeg(block, metadata, renderer)
|
||||
|
@ -9,7 +9,7 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer
|
||||
import net.minecraft.tileentity.TileEntity
|
||||
import org.lwjgl.opengl.GL11
|
||||
|
||||
object RobotAssemblerRenderer extends TileEntitySpecialRenderer {
|
||||
object AssemblerRenderer extends TileEntitySpecialRenderer {
|
||||
override def renderTileEntityAt(tileEntity: TileEntity, x: Double, y: Double, z: Double, f: Float) {
|
||||
RenderState.checkError(getClass.getName + ".renderTileEntityAt: entering (aka: wasntme)")
|
||||
|
||||
@ -29,7 +29,7 @@ object RobotAssemblerRenderer extends TileEntitySpecialRenderer {
|
||||
t.startDrawingQuads()
|
||||
|
||||
{
|
||||
val icon = Textures.RobotAssembler.iconTopOn
|
||||
val icon = Textures.Assembler.iconTopOn
|
||||
t.addVertexWithUV(-0.5, 0.55, 0.5, icon.getMinU, icon.getMaxV)
|
||||
t.addVertexWithUV(0.5, 0.55, 0.5, icon.getMaxU, icon.getMaxV)
|
||||
t.addVertexWithUV(0.5, 0.55, -0.5, icon.getMaxU, icon.getMinV)
|
||||
@ -43,7 +43,7 @@ object RobotAssemblerRenderer extends TileEntitySpecialRenderer {
|
||||
t.startDrawingQuads()
|
||||
|
||||
if (assembler.isAssembling) {
|
||||
val icon = Textures.RobotAssembler.iconSideAssembling
|
||||
val icon = Textures.Assembler.iconSideAssembling
|
||||
t.addVertexWithUV(indent, 0.5, -indent, icon.getInterpolatedU((0.5 - indent) * 16), icon.getMaxV)
|
||||
t.addVertexWithUV(indent, 0.5, indent, icon.getInterpolatedU((0.5 + indent) * 16), icon.getMaxV)
|
||||
t.addVertexWithUV(indent, -0.5, indent, icon.getInterpolatedU((0.5 + indent) * 16), icon.getMinV)
|
||||
@ -51,7 +51,7 @@ object RobotAssemblerRenderer extends TileEntitySpecialRenderer {
|
||||
}
|
||||
|
||||
{
|
||||
val icon = Textures.RobotAssembler.iconSideOn
|
||||
val icon = Textures.Assembler.iconSideOn
|
||||
t.addVertexWithUV(0.5005, 0.5, -0.5, icon.getMinU, icon.getMaxV)
|
||||
t.addVertexWithUV(0.5005, 0.5, 0.5, icon.getMaxU, icon.getMaxV)
|
||||
t.addVertexWithUV(0.5005, -0.5, 0.5, icon.getMaxU, icon.getMinV)
|
@ -25,9 +25,9 @@ class Assembler extends SimpleBlock with traits.SpecialBlock with traits.PowerAc
|
||||
|
||||
override def registerBlockIcons(iconRegister: IIconRegister) = {
|
||||
super.registerBlockIcons(iconRegister)
|
||||
Textures.RobotAssembler.iconSideAssembling = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerSideAssembling")
|
||||
Textures.RobotAssembler.iconSideOn = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerSideOn")
|
||||
Textures.RobotAssembler.iconTopOn = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerTopOn")
|
||||
Textures.Assembler.iconSideAssembling = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerSideAssembling")
|
||||
Textures.Assembler.iconSideOn = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerSideOn")
|
||||
Textures.Assembler.iconTopOn = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerTopOn")
|
||||
}
|
||||
|
||||
override def isBlockSolid(world: IBlockAccess, x: Int, y: Int, z: Int, side: ForgeDirection) = side == ForgeDirection.DOWN || side == ForgeDirection.UP
|
||||
|
@ -1,5 +1,7 @@
|
||||
package li.cil.oc.common
|
||||
|
||||
import scala.language.implicitConversions
|
||||
|
||||
package object component {
|
||||
implicit def result(args: Any*): Array[AnyRef] = li.cil.oc.util.ResultWrapper.result(args: _*)
|
||||
}
|
||||
|
@ -25,12 +25,12 @@ public final class DriverEnderEnergy extends DriverTileEntity {
|
||||
super(tileEntity, "ender_energy");
|
||||
}
|
||||
|
||||
@Callback(doc = "function():boolean -- Returns whether the tileentity can receive energy.")
|
||||
@Callback(doc = "function():boolean -- Returns whether the tile entity can receive energy.")
|
||||
public Object[] canReceiveEnergy(final Context context, final Arguments args) {
|
||||
return new Object[]{tileEntity.canReceiveEnergy()};
|
||||
}
|
||||
|
||||
@Callback(doc = "function():boolean -- Returns whether the tileentity can send energy.")
|
||||
@Callback(doc = "function():boolean -- Returns whether the tile entity can send energy.")
|
||||
public Object[] canSendEnergy(final Context context, final Arguments args) {
|
||||
return new Object[]{tileEntity.canSendEnergy()};
|
||||
}
|
||||
|
@ -25,12 +25,12 @@ public final class DriverEnderFluid extends DriverTileEntity {
|
||||
super(tileEntity, "ender_fluid");
|
||||
}
|
||||
|
||||
@Callback(doc = "function():boolean -- Returns whether the tileentity can receive fluids.")
|
||||
@Callback(doc = "function():boolean -- Returns whether the tile entity can receive fluids.")
|
||||
public Object[] canReceiveFluid(final Context context, final Arguments args) {
|
||||
return new Object[]{tileEntity.canReceiveFluid()};
|
||||
}
|
||||
|
||||
@Callback(doc = "function():boolean -- Returns whether the tileentity can send fluids.")
|
||||
@Callback(doc = "function():boolean -- Returns whether the tile entity can send fluids.")
|
||||
public Object[] canSendFluid(final Context context, final Arguments args) {
|
||||
return new Object[]{tileEntity.canSendFluid()};
|
||||
}
|
||||
|
@ -25,12 +25,12 @@ public final class DriverEnderItem extends DriverTileEntity {
|
||||
super(tileEntity, "ender_item");
|
||||
}
|
||||
|
||||
@Callback(doc = "function():boolean -- Returns whether the tileentity can receive items.")
|
||||
@Callback(doc = "function():boolean -- Returns whether the tile entity can receive items.")
|
||||
public Object[] canReceiveItems(final Context context, final Arguments args) {
|
||||
return new Object[]{tileEntity.canReceiveItems()};
|
||||
}
|
||||
|
||||
@Callback(doc = "function():boolean -- Returns whether the tileentity can send items.")
|
||||
@Callback(doc = "function():boolean -- Returns whether the tile entity can send items.")
|
||||
public Object[] canSendItems(final Context context, final Arguments args) {
|
||||
return new Object[]{tileEntity.canSendItems()};
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public final class DriverBeacon extends DriverTileEntity implements EnvironmentA
|
||||
}
|
||||
|
||||
@Callback(doc = "function():string -- Get the name of the active secondary effect.")
|
||||
public Object[] getSecondayEffect(final Context context, final Arguments args) {
|
||||
public Object[] getSecondaryEffect(final Context context, final Arguments args) {
|
||||
return new Object[]{getEffectName(tileEntity.getSecondaryEffect())};
|
||||
}
|
||||
}
|
||||
|
@ -39,19 +39,19 @@ public final class DriverInventory extends DriverTileEntity {
|
||||
|
||||
@Callback(doc = "function():string -- Get the name of this inventory.")
|
||||
public Object[] getInventoryName(final Context context, final Arguments args) {
|
||||
if (!checkPermission()) return new Object[]{null, "permission denied"};
|
||||
if (notPermitted()) return new Object[]{null, "permission denied"};
|
||||
return new Object[]{tileEntity.getInventoryName()};
|
||||
}
|
||||
|
||||
@Callback(doc = "function():number -- Get the number of slots in this inventory.")
|
||||
public Object[] getInventorySize(final Context context, final Arguments args) {
|
||||
if (!checkPermission()) return new Object[]{null, "permission denied"};
|
||||
if (notPermitted()) return new Object[]{null, "permission denied"};
|
||||
return new Object[]{tileEntity.getSizeInventory()};
|
||||
}
|
||||
|
||||
@Callback(doc = "function(slot:number):number -- Get the stack size of the item stack in the specified slot.")
|
||||
public Object[] getSlotStackSize(final Context context, final Arguments args) {
|
||||
if (!checkPermission()) return new Object[]{null, "permission denied"};
|
||||
if (notPermitted()) return new Object[]{null, "permission denied"};
|
||||
final int slot = checkSlot(args, 0);
|
||||
final ItemStack stack = tileEntity.getStackInSlot(slot);
|
||||
if (stack != null) {
|
||||
@ -63,7 +63,7 @@ public final class DriverInventory extends DriverTileEntity {
|
||||
|
||||
@Callback(doc = "function(slot:number):number -- Get the maximum stack size of the item stack in the specified slot.")
|
||||
public Object[] getSlotMaxStackSize(final Context context, final Arguments args) {
|
||||
if (!checkPermission()) return new Object[]{null, "permission denied"};
|
||||
if (notPermitted()) return new Object[]{null, "permission denied"};
|
||||
final int slot = checkSlot(args, 0);
|
||||
final ItemStack stack = tileEntity.getStackInSlot(slot);
|
||||
if (stack != null) {
|
||||
@ -75,7 +75,7 @@ public final class DriverInventory extends DriverTileEntity {
|
||||
|
||||
@Callback(doc = "function(slotA:number, slotB:number):boolean -- Compare the two item stacks in the specified slots for equality.")
|
||||
public Object[] compareStacks(final Context context, final Arguments args) {
|
||||
if (!checkPermission()) return new Object[]{null, "permission denied"};
|
||||
if (notPermitted()) return new Object[]{null, "permission denied"};
|
||||
final int slotA = checkSlot(args, 0);
|
||||
final int slotB = checkSlot(args, 1);
|
||||
if (slotA == slotB) {
|
||||
@ -94,7 +94,7 @@ public final class DriverInventory extends DriverTileEntity {
|
||||
|
||||
@Callback(doc = "function(slotA:number, slotB:number[, count:number=math.huge]):boolean -- Move up to the specified number of items from the first specified slot to the second.")
|
||||
public Object[] transferStack(final Context context, final Arguments args) {
|
||||
if (!checkPermission()) return new Object[]{null, "permission denied"};
|
||||
if (notPermitted()) return new Object[]{null, "permission denied"};
|
||||
final int slotA = checkSlot(args, 0);
|
||||
final int slotB = checkSlot(args, 1);
|
||||
final int count = Math.max(0, Math.min(args.count() > 2 && args.checkAny(2) != null ? args.checkInteger(2) : 64, tileEntity.getInventoryStackLimit()));
|
||||
@ -137,7 +137,7 @@ public final class DriverInventory extends DriverTileEntity {
|
||||
@Callback(doc = "function(slot:number):table -- Get a description of the item stack in the specified slot.")
|
||||
public Object[] getStackInSlot(final Context context, final Arguments args) {
|
||||
if (Settings.get().allowItemStackInspection()) {
|
||||
if (!checkPermission()) return new Object[]{null, "permission denied"};
|
||||
if (notPermitted()) return new Object[]{null, "permission denied"};
|
||||
return new Object[]{tileEntity.getStackInSlot(checkSlot(args, 0))};
|
||||
} else {
|
||||
return new Object[]{null, "not enabled in config"};
|
||||
@ -147,7 +147,7 @@ public final class DriverInventory extends DriverTileEntity {
|
||||
@Callback(doc = "function():table -- Get a list of descriptions for all item stacks in this inventory.")
|
||||
public Object[] getAllStacks(final Context context, final Arguments args) {
|
||||
if (Settings.get().allowItemStackInspection()) {
|
||||
if (!checkPermission()) return new Object[]{null, "permission denied"};
|
||||
if (notPermitted()) return new Object[]{null, "permission denied"};
|
||||
ItemStack[] allStacks = new ItemStack[tileEntity.getSizeInventory()];
|
||||
for (int i = 0; i < tileEntity.getSizeInventory(); i++) {
|
||||
allStacks[i] = tileEntity.getStackInSlot(i);
|
||||
@ -170,10 +170,10 @@ public final class DriverInventory extends DriverTileEntity {
|
||||
return stackA.getItem().equals(stackB.getItem()) && !stackA.getHasSubtypes() || stackA.getItemDamage() == stackB.getItemDamage();
|
||||
}
|
||||
|
||||
private boolean checkPermission() {
|
||||
private boolean notPermitted() {
|
||||
synchronized (fakePlayer) {
|
||||
fakePlayer.setPosition(position.xCoord, position.yCoord, position.zCoord);
|
||||
return tileEntity.isUseableByPlayer(fakePlayer);
|
||||
return !tileEntity.isUseableByPlayer(fakePlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public final class DriverRecordPlayer extends DriverTileEntity implements Enviro
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Callback(doc = "function():string -- Get the title of the record currently in the juke box.")
|
||||
@Callback(doc = "function():string -- Get the title of the record currently in the jukebox.")
|
||||
public Object[] getRecord(final Context context, final Arguments args) {
|
||||
final ItemStack record = tileEntity.func_145856_a();
|
||||
if (record == null || !(record.getItem() instanceof ItemRecord)) {
|
||||
|
@ -1,5 +1,7 @@
|
||||
package li.cil.oc.server
|
||||
|
||||
import scala.language.implicitConversions
|
||||
|
||||
package object component {
|
||||
implicit def result(args: Any*): Array[AnyRef] = li.cil.oc.util.ResultWrapper.result(args: _*)
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import scala.language.implicitConversions
|
||||
|
||||
object ExtendedArguments {
|
||||
|
||||
implicit def extendedArguments(args: Arguments) = new ExtendedArguments(args)
|
||||
implicit def extendedArguments(args: Arguments): ExtendedArguments = new ExtendedArguments(args)
|
||||
|
||||
class ExtendedArguments(val args: Arguments) {
|
||||
def optionalItemCount(n: Int) =
|
||||
|
@ -17,7 +17,7 @@ import scala.runtime.BoxedUnit
|
||||
|
||||
object ExtendedLuaState {
|
||||
|
||||
implicit def extendLuaState(state: LuaState) = new ExtendedLuaState(state)
|
||||
implicit def extendLuaState(state: LuaState): ExtendedLuaState = new ExtendedLuaState(state)
|
||||
|
||||
class ExtendedLuaState(val lua: LuaState) {
|
||||
def pushScalaFunction(f: (LuaState) => Int) = lua.pushJavaFunction(new JavaFunction {
|
||||
|
@ -3,35 +3,35 @@ package li.cil.oc.util
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt._
|
||||
|
||||
import scala.language.implicitConversions
|
||||
import scala.language.{implicitConversions, reflectiveCalls}
|
||||
|
||||
object ExtendedNBT {
|
||||
|
||||
implicit def toNbt(value: Byte) = new NBTTagByte(value)
|
||||
implicit def toNbt(value: Byte): NBTTagByte = new NBTTagByte(value)
|
||||
|
||||
implicit def toNbt(value: Short) = new NBTTagShort(value)
|
||||
implicit def toNbt(value: Short): NBTTagShort = new NBTTagShort(value)
|
||||
|
||||
implicit def toNbt(value: Int) = new NBTTagInt(value)
|
||||
implicit def toNbt(value: Int): NBTTagInt = new NBTTagInt(value)
|
||||
|
||||
implicit def toNbt(value: Array[Int]) = new NBTTagIntArray(value)
|
||||
implicit def toNbt(value: Array[Int]): NBTTagIntArray = new NBTTagIntArray(value)
|
||||
|
||||
implicit def toNbt(value: Long) = new NBTTagLong(value)
|
||||
implicit def toNbt(value: Long): NBTTagLong = new NBTTagLong(value)
|
||||
|
||||
implicit def toNbt(value: Float) = new NBTTagFloat(value)
|
||||
implicit def toNbt(value: Float): NBTTagFloat = new NBTTagFloat(value)
|
||||
|
||||
implicit def toNbt(value: Double) = new NBTTagDouble(value)
|
||||
implicit def toNbt(value: Double): NBTTagDouble = new NBTTagDouble(value)
|
||||
|
||||
implicit def toNbt(value: Array[Byte]) = new NBTTagByteArray(value)
|
||||
implicit def toNbt(value: Array[Byte]): NBTTagByteArray = new NBTTagByteArray(value)
|
||||
|
||||
implicit def toNbt(value: String) = new NBTTagString(value)
|
||||
implicit def toNbt(value: String): NBTTagString = new NBTTagString(value)
|
||||
|
||||
implicit def toNbt(value: {def writeToNBT(nbt: NBTTagCompound): Unit}) = {
|
||||
implicit def toNbt(value: {def writeToNBT(nbt: NBTTagCompound): Unit}): NBTTagCompound = {
|
||||
val nbt = new NBTTagCompound()
|
||||
value.writeToNBT(nbt)
|
||||
nbt
|
||||
}
|
||||
|
||||
implicit def toNbt(value: ItemStack) = {
|
||||
implicit def toNbt(value: ItemStack): NBTTagCompound = {
|
||||
val nbt = new NBTTagCompound()
|
||||
if (value != null) {
|
||||
value.writeToNBT(nbt)
|
||||
@ -57,31 +57,31 @@ object ExtendedNBT {
|
||||
nbt
|
||||
}
|
||||
|
||||
implicit def byteIterableToNbt(value: Iterable[Byte]) = value.map(toNbt)
|
||||
implicit def byteIterableToNbt(value: Iterable[Byte]): Iterable[NBTTagByte] = value.map(toNbt)
|
||||
|
||||
implicit def shortIterableToNbt(value: Iterable[Short]) = value.map(toNbt)
|
||||
implicit def shortIterableToNbt(value: Iterable[Short]): Iterable[NBTTagShort] = value.map(toNbt)
|
||||
|
||||
implicit def intIterableToNbt(value: Iterable[Int]) = value.map(toNbt)
|
||||
implicit def intIterableToNbt(value: Iterable[Int]): Iterable[NBTTagInt] = value.map(toNbt)
|
||||
|
||||
implicit def intArrayIterableToNbt(value: Iterable[Array[Int]]) = value.map(toNbt)
|
||||
implicit def intArrayIterableToNbt(value: Iterable[Array[Int]]): Iterable[NBTTagIntArray] = value.map(toNbt)
|
||||
|
||||
implicit def longIterableToNbt(value: Iterable[Long]) = value.map(toNbt)
|
||||
implicit def longIterableToNbt(value: Iterable[Long]): Iterable[NBTTagLong] = value.map(toNbt)
|
||||
|
||||
implicit def floatIterableToNbt(value: Iterable[Float]) = value.map(toNbt)
|
||||
implicit def floatIterableToNbt(value: Iterable[Float]): Iterable[NBTTagFloat] = value.map(toNbt)
|
||||
|
||||
implicit def doubleIterableToNbt(value: Iterable[Double]) = value.map(toNbt)
|
||||
implicit def doubleIterableToNbt(value: Iterable[Double]): Iterable[NBTTagDouble] = value.map(toNbt)
|
||||
|
||||
implicit def byteArrayIterableToNbt(value: Iterable[Array[Byte]]) = value.map(toNbt)
|
||||
implicit def byteArrayIterableToNbt(value: Iterable[Array[Byte]]): Iterable[NBTTagByteArray] = value.map(toNbt)
|
||||
|
||||
implicit def stringIterableToNbt(value: Iterable[String]) = value.map(toNbt)
|
||||
implicit def stringIterableToNbt(value: Iterable[String]): Iterable[NBTTagString] = value.map(toNbt)
|
||||
|
||||
implicit def writableIterableToNbt(value: Iterable[ {def writeToNBT(nbt: NBTTagCompound): Unit}]) = value.map(toNbt)
|
||||
implicit def writableIterableToNbt(value: Iterable[ {def writeToNBT(nbt: NBTTagCompound): Unit}]): Iterable[NBTTagCompound] = value.map(toNbt)
|
||||
|
||||
implicit def itemStackIterableToNbt(value: Iterable[ItemStack]) = value.map(toNbt)
|
||||
implicit def itemStackIterableToNbt(value: Iterable[ItemStack]): Iterable[NBTTagCompound] = value.map(toNbt)
|
||||
|
||||
implicit def extendNBTTagCompound(nbt: NBTTagCompound) = new ExtendedNBTTagCompound(nbt)
|
||||
implicit def extendNBTTagCompound(nbt: NBTTagCompound): ExtendedNBTTagCompound = new ExtendedNBTTagCompound(nbt)
|
||||
|
||||
implicit def extendNBTTagList(nbt: NBTTagList) = new ExtendedNBTTagList(nbt)
|
||||
implicit def extendNBTTagList(nbt: NBTTagList): ExtendedNBTTagList = new ExtendedNBTTagList(nbt)
|
||||
|
||||
class ExtendedNBTTagCompound(val nbt: NBTTagCompound) {
|
||||
def setNewCompoundTag(name: String, f: (NBTTagCompound) => Any) = {
|
||||
|
@ -5,11 +5,13 @@ import net.minecraft.tileentity.TileEntity
|
||||
import net.minecraft.world.IBlockAccess
|
||||
import net.minecraft.world.World
|
||||
|
||||
import scala.language.implicitConversions
|
||||
|
||||
object ExtendedWorld {
|
||||
|
||||
implicit def extendedBlockAccess(world: IBlockAccess) = new ExtendedBlockAccess(world)
|
||||
implicit def extendedBlockAccess(world: IBlockAccess): ExtendedBlockAccess = new ExtendedBlockAccess(world)
|
||||
|
||||
implicit def extendedWorld(world: World) = new ExtendedWorld(world)
|
||||
implicit def extendedWorld(world: World): ExtendedWorld = new ExtendedWorld(world)
|
||||
|
||||
class ExtendedBlockAccess(val world: IBlockAccess) {
|
||||
def getBlock(position: BlockPosition) = world.getBlock(position.x, position.y, position.z)
|
||||
|
@ -197,7 +197,7 @@ class RTree[Data](private val M: Int)(implicit val coordinate: Data => (Double,
|
||||
val list = mutable.Set.empty ++ values
|
||||
list -= s1
|
||||
list -= s2
|
||||
while (!list.isEmpty) {
|
||||
while (list.nonEmpty) {
|
||||
if (m - r1.set.size >= list.size) {
|
||||
list.foreach(r1.add)
|
||||
list.clear()
|
||||
|
@ -18,13 +18,13 @@ class ScalaClosure(val f: (Varargs) => Varargs) extends VarArgFunction {
|
||||
}
|
||||
|
||||
object ScalaClosure {
|
||||
implicit def wrapClosure(f: (Varargs) => LuaValue) = new ScalaClosure(args => f(args) match {
|
||||
implicit def wrapClosure(f: (Varargs) => LuaValue): ScalaClosure = new ScalaClosure(args => f(args) match {
|
||||
case varargs: Varargs => varargs
|
||||
case LuaValue.NONE => LuaValue.NONE
|
||||
case result => LuaValue.varargsOf(Array(result))
|
||||
})
|
||||
|
||||
implicit def wrapVarArgClosure(f: (Varargs) => Varargs) = new ScalaClosure(f)
|
||||
implicit def wrapVarArgClosure(f: (Varargs) => Varargs): ScalaClosure = new ScalaClosure(f)
|
||||
|
||||
def toLuaValue(value: Any): LuaValue = {
|
||||
(value match {
|
||||
|
Loading…
x
Reference in New Issue
Block a user