Added basic components items
This commit is contained in:
parent
0fddcd5989
commit
4d314006c7
8 changed files with 113 additions and 107 deletions
|
@ -22,6 +22,31 @@ object CoreContent extends ContentHolder
|
||||||
/**
|
/**
|
||||||
* Blocks
|
* Blocks
|
||||||
*/
|
*/
|
||||||
|
var blockOreCopper: Block = null
|
||||||
|
var blockOreTin: Block = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Items
|
||||||
|
*/
|
||||||
|
var itemMotor: Item = null
|
||||||
|
var itemCircuitBasic: Item = null
|
||||||
|
var itemCircuitAdvanced: Item = null
|
||||||
|
var itemCircuitElite: Item = null
|
||||||
|
var itemPlateCopper: Item = null
|
||||||
|
var itemPlateTin: Item = null
|
||||||
|
var itemPlateBronze: Item = null
|
||||||
|
var itemPlateSteel: Item = null
|
||||||
|
var itemPlateIron: Item = null
|
||||||
|
var itemPlateGold: Item = null
|
||||||
|
var itemIngotCopper: Item = null
|
||||||
|
var itemIngotTin: Item = null
|
||||||
|
var itemIngotSteel: Item = null
|
||||||
|
var itemIngotBronze: Item = null
|
||||||
|
var itemDustSteel: Item = null
|
||||||
|
var itemDustBronze: Item = null
|
||||||
|
var generationOreCopper: Nothing = null
|
||||||
|
var generationOreTin: Nothing = null
|
||||||
|
|
||||||
val decoration: Block = new BlockIndustrialStone()
|
val decoration: Block = new BlockIndustrialStone()
|
||||||
@ExplicitContentName("dust")
|
@ExplicitContentName("dust")
|
||||||
val blockDust: Block = new TileDust().setCreativeTab(null)
|
val blockDust: Block = new TileDust().setCreativeTab(null)
|
||||||
|
|
|
@ -52,6 +52,7 @@ object Settings
|
||||||
@Config(comment = "Put a list of block/item IDs to be used by the Quantum Assembler. Separate by commas, no space.")
|
@Config(comment = "Put a list of block/item IDs to be used by the Quantum Assembler. Separate by commas, no space.")
|
||||||
var quantumAssemblerRecipes: Array[Int] = new Array[Int](0)
|
var quantumAssemblerRecipes: Array[Int] = new Array[Int](0)
|
||||||
@Config var darkMatterSpawnChance: Double = 0.2
|
@Config var darkMatterSpawnChance: Double = 0.2
|
||||||
|
@Config var steamMultiplier: Double = 1
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
def configEvent(evt: PostConfigEvent)
|
def configEvent(evt: PostConfigEvent)
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
package resonantinduction.core.grid;
|
|
||||||
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import codechicken.multipart.PartMap;
|
|
||||||
import codechicken.multipart.TMultiPart;
|
|
||||||
import codechicken.multipart.TileMultipart;
|
|
||||||
import universalelectricity.api.core.grid.INode;
|
|
||||||
import universalelectricity.api.core.grid.INodeProvider;
|
|
||||||
|
|
||||||
public class TraitNodeProvider extends TileMultipart implements INodeProvider
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public <N extends INode> N getNode(Class<N> nodeType, ForgeDirection from)
|
|
||||||
{
|
|
||||||
TMultiPart part = this.partMap(from.ordinal());
|
|
||||||
|
|
||||||
if (part == null)
|
|
||||||
{
|
|
||||||
part = partMap(PartMap.CENTER.ordinal());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (part instanceof INodeProvider)
|
|
||||||
{
|
|
||||||
return ((INodeProvider) part).getNode(nodeType, from);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package resonantinduction.core.grid
|
||||||
|
|
||||||
|
import codechicken.multipart.{PartMap, TileMultipart}
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection
|
||||||
|
import universalelectricity.api.core.grid.INodeProvider
|
||||||
|
|
||||||
|
trait TraitNodeProvider extends TileMultipart with INodeProvider
|
||||||
|
{
|
||||||
|
def getNode[N](nodeType: Class[N], from: ForgeDirection): N =
|
||||||
|
{
|
||||||
|
var part = partMap(from.ordinal)
|
||||||
|
|
||||||
|
if (part == null)
|
||||||
|
{
|
||||||
|
part = partMap(PartMap.CENTER.ordinal)
|
||||||
|
}
|
||||||
|
if (part.isInstanceOf[INodeProvider])
|
||||||
|
{
|
||||||
|
return (part.asInstanceOf[INodeProvider]).getNode(nodeType, from)
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,7 @@ class TankNode(parent: INodeProvider) extends MultipartNode[TankNode](parent) wi
|
||||||
var maxPressure: Int = 100
|
var maxPressure: Int = 100
|
||||||
private var pressure: Int = 0
|
private var pressure: Int = 0
|
||||||
|
|
||||||
var onChange: () => () = _
|
var onChange: () => Unit = null
|
||||||
|
|
||||||
def getMaxFlowRate: Int =
|
def getMaxFlowRate: Int =
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
public class ItemOreResource extends Item
|
public class ItemOreResource extends Item
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
private Block block = ResonantInduction.blockRefinedDust;
|
private Block block = ResonantInduction.blockRefinedDust;
|
||||||
|
|
||||||
public ItemOreResource()
|
public ItemOreResource()
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
package resonantinduction.core.resource;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.network.packet.Packet;
|
|
||||||
import resonant.lib.content.module.TileBase;
|
|
||||||
import resonant.lib.network.IPacketReceiver;
|
|
||||||
import resonantinduction.core.ResonantInduction;
|
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A tile that stores the material name.
|
|
||||||
*
|
|
||||||
* @author Calclavia
|
|
||||||
*/
|
|
||||||
public abstract class TileMaterial extends TileBase implements IPacketReceiver
|
|
||||||
{
|
|
||||||
public String name;
|
|
||||||
|
|
||||||
public TileMaterial()
|
|
||||||
{
|
|
||||||
super(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TileMaterial(Material material)
|
|
||||||
{
|
|
||||||
super(material);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getColor()
|
|
||||||
{
|
|
||||||
return ResourceGenerator.getColor(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canUpdate()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceivePacket(ByteArrayDataInput data, EntityPlayer player, Object... extra)
|
|
||||||
{
|
|
||||||
name = data.readUTF();
|
|
||||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Packet getDescriptionPacket()
|
|
||||||
{
|
|
||||||
if (name != null)
|
|
||||||
{
|
|
||||||
return ResonantInduction.PACKET_TILE.getPacket(this, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
|
||||||
{
|
|
||||||
super.readFromNBT(nbt);
|
|
||||||
name = nbt.getString("name");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToNBT(NBTTagCompound nbt)
|
|
||||||
{
|
|
||||||
super.writeToNBT(nbt);
|
|
||||||
if (name != null)
|
|
||||||
{
|
|
||||||
nbt.setString("name", name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package resonantinduction.core.resource
|
||||||
|
|
||||||
|
import com.google.common.io.ByteArrayDataInput
|
||||||
|
import net.minecraft.block.material.Material
|
||||||
|
import net.minecraft.entity.player.EntityPlayer
|
||||||
|
import net.minecraft.nbt.NBTTagCompound
|
||||||
|
import net.minecraft.network.Packet
|
||||||
|
import resonant.content.spatial.block.SpatialTile
|
||||||
|
import resonant.lib.network.handle.TPacketReceiver
|
||||||
|
import resonantinduction.core.ResonantInduction
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A tile that stores the material name.
|
||||||
|
*
|
||||||
|
* @author Calclavia
|
||||||
|
*/
|
||||||
|
abstract class TileMaterial(mateiral: Material) extends SpatialTile(material) with TPacketReceiver
|
||||||
|
{
|
||||||
|
var name: String = null
|
||||||
|
|
||||||
|
def getColor: Int =
|
||||||
|
{
|
||||||
|
return ResourceGenerator.getColor(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
override def canUpdate: Boolean =
|
||||||
|
{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
def onReceivePacket(data: ByteArrayDataInput, player: EntityPlayer, extra: AnyRef*)
|
||||||
|
{
|
||||||
|
name = data.readUTF
|
||||||
|
markRender
|
||||||
|
}
|
||||||
|
|
||||||
|
override def getDescriptionPacket: Packet =
|
||||||
|
{
|
||||||
|
if (name != null)
|
||||||
|
{
|
||||||
|
return ResonantInduction.packetHandler.toMCPacket(this, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
override def readFromNBT(nbt: NBTTagCompound)
|
||||||
|
{
|
||||||
|
super.readFromNBT(nbt)
|
||||||
|
name = nbt.getString("name")
|
||||||
|
}
|
||||||
|
|
||||||
|
override def writeToNBT(nbt: NBTTagCompound)
|
||||||
|
{
|
||||||
|
super.writeToNBT(nbt)
|
||||||
|
if (name != null)
|
||||||
|
{
|
||||||
|
nbt.setString("name", name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue