mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 18:55:03 -04:00
changed cutting wire recipe; hiding and disabling iron nugget if gregtech is available; no longer give xp when making circuit boards;
This commit is contained in:
parent
9a8da535e2
commit
b0e8e40317
@ -7,16 +7,6 @@ import net.minecraft.item.{Item, ItemStack}
|
|||||||
|
|
||||||
object CraftingHandler extends ICraftingHandler {
|
object CraftingHandler extends ICraftingHandler {
|
||||||
override def onCrafting(player: EntityPlayer, craftedStack: ItemStack, inventory: IInventory) = {
|
override def onCrafting(player: EntityPlayer, craftedStack: ItemStack, inventory: IInventory) = {
|
||||||
if (craftedStack.isItemEqual(Items.cuttingWire.createItemStack())) {
|
|
||||||
for (i <- 0 to inventory.getSizeInventory) {
|
|
||||||
val stack = inventory.getStackInSlot(i)
|
|
||||||
if (stack != null && stack.getItem == Item.shears) {
|
|
||||||
stack.damageItem(10, player)
|
|
||||||
stack.stackSize = stack.stackSize + 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (craftedStack.isItemEqual(Items.acid.createItemStack())) {
|
if (craftedStack.isItemEqual(Items.acid.createItemStack())) {
|
||||||
for (i <- 0 to inventory.getSizeInventory) {
|
for (i <- 0 to inventory.getSizeInventory) {
|
||||||
val stack = inventory.getStackInSlot(i)
|
val stack = inventory.getStackInSlot(i)
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
package li.cil.oc
|
package li.cil.oc
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Loader
|
||||||
import cpw.mods.fml.common.registry.GameRegistry
|
import cpw.mods.fml.common.registry.GameRegistry
|
||||||
import net.minecraft.block.Block
|
import net.minecraft.block.Block
|
||||||
import net.minecraft.item.crafting.FurnaceRecipes
|
import net.minecraft.item.crafting.FurnaceRecipes
|
||||||
import net.minecraft.item.{Item, ItemStack}
|
import net.minecraft.item.{Item, ItemStack}
|
||||||
import net.minecraftforge.oredict.{ShapelessOreRecipe, ShapedOreRecipe, OreDictionary}
|
import net.minecraftforge.oredict.{ShapelessOreRecipe, ShapedOreRecipe}
|
||||||
|
|
||||||
object Recipes {
|
object Recipes {
|
||||||
def init() {
|
def init() {
|
||||||
@ -70,10 +71,11 @@ object Recipes {
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(Items.ironNugget.createItemStack(9), ironIngot))
|
if (!Loader.isModLoaded("gregtech_addon")) {
|
||||||
GameRegistry.addShapelessRecipe(Items.cuttingWire.createItemStack(1), new ItemStack(Item.shears, 1, OreDictionary.WILDCARD_VALUE), Items.ironNugget.createItemStack(), stick)
|
GameRegistry.addRecipe(new ShapelessOreRecipe(Items.ironNugget.createItemStack(9), ironIngot))
|
||||||
|
}
|
||||||
GameRegistry.addShapelessRecipe(rawBoard, Items.cuttingWire.createItemStack(), new ItemStack(Block.blockClay), cactusGreen)
|
GameRegistry.addShapelessRecipe(rawBoard, Items.cuttingWire.createItemStack(), new ItemStack(Block.blockClay), cactusGreen)
|
||||||
FurnaceRecipes.smelting().addSmelting(rawBoard.itemID, rawBoard.getItemDamage, board, 1)
|
FurnaceRecipes.smelting().addSmelting(rawBoard.itemID, rawBoard.getItemDamage, board, 0)
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(acid, Item.bucketWater, sugar, roseRed, slimeBall, spiderEye, boneMeal))
|
GameRegistry.addRecipe(new ShapelessOreRecipe(acid, Item.bucketWater, sugar, roseRed, slimeBall, spiderEye, boneMeal))
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(pcb, acid, Item.goldNugget, board))
|
GameRegistry.addRecipe(new ShapelessOreRecipe(pcb, acid, Item.goldNugget, board))
|
||||||
|
|
||||||
@ -338,6 +340,11 @@ object Recipes {
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
addRecipe(Items.cuttingWire.createItemStack(),
|
||||||
|
"sis",
|
||||||
|
's', stick,
|
||||||
|
'i', "nuggetIron")
|
||||||
|
|
||||||
addRecipe(Items.analyzer.createItemStack(),
|
addRecipe(Items.analyzer.createItemStack(),
|
||||||
" r ",
|
" r ",
|
||||||
"tcg",
|
"tcg",
|
||||||
|
@ -13,6 +13,8 @@ trait Delegate {
|
|||||||
|
|
||||||
val unlocalizedName: String
|
val unlocalizedName: String
|
||||||
|
|
||||||
|
val showInItemList = true
|
||||||
|
|
||||||
val itemId = parent.add(this)
|
val itemId = parent.add(this)
|
||||||
|
|
||||||
private var _icon: Option[Icon] = None
|
private var _icon: Option[Icon] = None
|
||||||
|
@ -48,7 +48,7 @@ class Delegator(id: Int) extends Item(id) {
|
|||||||
override def getSubItems(itemId: Int, tab: CreativeTabs, list: util.List[_]) {
|
override def getSubItems(itemId: Int, tab: CreativeTabs, list: util.List[_]) {
|
||||||
// Workaround for MC's untyped lists...
|
// Workaround for MC's untyped lists...
|
||||||
def add[T](list: util.List[T], value: Any) = list.add(value.asInstanceOf[T])
|
def add[T](list: util.List[T], value: Any) = list.add(value.asInstanceOf[T])
|
||||||
(0 until subItems.length).
|
(0 until subItems.length).filter(id => subItems(id).showInItemList).
|
||||||
foreach(id => add(list, new ItemStack(this, 1, id)))
|
foreach(id => add(list, new ItemStack(this, 1, id)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package li.cil.oc.common.item
|
package li.cil.oc.common.item
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Loader
|
||||||
import li.cil.oc.Settings
|
import li.cil.oc.Settings
|
||||||
import net.minecraft.client.renderer.texture.IconRegister
|
import net.minecraft.client.renderer.texture.IconRegister
|
||||||
|
|
||||||
class IronNugget(val parent: Delegator) extends Delegate {
|
class IronNugget(val parent: Delegator) extends Delegate {
|
||||||
val unlocalizedName = "IronNugget"
|
val unlocalizedName = "IronNugget"
|
||||||
|
|
||||||
|
override val showInItemList = !Loader.isModLoaded("gregtech_addon")
|
||||||
|
|
||||||
override def registerIcons(iconRegister: IconRegister) = {
|
override def registerIcons(iconRegister: IconRegister) = {
|
||||||
super.registerIcons(iconRegister)
|
super.registerIcons(iconRegister)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user