mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-25 14:05:39 -04:00
Re-added FMP support.
This commit is contained in:
parent
53ebd463d7
commit
fec5c25ebf
@ -1,6 +1,6 @@
|
||||
minecraft.version=1.7.2
|
||||
forge.version=10.12.1.1061
|
||||
oc.version=1.2.10
|
||||
ccl.version=1.0.0.62
|
||||
fmp.version=1.0.0.250
|
||||
ccl.version=1.1.1.80
|
||||
fmp.version=1.1.0.282
|
||||
maven.url=file:///var/www/users/fnuecke/maven.cil.li
|
@ -1,17 +1,7 @@
|
||||
/* FMP
|
||||
compileScala {
|
||||
repositories {
|
||||
ivy {
|
||||
name "forge-ext"
|
||||
artifactPattern "http://files.minecraftforge.net/[module]/[module]-dev-[revision].[ext]"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
compile name: 'CodeChickenLib', version: "${config.minecraft.version}-${config.ccl.version}", ext: 'jar'
|
||||
compile name: 'ForgeMultipart', version: "${config.minecraft.version}-${config.fmp.version}", ext: 'jar'
|
||||
}
|
||||
dependencies {
|
||||
compile "codechicken:CodeChickenLib:${config.minecraft.version}-${config.ccl.version}:dev"
|
||||
compile "codechicken:ForgeMultipart:${config.minecraft.version}-${config.fmp.version}:dev"
|
||||
}
|
||||
*/
|
||||
|
||||
minecraft {
|
||||
version = "${config.minecraft.version}-${config.forge.version}"
|
||||
|
@ -1,5 +1,6 @@
|
||||
package li.cil.oc.common
|
||||
|
||||
import codechicken.multipart.TMultiPart
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent._
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent
|
||||
@ -29,13 +30,11 @@ object EventHandler {
|
||||
pending += (() => Network.joinOrCreateNetwork(tileEntity))
|
||||
}
|
||||
|
||||
/* TODO FMP
|
||||
@Optional.Method(modid = "ForgeMultipart")
|
||||
def schedule(part: TMultiPart) =
|
||||
if (FMLCommonHandler.instance.getEffectiveSide.isServer) pendingAdds.synchronized {
|
||||
pendingAdds += (() => Network.joinOrCreateNetwork(part.tile))
|
||||
if (FMLCommonHandler.instance.getEffectiveSide.isServer) pending.synchronized {
|
||||
pending += (() => Network.joinOrCreateNetwork(part.tile))
|
||||
}
|
||||
*/
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
def scheduleIC2Add(tileEntity: power.IndustrialCraft2) = pending.synchronized {
|
||||
|
@ -7,6 +7,7 @@ import java.util.concurrent.Callable
|
||||
import li.cil.oc._
|
||||
import li.cil.oc.api.FileSystem
|
||||
import li.cil.oc.common.asm.SimpleComponentTickHandler
|
||||
import li.cil.oc.common.multipart.MultiPart
|
||||
import li.cil.oc.server
|
||||
import li.cil.oc.server.component.machine
|
||||
import li.cil.oc.server.component.machine.{LuaJLuaArchitecture, NativeLuaArchitecture}
|
||||
@ -23,11 +24,9 @@ class Proxy {
|
||||
Blocks.init()
|
||||
Items.init()
|
||||
|
||||
/* TODO FMP
|
||||
if (Mods.ForgeMultipart.isAvailable) {
|
||||
MultiPart.init()
|
||||
}
|
||||
*/
|
||||
if (Mods.ComputerCraft.isAvailable) {
|
||||
ComputerCraft.init()
|
||||
}
|
||||
|
@ -1,8 +1,11 @@
|
||||
package li.cil.oc.common.block
|
||||
|
||||
import codechicken.multipart.{TileMultipart, JNormalOcclusion, NormalOcclusionTest, TFacePart}
|
||||
import codechicken.lib.vec.Cuboid6
|
||||
import cpw.mods.fml.relauncher.{SideOnly, Side}
|
||||
import java.util
|
||||
import li.cil.oc.api.network.{SidedEnvironment, Environment}
|
||||
import li.cil.oc.common.multipart.CablePart
|
||||
import li.cil.oc.common.tileentity
|
||||
import li.cil.oc.Settings
|
||||
import li.cil.oc.util.mods.Mods
|
||||
@ -120,15 +123,12 @@ object Cable {
|
||||
|
||||
private def hasMultiPartNode(tileEntity: TileEntity) =
|
||||
tileEntity match {
|
||||
/* TODO FMP
|
||||
case host: TileMultipart => host.partList.exists(_.isInstanceOf[CablePart])
|
||||
*/
|
||||
case _ => false
|
||||
}
|
||||
|
||||
private def canConnectFromSide(tileEntity: TileEntity, side: ForgeDirection) =
|
||||
tileEntity match {
|
||||
/* TODO FMP
|
||||
case host: TileMultipart =>
|
||||
host.partList.forall {
|
||||
case part: JNormalOcclusion if !part.isInstanceOf[CablePart] =>
|
||||
@ -139,7 +139,6 @@ object Cable {
|
||||
case part: TFacePart => !part.solid(side.ordinal) || (part.getSlotMask & codechicken.multipart.PartMap.face(side.ordinal).mask) == 0
|
||||
case _ => true
|
||||
}
|
||||
*/
|
||||
case _ => true
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,13 @@
|
||||
package li.cil.oc.common.multipart
|
||||
|
||||
/* TODO FMP
|
||||
import codechicken.lib.vec.{Vector3, Cuboid6}
|
||||
import codechicken.multipart._
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.api.network
|
||||
import li.cil.oc.api.network.{Message, Node, Visibility}
|
||||
import li.cil.oc.client.renderer.tileentity.CableRenderer
|
||||
import li.cil.oc.common
|
||||
import li.cil.oc.common.block.Cable
|
||||
import li.cil.oc.server.TickHandler
|
||||
import li.cil.oc.util.ExtendedNBT._
|
||||
import li.cil.oc.{Blocks, Settings, api}
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
@ -44,7 +43,7 @@ class CablePart(val original: Option[Node] = None) extends DelegatePart with TCu
|
||||
|
||||
override def onWorldJoin() {
|
||||
super.onWorldJoin()
|
||||
TickHandler.schedule(this)
|
||||
common.EventHandler.schedule(this)
|
||||
}
|
||||
|
||||
override def onWorldSeparate() {
|
||||
@ -79,4 +78,3 @@ class CablePart(val original: Option[Node] = None) extends DelegatePart with TCu
|
||||
|
||||
override def onConnect(node: Node) {}
|
||||
}
|
||||
*/
|
||||
|
@ -1,6 +1,5 @@
|
||||
package li.cil.oc.common.multipart
|
||||
|
||||
/* TODO FMP
|
||||
import codechicken.multipart.{TIconHitEffects, TMultiPart}
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.common.block.Delegate
|
||||
@ -20,5 +19,4 @@ abstract class DelegatePart extends TMultiPart with TIconHitEffects {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
override def getBrokenIcon(side: Int) = delegate.icon(ForgeDirection.getOrientation(side)).orNull
|
||||
}
|
||||
*/
|
||||
}
|
@ -1,24 +1,23 @@
|
||||
package li.cil.oc.common.multipart
|
||||
|
||||
/* TODO FMP
|
||||
import codechicken.lib.packet.PacketCustom
|
||||
import codechicken.lib.raytracer.RayTracer
|
||||
import codechicken.lib.vec.{Vector3, BlockCoord}
|
||||
import codechicken.multipart.TileMultipart
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent
|
||||
import li.cil.oc.Blocks
|
||||
import li.cil.oc.client.PacketSender
|
||||
import li.cil.oc.common.block.Delegator
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.network.packet.Packet15Place
|
||||
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement
|
||||
import net.minecraft.util.MovingObjectPosition
|
||||
import net.minecraftforge.common.MinecraftForge
|
||||
import net.minecraftforge.event.ForgeSubscribe
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action
|
||||
import net.minecraftforge.event.entity.player.{PlayerDestroyItemEvent, PlayerInteractEvent}
|
||||
|
||||
object EventHandler {
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
def playerInteract(event: PlayerInteractEvent) {
|
||||
val player = event.entityPlayer
|
||||
if (event.action == Action.RIGHT_CLICK_BLOCK && player.getEntityWorld.isRemote) {
|
||||
@ -43,10 +42,10 @@ object EventHandler {
|
||||
if (world.isRemote && !player.isSneaking) {
|
||||
// Attempt to use block activated like normal and tell the server the right stuff
|
||||
val f = new Vector3(hit.hitVec).add(-hit.blockX, -hit.blockY, -hit.blockZ)
|
||||
val block = Block.blocksList(world.getBlockId(hit.blockX, hit.blockY, hit.blockZ))
|
||||
val block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ)
|
||||
if (block != null && block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, hit.sideHit, f.x.toFloat, f.y.toFloat, f.z.toFloat)) {
|
||||
player.swingItem()
|
||||
PacketCustom.sendToServer(new Packet15Place(
|
||||
PacketCustom.sendToServer(new C08PacketPlayerBlockPlacement(
|
||||
hit.blockX, hit.blockY, hit.blockZ, hit.sideHit,
|
||||
player.inventory.getCurrentItem,
|
||||
f.x.toFloat, f.y.toFloat, f.z.toFloat))
|
||||
@ -76,7 +75,7 @@ object EventHandler {
|
||||
else {
|
||||
TileMultipart.addPart(world, pos, part)
|
||||
world.playSoundEffect(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5,
|
||||
part.delegate.parent.stepSound.getPlaceSound,
|
||||
part.delegate.parent.stepSound.func_150496_b,
|
||||
(part.delegate.parent.stepSound.getVolume + 1.0F) / 2.0F,
|
||||
part.delegate.parent.stepSound.getPitch * 0.8F)
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
@ -90,5 +89,4 @@ object EventHandler {
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package li.cil.oc.common.multipart
|
||||
|
||||
/* TODO FMP
|
||||
import codechicken.lib.vec.BlockCoord
|
||||
import codechicken.multipart.MultiPartRegistry.{IPartConverter, IPartFactory}
|
||||
import codechicken.multipart.{TMultiPart, MultiPartRegistry}
|
||||
@ -8,6 +7,7 @@ import li.cil.oc.common.tileentity.Cable
|
||||
import li.cil.oc.{Settings, Blocks}
|
||||
import net.minecraft.world.World
|
||||
import net.minecraftforge.common.MinecraftForge
|
||||
import java.util
|
||||
|
||||
object MultiPart extends IPartFactory with IPartConverter {
|
||||
def init() {
|
||||
@ -22,15 +22,12 @@ object MultiPart extends IPartFactory with IPartConverter {
|
||||
null
|
||||
}
|
||||
|
||||
override def canConvert(blockID: Int): Boolean = {
|
||||
blockID == Blocks.cable.parent.blockID
|
||||
}
|
||||
override def blockTypes = util.Arrays.asList(Blocks.cable.parent)
|
||||
|
||||
override def convert(world: World, pos: BlockCoord) = {
|
||||
world.getBlockTileEntity(pos.x, pos.y, pos.z) match {
|
||||
world.getTileEntity(pos.x, pos.y, pos.z) match {
|
||||
case cable: Cable => new CablePart(Some(cable.node))
|
||||
case _ => null
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -4,6 +4,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent
|
||||
import li.cil.oc.api.machine.Machine
|
||||
import li.cil.oc.common.PacketType
|
||||
import li.cil.oc.common.multipart.EventHandler
|
||||
import li.cil.oc.common.tileentity._
|
||||
import li.cil.oc.common.tileentity.traits.{Computer, TextBuffer, TileEntity}
|
||||
import li.cil.oc.common.{PacketHandler => CommonPacketHandler}
|
||||
@ -170,9 +171,7 @@ object PacketHandler extends CommonPacketHandler {
|
||||
|
||||
def onMultiPartPlace(p: PacketParser) {
|
||||
p.player match {
|
||||
/* TODO FMP
|
||||
case player: EntityPlayerMP => EventHandler.place(player)
|
||||
*/
|
||||
case _ => // Invalid packet.
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
package li.cil.oc.server.network
|
||||
|
||||
import codechicken.lib.vec.Cuboid6
|
||||
import codechicken.multipart.{TileMultipart, JNormalOcclusion, NormalOcclusionTest, TFacePart}
|
||||
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, WirelessEndpoint, SidedEnvironment, Environment, Visibility}
|
||||
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.mods.Mods
|
||||
@ -402,18 +406,15 @@ object Network extends api.detail.NetworkAPI {
|
||||
|
||||
private def getMultiPartNode(tileEntity: TileEntity) =
|
||||
tileEntity match {
|
||||
/* TODO FMP
|
||||
case host: TileMultipart => host.partList.find(_.isInstanceOf[CablePart]) match {
|
||||
case Some(part: CablePart) => Some(part.node)
|
||||
case _ => None
|
||||
}
|
||||
*/
|
||||
case _ => None
|
||||
}
|
||||
|
||||
private def canConnectFromSide(tileEntity: TileEntity, side: ForgeDirection) =
|
||||
tileEntity match {
|
||||
/* TODO FMP
|
||||
case host: TileMultipart =>
|
||||
host.partList.forall {
|
||||
case part: JNormalOcclusion if !part.isInstanceOf[CablePart] =>
|
||||
@ -424,7 +425,6 @@ object Network extends api.detail.NetworkAPI {
|
||||
case part: TFacePart => !part.solid(side.ordinal) || (part.getSlotMask & codechicken.multipart.PartMap.face(side.ordinal).mask) == 0
|
||||
case _ => true
|
||||
}
|
||||
*/
|
||||
case _ => true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user