Removed Electromagnetic Coherence guide book

This commit is contained in:
Calclavia 2014-10-12 17:04:54 +08:00
parent 9ae4d224c6
commit 1d87c44b8b
9 changed files with 54 additions and 73 deletions

View file

@ -37,7 +37,7 @@ import resonantinduction.electrical.laser.receiver.{RenderLaserReceiver, TileLas
import resonantinduction.electrical.multimeter.{GuiMultimeter, PartMultimeter, RenderMultimeter}
import resonantinduction.electrical.tesla.{RenderTesla, TileTesla}
import resonantinduction.electrical.transformer.RenderTransformer
import resonantinduction.mechanical.MechContent
import resonantinduction.mechanical.MechanicalContent
import resonantinduction.mechanical.fluid.pipe.RenderPipe
import resonantinduction.mechanical.fluid.transport.{RenderPump, TilePump}
import resonantinduction.mechanical.mech.gear.RenderGear
@ -59,11 +59,11 @@ import universalelectricity.core.transform.vector.Vector3
override def init()
{
//Mech content TODO no-load if mech content is not loaded
ItemRenderHandler.register(MechContent.itemGear, RenderGear.INSTANCE)
ItemRenderHandler.register(MechContent.itemGearShaft, RenderGearShaft.INSTANCE)
ItemRenderHandler.register(MechContent.itemPipe, RenderPipe)
ItemRenderHandler.register(Item.getItemFromBlock(MechContent.blockWaterTurbine), new RenderWaterTurbine)
ItemRenderHandler.register(Item.getItemFromBlock(MechContent.blockWindTurbine), new RenderWindTurbine)
ItemRenderHandler.register(MechanicalContent.itemGear, RenderGear.INSTANCE)
ItemRenderHandler.register(MechanicalContent.itemGearShaft, RenderGearShaft.INSTANCE)
ItemRenderHandler.register(MechanicalContent.itemPipe, RenderPipe)
ItemRenderHandler.register(Item.getItemFromBlock(MechanicalContent.blockWaterTurbine), new RenderWaterTurbine)
ItemRenderHandler.register(Item.getItemFromBlock(MechanicalContent.blockWindTurbine), new RenderWindTurbine)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileMechanicalPiston], new RenderMechanicalPiston)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileGrindingWheel], new RenderGrindingWheel)
ClientRegistry.bindTileEntitySpecialRenderer(classOf[TileMixer], new RenderMixer)

View file

@ -15,7 +15,7 @@ import resonantinduction.archaic.ArchaicContent
import resonantinduction.atomic.AtomicContent
import resonantinduction.core.handler.TextureHookHandler
import resonantinduction.electrical.ElectricalContent
import resonantinduction.mechanical.MechContent
import resonantinduction.mechanical.MechanicalContent
import scala.collection.convert.wrapAll._
@ -49,11 +49,11 @@ final object ResonantInduction
loadables.applyModule(proxy)
loadables.applyModule(packetHandler)
loadables.applyModule(AtomicContent)
loadables.applyModule(ArchaicContent)
loadables.applyModule(CoreContent)
loadables.applyModule(ArchaicContent)
loadables.applyModule(ElectricalContent)
loadables.applyModule(MechContent)
loadables.applyModule(MechanicalContent)
loadables.applyModule(AtomicContent)
loadables.preInit()

View file

@ -32,9 +32,6 @@ import resonantinduction.electrical.wire.base.WireMaterial
import resonantinduction.electrical.wire.flat.{PartFlatWire, RenderFlatWire}
import resonantinduction.electrical.wire.framed.{PartFramedWire, RenderFramedWire}
/**
* Created by robert on 8/11/2014.
*/
object ElectricalContent extends ContentHolder
{
val particleTextures = new ResourceLocation("textures/particle/particles.png")
@ -62,8 +59,6 @@ object ElectricalContent extends ContentHolder
var tierTwoBattery: ItemStack = null
var tierThreeBattery: ItemStack = null
var guideBook: ItemStack = createGuide
override def preInit()
{
super.preInit
@ -170,30 +165,6 @@ object ElectricalContent extends ContentHolder
return new ItemStack(itemWire, count, t.ordinal())
}
def createGuide: ItemStack =
{
val guideBook = new ItemStack(Items.written_book)
val bookNBT = new NBTTagCompound()
bookNBT.setString("title", "Electromagnetic Coherence Guide")
bookNBT.setString("author", "Calclavia")
val pages = new NBTTagList()
pages.appendTag(new NBTTagString(EnumChatFormatting.RED + "Guidebook:\n\n" + EnumChatFormatting.BLACK + "Electromagnetic Coherence is a mod all about lasers.\n\nYou can find all the blocks in the mod's creative tab."))
pages.appendTag(new NBTTagString("A laser can be focused through a " + EnumChatFormatting.RED + "laser emitter" + EnumChatFormatting.BLACK + ". By default, the color of the laser is white. The color can be changed by placing stained glass in front of it. Different combinations of glass would result in mixed colors."))
pages.appendTag(new NBTTagString("To create a laser beam, provide a redstone pulse to the laser emitter. The intensity of the redstone would determine the intensity of the laser. Lasers with high intensities can burn and melt through blocks, hurting entities."))
pages.appendTag(new NBTTagString("A laser beam can also be reflected using a " + EnumChatFormatting.RED + "mirror" + EnumChatFormatting.BLACK + " with reduced intensity. Mirrors can be rotated by right clicking on it. Shift-right clicking a mirror focuses it to a side. Mirrors can also be auto-rotated with a redstone signal based on the direction of the signal propagation."))
pages.appendTag(new NBTTagString("A " + EnumChatFormatting.RED + "laser receiver" + EnumChatFormatting.BLACK + " outputs a redstone signal with a strength based on the laser incident on its front. Using this, laser trip-wires can be made as entities walking through a laser will block its path."))
pages.appendTag(new NBTTagString("The " + EnumChatFormatting.RED + "focusing matrix" + EnumChatFormatting.BLACK + " allows the player to focus mirrors and focus crystals. First, right click on a mirror/crystal to select it. Then, right click on a point to focus. Clicking the point twice will aim the laser at that point instead of making the device look at the point."))
pages.appendTag(new NBTTagString("The " + EnumChatFormatting.RED + "Focus Crystal" + EnumChatFormatting.BLACK + " allows you to focus multiple laser beams into a single one, adding their strength together. All beams aiming at the crystal will be sent in the direction the crystal is facing. Focus Crystals can be rotated the same way as mirrors can."))
pages.appendTag(new NBTTagString(EnumChatFormatting.RED + "Usages\n\n" + EnumChatFormatting.BLACK + "- Light Shows\n- Mining\n- Killing\n- Burning\n- Redstone Detection\n- Smelting (Aim strong laser at furnace)\n\nComing Soon:\n- Energy Transfer\n- Crafting"))
bookNBT.setTag("pages", pages)
guideBook.setTagCompound(bookNBT)
return guideBook
}
/**
* Handle wire texture
*/

View file

@ -15,11 +15,16 @@ import resonant.lib.network.netty.AbstractPacket
/** A modular battery box that allows shared connections with boxes next to it.
*
* @author Calclavia */
object TileBattery {
/** @param tier - 0, 1, 2
* @return*/
def getEnergyForTier(tier: Int): Long = {
* @author Calclavia
*/
object TileBattery
{
/**
* @param tier - 0, 1, 2
* @return
*/
def getEnergyForTier(tier: Int): Long =
{
return Math.round(Math.pow(500000000, (tier / (MAX_TIER + 0.7f)) + 1) / (500000000)) * (500000000)
}
@ -29,8 +34,8 @@ object TileBattery {
final val DEFAULT_WATTAGE: Long = getEnergyForTier(0)
}
class TileBattery extends TileElectric(Material.iron) with IPacketReceiver {
class TileBattery extends TileElectric(Material.iron) with IPacketReceiver
{
private var markClientUpdate: Boolean = false
private var markDistributionUpdate: Boolean = false
var renderEnergyAmount: Double = 0
@ -38,11 +43,11 @@ class TileBattery extends TileElectric(Material.iron) with IPacketReceiver {
//Constructor
setTextureName("material_metal_side")
this.ioMap_$eq(0.asInstanceOf[Short])
this.saveIOMap_$eq(true)
this.normalRender(false)
this.isOpaqueCube(false)
this.itemBlock(classOf[ItemBlockBattery])
ioMap = 0.toShort
saveIOMap = true
normalRender(false)
isOpaqueCube(false)
itemBlock(classOf[ItemBlockBattery])
override def update
{
@ -66,18 +71,22 @@ class TileBattery extends TileElectric(Material.iron) with IPacketReceiver {
return new PacketTile(this, Array[Any](renderEnergyAmount, ioMap))
}
def read(data: ByteBuf, player: EntityPlayer, `type`: PacketType) {
def read(data: ByteBuf, player: EntityPlayer, `type`: PacketType)
{
this.energy.setEnergy(data.readLong)
this.ioMap_$eq(data.readShort)
}
override def setIO(dir: ForgeDirection, `type`: Int) {
override def setIO(dir: ForgeDirection, `type`: Int)
{
super.setIO(dir, `type`)
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord)
}
override def onPlaced(entityliving: EntityLivingBase, itemStack: ItemStack) {
if (!world.isRemote && itemStack.getItem.isInstanceOf[ItemBlockBattery]) {
override def onPlaced(entityliving: EntityLivingBase, itemStack: ItemStack)
{
if (!world.isRemote && itemStack.getItem.isInstanceOf[ItemBlockBattery])
{
energy.setCapacity(TileBattery.getEnergyForTier(ItemBlockBattery.getTier(itemStack)))
energy.setEnergy((itemStack.getItem.asInstanceOf[ItemBlockBattery]).getEnergy(itemStack))
world.setBlockMetadataWithNotify(x, y, z, ItemBlockBattery.getTier(itemStack), 3)
@ -95,7 +104,8 @@ class TileBattery extends TileElectric(Material.iron) with IPacketReceiver {
return ret
}
override def toString: String = {
override def toString: String =
{
return "[TileBattery]" + x + "x " + y + "y " + z + "z "
}
}

View file

@ -27,7 +27,7 @@ import universalelectricity.api.core.grid.NodeRegistry
* The core contents of Resonant Induction
* @author Calclavia
*/
object MechContent extends ContentHolder
object MechanicalContent extends ContentHolder
{
//Constructor
manager.setTab(ResonantTab)
@ -68,13 +68,13 @@ object MechContent extends ContentHolder
blockTileBreaker = manager.newBlock(classOf[TileBreaker])
blockTilePlacer = manager.newBlock(classOf[TilePlacer])
TileCreativeBuilder.register(new SchematicPlate("schematic.waterTurbine.name", MechContent.blockWaterTurbine))
TileCreativeBuilder.register(new SchematicPlate("schematic.windTurbine.name", MechContent.blockWindTurbine))
TileCreativeBuilder.register(new SchematicPlate("schematic.electricTurbine.name", MechContent.blockElectricTurbine))
TileCreativeBuilder.register(new SchematicPlate("schematic.waterTurbine.name", MechanicalContent.blockWaterTurbine))
TileCreativeBuilder.register(new SchematicPlate("schematic.windTurbine.name", MechanicalContent.blockWindTurbine))
TileCreativeBuilder.register(new SchematicPlate("schematic.electricTurbine.name", MechanicalContent.blockElectricTurbine))
NodeRegistry.register(classOf[IMechanicalNode], classOf[MechanicalNode])
ResonantTab.itemStack(new ItemStack(MechContent.blockGrinderWheel))
ResonantTab.itemStack(new ItemStack(MechanicalContent.blockGrinderWheel))
PacketAnnotationManager.INSTANCE.register(classOf[TileWindTurbine])
PacketAnnotationManager.INSTANCE.register(classOf[TileWaterTurbine])

View file

@ -11,7 +11,7 @@ import net.minecraftforge.common.util.ForgeDirection
import net.minecraftforge.fluids._
import resonant.lib.`type`.EvictingList
import resonantinduction.core.prefab.part.connector.{PartFramedNode, TColorable, TMaterial}
import resonantinduction.mechanical.MechContent
import resonantinduction.mechanical.MechanicalContent
import resonantinduction.mechanical.fluid.pipe.PipeMaterials.PipeMaterial
/**
@ -137,7 +137,7 @@ class PartPipe extends PartFramedNode with TMaterial[PipeMaterial] with TColorab
RenderPipe.render(this, pos.x, pos.y, pos.z, frame)
}
def getItem: ItemStack = new ItemStack(MechContent.itemPipe, 1, getMaterialID)
def getItem: ItemStack = new ItemStack(MechanicalContent.itemPipe, 1, getMaterialID)
override def fill(from: ForgeDirection, resource: FluidStack, doFill: Boolean): Int =
{

View file

@ -21,7 +21,7 @@ import resonant.lib.network.discriminator.{PacketTile, PacketType}
import resonant.lib.network.handle.IPacketIDReceiver
import resonantinduction.archaic.blocks.TileFilterable
import resonantinduction.core.Reference
import resonantinduction.mechanical.MechContent
import resonantinduction.mechanical.MechanicalContent
class TileDetector extends TileFilterable with IPacketIDReceiver
{
@ -74,14 +74,14 @@ class TileDetector extends TileFilterable with IPacketIDReceiver
if (powerCheck != this.powering)
{
this.powering = powerCheck
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, MechContent.blockDetector)
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, MechContent.blockDetector)
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, MechanicalContent.blockDetector)
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, MechanicalContent.blockDetector)
for (x <- (this.xCoord - 1) to (this.xCoord + 1))
{
for (z <- (this.zCoord - 1) to (this.zCoord + 1))
{
this.worldObj.notifyBlocksOfNeighborChange(x, this.yCoord + 1, z, MechContent.blockDetector)
this.worldObj.notifyBlocksOfNeighborChange(x, this.yCoord + 1, z, MechanicalContent.blockDetector)
}
}
ResonantEngine.instance.packetHandler.sendToAllAround(new PacketTile(x, y, z, Array[Any](0, this.isInverted)), this)
@ -91,8 +91,8 @@ class TileDetector extends TileFilterable with IPacketIDReceiver
override def invalidate
{
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, MechContent.blockDetector)
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, MechContent.blockDetector)
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, MechanicalContent.blockDetector)
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, MechanicalContent.blockDetector)
super.invalidate
}

View file

@ -15,7 +15,7 @@ import net.minecraftforge.common.util.ForgeDirection
import resonant.lib.multiblock.reference.IMultiBlockStructure
import resonant.lib.utility.WrenchUtility
import resonantinduction.core.Reference
import resonantinduction.mechanical.MechContent
import resonantinduction.mechanical.MechanicalContent
import resonantinduction.mechanical.mech.PartMechanical
import universalelectricity.api.core.grid.INode
import universalelectricity.core.transform.vector.VectorWorld
@ -134,7 +134,7 @@ class PartGear extends PartMechanical with IMultiBlockStructure[PartGear]
protected def getItem: ItemStack =
{
return new ItemStack(MechContent.itemGear, 1, tier)
return new ItemStack(MechanicalContent.itemGear, 1, tier)
}
@SideOnly(Side.CLIENT) override def renderDynamic(pos: Vector3, frame: Float, pass: Int)

View file

@ -3,7 +3,7 @@ package resonantinduction.mechanical.mech.gearshaft
import java.util.Collection
import java.util.HashSet
import java.util.Set
import resonantinduction.mechanical.MechContent
import resonantinduction.mechanical.MechanicalContent
import resonantinduction.mechanical.mech.PartMechanical
import net.minecraft.item.ItemStack
import net.minecraftforge.common.util.ForgeDirection
@ -47,7 +47,7 @@ class PartGearShaft extends PartMechanical
protected def getItem: ItemStack =
{
return new ItemStack(MechContent.itemGearShaft, 1, tier)
return new ItemStack(MechanicalContent.itemGearShaft, 1, tier)
}
@SideOnly(Side.CLIENT) override def renderDynamic(pos: Vector3, frame: Float, pass: Int)