mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 04:06:43 -04:00
Merge branch 'OC1.3-MC1.6.4' of github.com:MightyPirates/OpenComputers
Conflicts: src/main/scala/li/cil/oc/common/block/AccessPoint.scala src/main/scala/li/cil/oc/common/block/Hologram.scala src/main/scala/li/cil/oc/common/block/Redstone.scala src/main/scala/li/cil/oc/common/block/Screen.scala src/main/scala/li/cil/oc/common/block/ServerRack.scala src/main/scala/li/cil/oc/common/block/Switch.scala src/main/scala/li/cil/oc/common/recipe/ExtendedRecipe.scala src/main/scala/li/cil/oc/common/tileentity/AccessPoint.scala src/main/scala/li/cil/oc/common/tileentity/ServerRack.scala src/main/scala/li/cil/oc/common/tileentity/Switch.scala
This commit is contained in:
commit
14d79b9456
@ -3,6 +3,7 @@ package li.cil.oc.common.asm;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import li.cil.oc.api.Network;
|
||||
import li.cil.oc.util.SideTracker;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -19,7 +20,7 @@ public final class SimpleComponentTickHandler implements ITickHandler {
|
||||
}
|
||||
|
||||
public static void schedule(final TileEntity tileEntity) {
|
||||
if (tileEntity.hasWorldObj() && !tileEntity.getWorldObj().isRemote) {
|
||||
if (SideTracker.isServer()) {
|
||||
synchronized (pending) {
|
||||
pending.add(new Runnable() {
|
||||
@Override
|
||||
|
@ -1,11 +1,11 @@
|
||||
package li.cil.oc.common.asm.template;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import li.cil.oc.api.Network;
|
||||
import li.cil.oc.api.network.Environment;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.Visibility;
|
||||
import li.cil.oc.common.asm.SimpleComponentTickHandler;
|
||||
import li.cil.oc.util.SideTracker;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -26,7 +26,7 @@ public final class StaticSimpleEnvironment {
|
||||
public static Node node(final SimpleComponentImpl self) {
|
||||
// Save ourselves the lookup time in the hash map and avoid mixing in
|
||||
// client side tile entities into the map when in single player.
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
if (SideTracker.isClient()) {
|
||||
return null;
|
||||
}
|
||||
if (!nodes.containsKey(self)) {
|
||||
|
22
src/main/java/li/cil/oc/util/SideTracker.java
Normal file
22
src/main/java/li/cil/oc/util/SideTracker.java
Normal file
@ -0,0 +1,22 @@
|
||||
package li.cil.oc.util;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
public final class SideTracker {
|
||||
private static final Set<Thread> serverThreads = Collections.newSetFromMap(new java.util.WeakHashMap<Thread, Boolean>());
|
||||
|
||||
public static void addServerThread() {
|
||||
serverThreads.add(Thread.currentThread());
|
||||
}
|
||||
|
||||
public static boolean isServer() {
|
||||
return FMLCommonHandler.instance().getEffectiveSide().isServer() || serverThreads.contains(Thread.currentThread());
|
||||
}
|
||||
|
||||
public static boolean isClient() {
|
||||
return !isServer();
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ import li.cil.oc.client.{PacketSender => ClientPacketSender}
|
||||
import li.cil.oc.common.tileentity.traits.power
|
||||
import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
||||
import li.cil.oc.util.mods.Mods
|
||||
import li.cil.oc.util.{LuaStateFactory, mods}
|
||||
import li.cil.oc.util.{LuaStateFactory, SideTracker, mods}
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.entity.player.{EntityPlayer, EntityPlayerMP}
|
||||
import net.minecraft.inventory.IInventory
|
||||
@ -30,21 +30,21 @@ object EventHandler extends ITickHandler with IConnectionHandler with ICraftingH
|
||||
val pending = mutable.Buffer.empty[() => Unit]
|
||||
|
||||
def schedule(tileEntity: TileEntity) {
|
||||
if (tileEntity.hasWorldObj && !tileEntity.getWorldObj.isRemote) pending.synchronized {
|
||||
if (SideTracker.isServer) pending.synchronized {
|
||||
pending += (() => Network.joinOrCreateNetwork(tileEntity))
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ForgeMultipart")
|
||||
def schedule(tileEntity: () => TileEntity) {
|
||||
pending.synchronized {
|
||||
if (SideTracker.isServer) pending.synchronized {
|
||||
pending += (() => Network.joinOrCreateNetwork(tileEntity()))
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
def scheduleIC2Add(tileEntity: power.IndustrialCraft2) {
|
||||
if (tileEntity.hasWorldObj && !tileEntity.getWorldObj.isRemote) pending.synchronized {
|
||||
if (SideTracker.isServer) pending.synchronized {
|
||||
pending += (() => if (!tileEntity.addedToPowerGrid && !tileEntity.isInvalid) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(tileEntity))
|
||||
tileEntity.addedToPowerGrid = true
|
||||
@ -54,7 +54,7 @@ object EventHandler extends ITickHandler with IConnectionHandler with ICraftingH
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
def scheduleIC2Remove(tileEntity: power.IndustrialCraft2) {
|
||||
if (tileEntity.hasWorldObj && !tileEntity.getWorldObj.isRemote) pending.synchronized {
|
||||
if (SideTracker.isServer) pending.synchronized {
|
||||
pending += (() => if (tileEntity.addedToPowerGrid) {
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(tileEntity))
|
||||
tileEntity.addedToPowerGrid = false
|
||||
@ -63,7 +63,7 @@ object EventHandler extends ITickHandler with IConnectionHandler with ICraftingH
|
||||
}
|
||||
|
||||
def scheduleWirelessRedstone(rs: server.component.RedstoneWireless) {
|
||||
if (rs.owner.isServer) pending.synchronized {
|
||||
if (SideTracker.isServer) pending.synchronized {
|
||||
pending += (() => if (!rs.owner.isInvalid) {
|
||||
mods.WirelessRedstone.addReceiver(rs)
|
||||
mods.WirelessRedstone.updateOutput(rs)
|
||||
|
@ -34,5 +34,5 @@ class AccessPoint(parent: SimpleDelegator) extends Switch(parent) {
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.AccessPoint(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.AccessPoint())
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ class Adapter(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Adapter(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Adapter())
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -14,7 +14,7 @@ import net.minecraftforge.common.ForgeDirection
|
||||
class Cable(val parent: SpecialDelegator) extends SpecialDelegate {
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Cable(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Cable())
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -33,7 +33,7 @@ class Capacitor(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Capacitor(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Capacitor())
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -74,7 +74,7 @@ class Case(val parent: SimpleDelegator, val tier: Int) extends RedstoneAware wit
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Case(world.isRemote, tier))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Case(tier))
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -39,7 +39,7 @@ class Charger(val parent: SimpleDelegator) extends RedstoneAware with SimpleDele
|
||||
Textures.Charger.iconSideCharging = iconRegister.registerIcon(Settings.resourceDomain + ":ChargerSideOn")
|
||||
}
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Charger(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Charger())
|
||||
|
||||
override def canConnectToRedstone(world: IBlockAccess, x: Int, y: Int, z: Int, side: ForgeDirection) = true
|
||||
|
||||
|
@ -8,7 +8,7 @@ import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.client.KeyBindings
|
||||
import li.cil.oc.common.tileentity.traits.{BundledRedstoneAware, Colored, Rotatable}
|
||||
import li.cil.oc.util.mods.Mods
|
||||
import li.cil.oc.util.{Color, ItemCosts}
|
||||
import li.cil.oc.util.{Color, ItemCosts, SideTracker}
|
||||
import li.cil.oc.{CreativeTab, Settings}
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.block.material.Material
|
||||
@ -240,11 +240,15 @@ class Delegator[Child <: Delegate](id: Int) extends Block(id, Material.iron) {
|
||||
case _ => false
|
||||
}
|
||||
|
||||
override def createTileEntity(world: World, metadata: Int): TileEntity =
|
||||
override def createTileEntity(world: World, metadata: Int): TileEntity = {
|
||||
if (!world.isRemote) {
|
||||
SideTracker.addServerThread()
|
||||
}
|
||||
subBlock(metadata) match {
|
||||
case Some(subBlock) => subBlock.createTileEntity(world).orNull
|
||||
case _ => null
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -37,7 +37,7 @@ class Disassembler(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Disassembler(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Disassembler())
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -50,7 +50,7 @@ class DiskDrive(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.DiskDrive(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.DiskDrive())
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -26,6 +26,6 @@ class Geolyzer(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Geolyzer(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Geolyzer())
|
||||
}
|
||||
|
||||
|
@ -54,5 +54,5 @@ class Hologram(val parent: SpecialDelegator, val tier: Int) extends SpecialDeleg
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Hologram(world.isRemote, tier))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Hologram(tier))
|
||||
}
|
@ -34,7 +34,7 @@ class Keyboard(val parent: SpecialDelegator) extends SpecialDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Keyboard(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Keyboard())
|
||||
|
||||
override def canPlaceBlockOnSide(world: World, x: Int, y: Int, z: Int, side: ForgeDirection) =
|
||||
world.isBlockSolidOnSide(x + side.offsetX, y + side.offsetY, z + side.offsetZ, side.getOpposite) &&
|
||||
|
@ -17,5 +17,5 @@ class MotionSensor(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.MotionSensor(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.MotionSensor())
|
||||
}
|
@ -58,5 +58,5 @@ class PowerConverter(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.PowerConverter(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.PowerConverter())
|
||||
}
|
||||
|
@ -27,6 +27,6 @@ class PowerDistributor(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.PowerDistributor(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.PowerDistributor())
|
||||
}
|
||||
|
||||
|
@ -29,5 +29,5 @@ class Redstone(val parent: SimpleDelegator) extends RedstoneAware with SimpleDel
|
||||
}
|
||||
}
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Redstone(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Redstone())
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class RobotAssembler(val parent: SpecialDelegator) extends SpecialDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.RobotAssembler(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.RobotAssembler())
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -86,8 +86,8 @@ class RobotProxy(val parent: SpecialDelegator) extends RedstoneAware with Specia
|
||||
|
||||
override def createTileEntity(world: World) = {
|
||||
moving.get match {
|
||||
case Some(robot) => Some(new tileentity.RobotProxy(world.isRemote, robot))
|
||||
case _ => Some(new tileentity.RobotProxy(world.isRemote, new tileentity.Robot(world.isRemote)))
|
||||
case Some(robot) => Some(new tileentity.RobotProxy(robot))
|
||||
case _ => Some(new tileentity.RobotProxy())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ class Screen(val parent: SimpleDelegator, val tier: Int) extends RedstoneAware w
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Screen(world.isRemote, tier))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Screen(tier))
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -40,7 +40,7 @@ class ServerRack(val parent: SpecialDelegator) extends RedstoneAware with Specia
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.ServerRack(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.ServerRack())
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -26,7 +26,7 @@ class Switch(val parent: SimpleDelegator) extends SimpleDelegate {
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Switch(world.isRemote))
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Switch())
|
||||
|
||||
override def rightClick(world: World, x: Int, y: Int, z: Int, player: EntityPlayer,
|
||||
side: ForgeDirection, hitX: Float, hitY: Float, hitZ: Float) = {
|
||||
|
@ -11,7 +11,7 @@ import li.cil.oc.common.tileentity
|
||||
import li.cil.oc.server.component.Keyboard
|
||||
import li.cil.oc.server.{ComponentTracker => ServerComponentTracker, PacketSender => ServerPacketSender}
|
||||
import li.cil.oc.util.ExtendedNBT._
|
||||
import li.cil.oc.util.PackedColor
|
||||
import li.cil.oc.util.{PackedColor, SideTracker}
|
||||
import li.cil.oc.{Settings, api, util}
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
@ -57,8 +57,8 @@ class TextBuffer(val owner: Container) extends ManagedComponent with api.compone
|
||||
powerConsumptionPerTick * (mw * mh) / (w * h)
|
||||
}
|
||||
|
||||
lazy val proxy =
|
||||
if (owner.world.isRemote) new TextBuffer.ClientProxy(this)
|
||||
val proxy =
|
||||
if (SideTracker.isClient) new TextBuffer.ClientProxy(this)
|
||||
else new TextBuffer.ServerProxy(this)
|
||||
|
||||
val data = new util.TextBuffer(maxResolution, PackedColor.Depth.format(maxDepth))
|
||||
@ -349,8 +349,7 @@ class TextBuffer(val owner: Container) extends ManagedComponent with api.compone
|
||||
|
||||
override def load(nbt: NBTTagCompound) {
|
||||
super.load(nbt)
|
||||
// World will be null on the server and set on the client.
|
||||
if (owner.world != null) {
|
||||
if (SideTracker.isClient) {
|
||||
if (!Strings.isNullOrEmpty(proxy.nodeAddress)) return // Only load once.
|
||||
proxy.nodeAddress = nbt.getCompoundTag("node").getString("address")
|
||||
TextBuffer.registerClientBuffer(this)
|
||||
|
@ -2,6 +2,7 @@ package li.cil.oc.common.container
|
||||
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.common.tileentity
|
||||
import li.cil.oc.util.SideTracker
|
||||
import net.minecraft.entity.player.InventoryPlayer
|
||||
|
||||
class Disassembler(playerInventory: InventoryPlayer, disassembler: tileentity.Disassembler) extends Player(playerInventory, disassembler) {
|
||||
@ -20,7 +21,7 @@ class Disassembler(playerInventory: InventoryPlayer, disassembler: tileentity.Di
|
||||
|
||||
override def detectAndSendChanges() {
|
||||
super.detectAndSendChanges()
|
||||
if (!disassembler.world.isRemote) {
|
||||
if (SideTracker.isServer) {
|
||||
if (math.abs(disassembler.progress - disassemblyProgress) > 0.2) {
|
||||
disassemblyProgress = disassembler.progress
|
||||
sendProgressBarUpdate(0, (disassemblyProgress * 5).toInt)
|
||||
|
@ -3,6 +3,7 @@ package li.cil.oc.common.container
|
||||
import li.cil.oc.api
|
||||
import li.cil.oc.client.gui.Icons
|
||||
import li.cil.oc.common.InventorySlots.InventorySlot
|
||||
import li.cil.oc.util.SideTracker
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.inventory.{IInventory, Slot}
|
||||
|
||||
@ -30,7 +31,7 @@ class DynamicComponentSlot(val container: Player, inventory: IInventory, index:
|
||||
}
|
||||
|
||||
override protected def clearIfInvalid(player: EntityPlayer) {
|
||||
if (player.getEntityWorld != null && !player.getEntityWorld.isRemote && getHasStack && !isItemValid(getStack)) {
|
||||
if (SideTracker.isServer && getHasStack && !isItemValid(getStack)) {
|
||||
val stack = getStack
|
||||
putStack(null)
|
||||
player.inventory.addItemStackToInventory(stack)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package li.cil.oc.common.container
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler
|
||||
import li.cil.oc.api
|
||||
import li.cil.oc.common.InventorySlots.{InventorySlot, Tier}
|
||||
import li.cil.oc.util.SideTracker
|
||||
import net.minecraft.entity.player.{EntityPlayer, InventoryPlayer}
|
||||
import net.minecraft.inventory.{Container, ICrafting, IInventory, Slot}
|
||||
import net.minecraft.item.ItemStack
|
||||
@ -23,7 +23,7 @@ abstract class Player(val playerInventory: InventoryPlayer, val otherInventory:
|
||||
|
||||
override def slotClick(slot: Int, mouseClick: Int, holdingShift: Int, player: EntityPlayer) = {
|
||||
val result = super.slotClick(slot, mouseClick, holdingShift, player)
|
||||
if (player.getEntityWorld != null && !player.getEntityWorld.isRemote) {
|
||||
if (SideTracker.isServer) {
|
||||
detectAndSendChanges() // We have to enforce this more than MC does itself
|
||||
// because stacks can change their... "character" just by being inserted in
|
||||
// certain containers - by being assigned an address.
|
||||
@ -36,7 +36,7 @@ abstract class Player(val playerInventory: InventoryPlayer, val otherInventory:
|
||||
val slot = Option(inventorySlots.get(index)).map(_.asInstanceOf[Slot]).orNull
|
||||
if (slot != null && slot.getHasStack) {
|
||||
tryTransferStackInSlot(slot, slot.inventory == otherInventory)
|
||||
if (player.getEntityWorld != null && !player.getEntityWorld.isRemote) {
|
||||
if (SideTracker.isServer) {
|
||||
detectAndSendChanges()
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package li.cil.oc.common.container
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.api
|
||||
import li.cil.oc.client.gui.Icons
|
||||
import li.cil.oc.common.InventorySlots.Tier
|
||||
import li.cil.oc.common.tileentity
|
||||
import li.cil.oc.util.SideTracker
|
||||
import net.minecraft.entity.player.{EntityPlayer, InventoryPlayer}
|
||||
import net.minecraft.inventory.IInventory
|
||||
|
||||
@ -59,7 +59,7 @@ class Robot(playerInventory: InventoryPlayer, robot: tileentity.Robot) extends P
|
||||
|
||||
override def detectAndSendChanges() {
|
||||
super.detectAndSendChanges()
|
||||
if (robot.isServer) {
|
||||
if (SideTracker.isServer) {
|
||||
val currentBuffer = robot.globalBuffer.toInt / factor
|
||||
if (currentBuffer != lastSentBuffer) {
|
||||
lastSentBuffer = currentBuffer
|
||||
|
@ -1,11 +1,10 @@
|
||||
package li.cil.oc.common.container
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.client.gui.Icons
|
||||
import li.cil.oc.common.InventorySlots.Tier
|
||||
import li.cil.oc.common.{InventorySlots, tileentity}
|
||||
import li.cil.oc.util.ItemUtils
|
||||
import li.cil.oc.util.{ItemUtils, SideTracker}
|
||||
import li.cil.oc.{Settings, api}
|
||||
import net.minecraft.entity.player.InventoryPlayer
|
||||
import net.minecraft.inventory.Slot
|
||||
@ -77,7 +76,7 @@ class RobotAssembler(playerInventory: InventoryPlayer, val assembler: tileentity
|
||||
|
||||
override def detectAndSendChanges() {
|
||||
super.detectAndSendChanges()
|
||||
if (assembler.isServer) {
|
||||
if (SideTracker.isServer) {
|
||||
if (isAssembling != assembler.isAssembling) {
|
||||
isAssembling = assembler.isAssembling
|
||||
sendProgressBarUpdate(0, if (isAssembling) 1 else 0)
|
||||
|
@ -43,9 +43,7 @@ class CablePart(val original: Option[Node] = None) extends DelegatePart with TCu
|
||||
|
||||
override def onWorldJoin() {
|
||||
super.onWorldJoin()
|
||||
if (world != null && !world.isRemote) {
|
||||
common.EventHandler.schedule(() => tile)
|
||||
}
|
||||
common.EventHandler.schedule(() => tile)
|
||||
}
|
||||
|
||||
override def onWorldSeparate() {
|
||||
|
@ -2,9 +2,8 @@ package li.cil.oc.common.recipe
|
||||
|
||||
import java.util.UUID
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler
|
||||
import li.cil.oc.util.Color
|
||||
import li.cil.oc.util.ExtendedNBT._
|
||||
import li.cil.oc.util.{Color, SideTracker}
|
||||
import li.cil.oc.{Settings, api}
|
||||
import net.minecraft.inventory.InventoryCrafting
|
||||
import net.minecraft.item.{Item, ItemStack}
|
||||
@ -28,7 +27,7 @@ object ExtendedRecipe {
|
||||
})
|
||||
}
|
||||
|
||||
if (api.Items.get(craftedStack) == linkedCard && FMLCommonHandler.instance.getEffectiveSide.isServer) {
|
||||
if (api.Items.get(craftedStack) == linkedCard && SideTracker.isServer) {
|
||||
Option(api.Driver.driverFor(craftedStack)).foreach(driver => {
|
||||
val nbt = driver.dataTag(craftedStack)
|
||||
nbt.setString(Settings.namespace + "tunnel", UUID.randomUUID().toString)
|
||||
|
@ -10,9 +10,7 @@ import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
import scala.collection.convert.WrapAsScala._
|
||||
|
||||
class AccessPoint(isClient: Boolean) extends Switch(isClient) with WirelessEndpoint {
|
||||
def this() = this(false)
|
||||
|
||||
class AccessPoint extends Switch with WirelessEndpoint {
|
||||
var strength = Settings.get.maxWirelessRange
|
||||
|
||||
val componentNodes = Array.fill(6)(api.Network.newNode(this, Visibility.Network).withComponent("access_point").create())
|
||||
|
@ -8,9 +8,7 @@ import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
import scala.collection.mutable
|
||||
|
||||
class Adapter(val isClient: Boolean) extends traits.Environment with Analyzable {
|
||||
def this() = this(false)
|
||||
|
||||
class Adapter extends traits.Environment with Analyzable {
|
||||
val node = api.Network.newNode(this, Visibility.Network).create()
|
||||
|
||||
private val blocks = Array.fill[Option[(ManagedEnvironment, api.driver.Block)]](6)(None)
|
||||
|
@ -3,9 +3,7 @@ package li.cil.oc.common.tileentity
|
||||
import li.cil.oc.api.network.Visibility
|
||||
import li.cil.oc.{api, common}
|
||||
|
||||
class Cable(val isClient: Boolean) extends traits.Environment with traits.NotAnalyzable {
|
||||
def this() = this(false)
|
||||
|
||||
class Cable extends traits.Environment with traits.NotAnalyzable {
|
||||
val node = api.Network.newNode(this, Visibility.None).create()
|
||||
|
||||
override def canUpdate = false
|
||||
|
@ -4,9 +4,7 @@ import li.cil.oc.api.network.{Node, Visibility}
|
||||
import li.cil.oc.{Settings, api}
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class Capacitor(val isClient: Boolean) extends traits.Environment {
|
||||
def this() = this(false)
|
||||
|
||||
class Capacitor extends traits.Environment {
|
||||
// Start with maximum theoretical capacity, gets reduced after validation.
|
||||
// This is done so that we don't lose energy while loading.
|
||||
val node = api.Network.newNode(this, Visibility.Network).
|
||||
|
@ -12,8 +12,8 @@ import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class Case(val isClient: Boolean, var tier: Int) extends traits.PowerAcceptor with traits.Computer with traits.Colored {
|
||||
def this() = this(false, 0)
|
||||
class Case(var tier: Int) extends traits.PowerAcceptor with traits.Computer with traits.Colored {
|
||||
def this() = this(0)
|
||||
|
||||
color = Color.byTier(tier)
|
||||
|
||||
|
@ -8,9 +8,7 @@ import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class Charger(val isClient: Boolean) extends traits.Environment with traits.PowerAcceptor with traits.RedstoneAware with traits.Rotatable with Analyzable {
|
||||
def this() = this(false)
|
||||
|
||||
class Charger extends traits.Environment with traits.PowerAcceptor with traits.RedstoneAware with traits.Rotatable with Analyzable {
|
||||
val node = api.Network.newNode(this, Visibility.None).
|
||||
withConnector(Settings.get.bufferConverter).
|
||||
create()
|
||||
|
@ -19,9 +19,7 @@ import net.minecraftforge.oredict.{ShapedOreRecipe, ShapelessOreRecipe}
|
||||
import scala.collection.convert.WrapAsScala._
|
||||
import scala.collection.mutable
|
||||
|
||||
class Disassembler(val isClient: Boolean) extends traits.Environment with traits.PowerAcceptor with traits.Inventory {
|
||||
def this() = this(false)
|
||||
|
||||
class Disassembler extends traits.Environment with traits.PowerAcceptor with traits.Inventory {
|
||||
val node = api.Network.newNode(this, Visibility.None).
|
||||
withConnector(Settings.get.bufferConverter).
|
||||
create()
|
||||
|
@ -7,14 +7,12 @@ import li.cil.oc.api.driver.Slot
|
||||
import li.cil.oc.api.network.{Analyzable, Component, Visibility}
|
||||
import li.cil.oc.common.Sound
|
||||
import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
||||
import li.cil.oc.util.ExtendedNBT._
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import li.cil.oc.util.ExtendedNBT._
|
||||
|
||||
class DiskDrive(val isClient: Boolean) extends traits.Environment with traits.ComponentInventory with traits.Rotatable with Analyzable {
|
||||
def this() = this(false)
|
||||
|
||||
class DiskDrive extends traits.Environment with traits.ComponentInventory with traits.Rotatable with Analyzable {
|
||||
val node = api.Network.newNode(this, Visibility.None).create()
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
@ -5,9 +5,7 @@ import li.cil.oc.{Settings, api}
|
||||
import net.minecraft.block.{Block, BlockFluid}
|
||||
import net.minecraftforge.fluids.FluidRegistry
|
||||
|
||||
class Geolyzer(val isClient: Boolean) extends traits.Environment {
|
||||
def this() = this(false)
|
||||
|
||||
class Geolyzer extends traits.Environment {
|
||||
val node = api.Network.newNode(this, Visibility.Network).
|
||||
withComponent("geolyzer").
|
||||
withConnector().
|
||||
|
@ -9,8 +9,8 @@ import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.util.AxisAlignedBB
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class Hologram(val isClient: Boolean, var tier: Int) extends traits.Environment with SidedEnvironment with Analyzable {
|
||||
def this() = this(false, 0)
|
||||
class Hologram(var tier: Int) extends traits.Environment with SidedEnvironment with Analyzable {
|
||||
def this() = this(0)
|
||||
|
||||
val node = api.Network.newNode(this, Visibility.Network).
|
||||
withComponent("hologram").
|
||||
@ -261,7 +261,7 @@ class Hologram(val isClient: Boolean, var tier: Int) extends traits.Environment
|
||||
|
||||
override def updateEntity() {
|
||||
super.updateEntity()
|
||||
if (isServer && node != null) {
|
||||
if (isServer) {
|
||||
if (dirty) {
|
||||
cooldown -= 1
|
||||
if (cooldown <= 0) this.synchronized {
|
||||
|
@ -8,9 +8,7 @@ import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class Keyboard(val isClient: Boolean) extends traits.Environment with traits.Rotatable with SidedEnvironment with Analyzable {
|
||||
def this() = this(false)
|
||||
|
||||
class Keyboard extends traits.Environment with traits.Rotatable with SidedEnvironment with Analyzable {
|
||||
override def validFacings = ForgeDirection.VALID_DIRECTIONS
|
||||
|
||||
val keyboard = {
|
||||
|
@ -10,9 +10,7 @@ import net.minecraft.util.{AxisAlignedBB, Vec3}
|
||||
import scala.collection.convert.WrapAsScala._
|
||||
import scala.collection.mutable
|
||||
|
||||
class MotionSensor(val isClient: Boolean) extends traits.Environment {
|
||||
def this() = this(false)
|
||||
|
||||
class MotionSensor extends traits.Environment {
|
||||
val node = api.Network.newNode(this, Visibility.Network).
|
||||
withComponent("motion_sensor").
|
||||
withConnector().
|
||||
|
@ -5,9 +5,7 @@ import li.cil.oc.api.network._
|
||||
import li.cil.oc.{Settings, api}
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class PowerConverter(val isClient: Boolean) extends traits.PowerAcceptor with traits.Environment with traits.NotAnalyzable {
|
||||
def this() = this(false)
|
||||
|
||||
class PowerConverter extends traits.PowerAcceptor with traits.Environment with traits.NotAnalyzable {
|
||||
val node = api.Network.newNode(this, Visibility.Network).
|
||||
withConnector(Settings.get.bufferConverter).
|
||||
create()
|
||||
|
@ -7,9 +7,7 @@ import li.cil.oc.{Settings, api}
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class PowerDistributor(val isClient: Boolean) extends traits.Environment with traits.PowerBalancer with traits.NotAnalyzable {
|
||||
def this() = this(false)
|
||||
|
||||
class PowerDistributor extends traits.Environment with traits.PowerBalancer with traits.NotAnalyzable {
|
||||
val node = null
|
||||
|
||||
private val nodes = Array.fill(6)(api.Network.newNode(this, Visibility.Network).
|
||||
|
@ -9,9 +9,7 @@ import li.cil.oc.util.mods.BundledRedstone
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class Redstone(val isClient: Boolean) extends Environment with BundledRedstoneAware {
|
||||
def this() = this(false)
|
||||
|
||||
class Redstone extends Environment with BundledRedstoneAware {
|
||||
val instance = if (BundledRedstone.isAvailable) new component.Redstone[BundledRedstoneAware](this) with component.RedstoneBundled else new component.Redstone(this)
|
||||
val node = instance.node
|
||||
if (node != null) {
|
||||
|
@ -30,9 +30,7 @@ import scala.collection.mutable
|
||||
// robot moves we only create a new proxy tile entity, hook the instance of this
|
||||
// class that was held by the old proxy to it and can then safely forget the
|
||||
// old proxy, which will be cleaned up by Minecraft like any other tile entity.
|
||||
class Robot(val isClient: Boolean) extends traits.Computer with traits.PowerInformation with api.machine.Robot {
|
||||
def this() = this(false)
|
||||
|
||||
class Robot extends traits.Computer with traits.PowerInformation with api.machine.Robot {
|
||||
var proxy: RobotProxy = _
|
||||
|
||||
val info = new ItemUtils.RobotData()
|
||||
|
@ -14,9 +14,7 @@ import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class RobotAssembler(val isClient: Boolean) extends traits.Environment with traits.PowerAcceptor with traits.Inventory with traits.Rotatable with SidedEnvironment {
|
||||
def this() = this(false)
|
||||
|
||||
class RobotAssembler extends traits.Environment with traits.PowerAcceptor with traits.Inventory with traits.Rotatable with SidedEnvironment {
|
||||
val node = api.Network.newNode(this, Visibility.None).
|
||||
withConnector(Settings.get.bufferConverter).
|
||||
create()
|
||||
|
@ -12,8 +12,8 @@ import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class RobotProxy(val isClient: Boolean, val robot: Robot) extends traits.Computer with traits.PowerInformation with api.machine.Robot with ISidedInventory {
|
||||
def this() = this(false, new Robot(false))
|
||||
class RobotProxy(val robot: Robot) extends traits.Computer with traits.PowerInformation with api.machine.Robot with ISidedInventory {
|
||||
def this() = this(new Robot())
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -15,8 +15,8 @@ import net.minecraftforge.common.ForgeDirection
|
||||
import scala.collection.mutable
|
||||
import scala.language.postfixOps
|
||||
|
||||
class Screen(val isClient: Boolean, var tier: Int) extends traits.TextBuffer with SidedEnvironment with traits.Rotatable with traits.RedstoneAware with traits.Colored with Analyzable with Ordered[Screen] {
|
||||
def this() = this(false, 0)
|
||||
class Screen(var tier: Int) extends traits.TextBuffer with SidedEnvironment with traits.Rotatable with traits.RedstoneAware with traits.Colored with Analyzable with Ordered[Screen] {
|
||||
def this() = this(0)
|
||||
|
||||
// Enable redstone functionality.
|
||||
_isOutputEnabled = true
|
||||
|
@ -24,15 +24,13 @@ import scala.collection.mutable
|
||||
|
||||
// See AbstractBusAware as to why we have to define the IBusDevice here.
|
||||
@Optional.Interface(iface = "stargatetech2.api.bus.IBusDevice", modid = "StargateTech2")
|
||||
class ServerRack(val isClient: Boolean) extends traits.PowerAcceptor with traits.Hub with traits.PowerBalancer with traits.Inventory with traits.Rotatable with traits.BundledRedstoneAware with traits.AbstractBusAware with Analyzable with IBusDevice {
|
||||
def this() = this(false)
|
||||
|
||||
class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerBalancer with traits.Inventory with traits.Rotatable with traits.BundledRedstoneAware with traits.AbstractBusAware with Analyzable with IBusDevice {
|
||||
val servers = Array.fill(getSizeInventory)(None: Option[component.Server])
|
||||
|
||||
val sides = Seq(ForgeDirection.UP, ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.DOWN).
|
||||
padTo(servers.length, ForgeDirection.UNKNOWN).toArray
|
||||
|
||||
lazy val terminals = (0 until servers.length).map(new common.component.Terminal(this, _)).toArray
|
||||
val terminals = (0 until servers.length).map(new common.component.Terminal(this, _)).toArray
|
||||
|
||||
var range = 16
|
||||
|
||||
|
@ -29,9 +29,7 @@ import scala.collection.mutable
|
||||
// old API, so there should be no ClassNotFoundExceptions anyway.
|
||||
|
||||
@Optional.Interface(iface = "dan200.computer.api.IPeripheral", modid = "ComputerCraft")
|
||||
class Switch(val isClient: Boolean) extends traits.Hub with traits.NotAnalyzable with IPeripheral with traits.ComponentInventory {
|
||||
def this() = this(false)
|
||||
|
||||
class Switch extends traits.Hub with traits.NotAnalyzable with IPeripheral with traits.ComponentInventory {
|
||||
var lastMessage = 0L
|
||||
|
||||
val computers = mutable.Map.empty[AnyRef, ComputerWrapper]
|
||||
|
@ -21,7 +21,7 @@ import scala.collection.mutable
|
||||
// See AbstractBusAware as to why we have to define the IBusDevice here.
|
||||
@Optional.Interface(iface = "stargatetech2.api.bus.IBusDevice", modid = "StargateTech2")
|
||||
trait Computer extends Environment with ComponentInventory with Rotatable with BundledRedstoneAware with AbstractBusAware with IBusDevice with Analyzable with Owner {
|
||||
private lazy val _computer = if (isClient) null else Machine.create(this)
|
||||
private lazy val _computer = if (isServer) Machine.create(this) else null
|
||||
|
||||
def computer = _computer
|
||||
|
||||
|
@ -19,7 +19,7 @@ trait Environment extends TileEntity with network.Environment with driver.Contai
|
||||
|
||||
override def markChanged() = onInventoryChanged()
|
||||
|
||||
protected def isConnected = node != null && node.address != null && node.network != null
|
||||
protected def isConnected = node.address != null && node.network != null
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -5,6 +5,7 @@ import java.util.logging.Level
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.OpenComputers
|
||||
import li.cil.oc.client.Sound
|
||||
import li.cil.oc.util.SideTracker
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.network.INetworkManager
|
||||
import net.minecraft.network.packet.Packet132TileEntityData
|
||||
@ -20,9 +21,9 @@ trait TileEntity extends net.minecraft.tileentity.TileEntity {
|
||||
|
||||
def block = getBlockType
|
||||
|
||||
def isClient: Boolean
|
||||
def isClient = SideTracker.isClient
|
||||
|
||||
def isServer = !isClient
|
||||
def isServer = SideTracker.isServer
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -1,12 +1,11 @@
|
||||
package li.cil.oc.server.network
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler
|
||||
import cpw.mods.fml.relauncher.Side
|
||||
import li.cil.oc.api.network
|
||||
import li.cil.oc.api.network.{Node => ImmutableNode, _}
|
||||
import li.cil.oc.server.component.machine.Machine
|
||||
import li.cil.oc.server.driver.{CompoundBlockEnvironment, Registry}
|
||||
import li.cil.oc.server.network.Callbacks.{ComponentCallback, PeripheralCallback}
|
||||
import li.cil.oc.util.SideTracker
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
|
||||
import scala.collection.convert.WrapAsJava._
|
||||
@ -52,7 +51,7 @@ trait Component extends network.Component with Node {
|
||||
throw new IllegalArgumentException("Trying to set computer visibility to '" + value + "' on a '" + name +
|
||||
"' node with reachability '" + reachability + "'. It will be limited to the node's reachability.")
|
||||
}
|
||||
if (FMLCommonHandler.instance.getEffectiveSide.isServer) {
|
||||
if (SideTracker.isServer) {
|
||||
if (network != null) _visibility match {
|
||||
case Visibility.Neighbors => value match {
|
||||
case Visibility.Network => addTo(reachableNodes)
|
||||
|
@ -2,14 +2,13 @@ package li.cil.oc.server.network
|
||||
|
||||
import codechicken.lib.vec.Cuboid6
|
||||
import codechicken.multipart.{JNormalOcclusion, NormalOcclusionTest, TFacePart, TileMultipart}
|
||||
import cpw.mods.fml.common.FMLCommonHandler
|
||||
import cpw.mods.fml.relauncher.Side
|
||||
import li.cil.oc.api.network
|
||||
import li.cil.oc.api.network.{Environment, SidedEnvironment, Visibility, WirelessEndpoint, Node => ImmutableNode}
|
||||
import li.cil.oc.common.block.Cable
|
||||
import li.cil.oc.common.multipart.CablePart
|
||||
import li.cil.oc.common.tileentity
|
||||
import li.cil.oc.server.network.{Node => MutableNode}
|
||||
import li.cil.oc.util.SideTracker
|
||||
import li.cil.oc.util.mods.Mods
|
||||
import li.cil.oc.{OpenComputers, Settings, api}
|
||||
import net.minecraft.nbt._
|
||||
@ -504,7 +503,7 @@ object Network extends api.detail.NetworkAPI {
|
||||
|
||||
def withConnector() = withConnector(0)
|
||||
|
||||
def create() = if (FMLCommonHandler.instance.getEffectiveSide.isServer) new MutableNode with NodeVarargPart {
|
||||
def create() = if (SideTracker.isServer) new MutableNode with NodeVarargPart {
|
||||
val host = _host
|
||||
val reachability = _reachability
|
||||
}
|
||||
@ -516,7 +515,7 @@ object Network extends api.detail.NetworkAPI {
|
||||
|
||||
def withConnector() = withConnector(0)
|
||||
|
||||
def create() = if (FMLCommonHandler.instance.getEffectiveSide.isServer) new Component with NodeVarargPart {
|
||||
def create() = if (SideTracker.isServer) new Component with NodeVarargPart {
|
||||
val host = _host
|
||||
val reachability = _reachability
|
||||
val name = _name
|
||||
@ -530,7 +529,7 @@ object Network extends api.detail.NetworkAPI {
|
||||
|
||||
def withComponent(name: String) = withComponent(name, _reachability)
|
||||
|
||||
def create() = if (FMLCommonHandler.instance.getEffectiveSide.isServer) new Connector with NodeVarargPart {
|
||||
def create() = if (SideTracker.isServer) new Connector with NodeVarargPart {
|
||||
val host = _host
|
||||
val reachability = _reachability
|
||||
var localBufferSize = _bufferSize
|
||||
@ -539,7 +538,7 @@ object Network extends api.detail.NetworkAPI {
|
||||
}
|
||||
|
||||
class ComponentConnectorBuilder(val _host: Environment, val _reachability: Visibility, val _name: String, val _visibility: Visibility, val _bufferSize: Double) extends api.detail.Builder.ComponentConnectorBuilder {
|
||||
def create() = if (FMLCommonHandler.instance.getEffectiveSide.isServer) new ComponentConnector with NodeVarargPart {
|
||||
def create() = if (SideTracker.isServer) new ComponentConnector with NodeVarargPart {
|
||||
val host = _host
|
||||
val reachability = _reachability
|
||||
val name = _name
|
||||
|
Loading…
x
Reference in New Issue
Block a user