From c9e441caba3336ca173b2cbe63105bdd03e4c2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Fri, 11 Jul 2014 16:20:58 +0200 Subject: [PATCH] By popular demand, floppy disks can now be dyed by crafting them together with the according dye. Closes #388. --- .../textures/items/disk_floppy.png | Bin 467 -> 0 bytes .../textures/items/floppy_black.png | Bin 0 -> 413 bytes .../textures/items/floppy_blue.png | Bin 0 -> 457 bytes .../textures/items/floppy_brown.png | Bin 0 -> 407 bytes .../textures/items/floppy_cyan.png | Bin 0 -> 456 bytes .../textures/items/floppy_gray.png | Bin 0 -> 438 bytes .../textures/items/floppy_green.png | Bin 0 -> 437 bytes .../textures/items/floppy_lightBlue.png | Bin 0 -> 451 bytes .../textures/items/floppy_lightGray.png | Bin 0 -> 451 bytes .../textures/items/floppy_lime.png | Bin 0 -> 456 bytes .../textures/items/floppy_magenta.png | Bin 0 -> 451 bytes .../textures/items/floppy_orange.png | Bin 0 -> 451 bytes .../textures/items/floppy_pink.png | Bin 0 -> 456 bytes .../textures/items/floppy_purple.png | Bin 0 -> 442 bytes .../textures/items/floppy_red.png | Bin 0 -> 447 bytes .../textures/items/floppy_white.png | Bin 0 -> 457 bytes .../textures/items/floppy_yellow.png | Bin 0 -> 450 bytes .../li/cil/oc/common/item/Delegate.scala | 2 ++ .../li/cil/oc/common/item/Delegator.scala | 9 ++++++ .../li/cil/oc/common/item/FloppyDisk.scala | 28 +++++++++++++++++- .../cil/oc/common/recipe/ExtendedRecipe.scala | 18 +++++++++++ .../li/cil/oc/common/recipe/Recipes.scala | 7 +++++ src/main/scala/li/cil/oc/util/Color.scala | 18 +++++++++++ 23 files changed, 81 insertions(+), 1 deletion(-) delete mode 100644 src/main/resources/assets/opencomputers/textures/items/disk_floppy.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_black.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_blue.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_brown.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_cyan.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_gray.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_green.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_lightBlue.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_lightGray.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_lime.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_magenta.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_orange.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_pink.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_purple.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_red.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_white.png create mode 100644 src/main/resources/assets/opencomputers/textures/items/floppy_yellow.png diff --git a/src/main/resources/assets/opencomputers/textures/items/disk_floppy.png b/src/main/resources/assets/opencomputers/textures/items/disk_floppy.png deleted file mode 100644 index 40d15fa4edaaa56f68c5f207bc66277f69c23e0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 467 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h82?0JKt~YPq{Qv*IrlzK=tE;)Wxvi~jR8*9Ui;I(!leV^Y zQc}{RN00RN_3iELGcqy^4GkYZetiG_{q*#76BCov)YQ1RxZAgHTUl8}L`FI~I;Nzg zczAe(hK4#jJKNaU+`D%#D=RB1GAbY-Ku1T%+uK`1LnA6OGBY#N$H(Wvg9paO#3GxdDa!COUNlPzO0QJuGba4!+xD|7XldoApge5?$ zOM&ZM^wzw)=I`rw^SMnv*2r(K@BA$G#G9b$dg9LFFEa16CyIDgHBXqSy)H>JRVR9B z6!ZO6e)g49>{e}g)^LE^X8q~iFIw#xEM_Jb9Xe^m9$*k=WM*(?s}4h1^6WilFW+c* zK4XIE$r%h^V&$*B*v$6By*@jEmBT8R_n{x#jvG=DjMt9-;!c=8pMjYnNmqog^}wFT QK!-ATy85}Sb4q9e0QL6IPXGV_ diff --git a/src/main/resources/assets/opencomputers/textures/items/floppy_black.png b/src/main/resources/assets/opencomputers/textures/items/floppy_black.png new file mode 100644 index 0000000000000000000000000000000000000000..666f4b612c87cdc8ba6e4c774c353f5e4a6d130b GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8q5z)|*L(Nw{r~@8LPA1YTiepoQc+P+RaI3|QqtMkSxZYx zLqo&f-u~IMXKHF{va+%=GBVGfKbM!6cX4sCv9Wpb8GzSOy=fQ&q3JN=QbdI{aKgi1Zuc>+H>C>m4o{xZ_ zsObOw`}cuv*ca5D3v`uUNswPKkV`yZXzDKx1?rsb>EaktaVzFjq)@Yh084;Sh)Y1s zf!gjg|2_Y|UW)i7D9yGk&NPxwvD@8tR~%35!iAobpIeE4VOHdx9;4>e;ZhP*CiX6O z=05egcDJ`YX)xeuUNFDv?@@WCn8&wxEROAHn7DD)#uYb5EhU)TRQVkhxa?%v ztt6Q}HH3787@d`P9z1vuWGHPa#`yH<(?^dU-M@byXwlP{rg)(3Y9&E_!9Xryz_7fk zaSu>Or>Bc!NX4y~Q{8+`3KDIJD;O9ZpDsw9Hh0he=r_M-=RA9@c7NXAoSR3*_Pu47 z?T_WKjL_i=i2Iqbwzup{ol1p9^1Wg+{XJX{wp`vd|M#DRuNjOyUv=rLa!UBkW^0(i z@^#656^64r6SHSDe7h%i&4BUiQa$k*4PEz7v8pw$0um2?h$mbRZ(wA&{eyo`(3hjC QKu0lny85}Sb4q9e05iF;j{pDw literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/opencomputers/textures/items/floppy_cyan.png b/src/main/resources/assets/opencomputers/textures/items/floppy_cyan.png new file mode 100644 index 0000000000000000000000000000000000000000..39d00697ff5cdecd918a515d5f253bd67be44063 GIT binary patch literal 456 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8t^l79*L(Nw{r~@;(ZPYSq=Ydtk})NPv8ae?_H4$yJVsa7 zXV0GTEM3Z&k-_NiFS>3WqnDTPnl*x}Rx!?+#TXL8zF@(VCr_R~f6h2z0%LMAV|F&9 zo14JOmEs#VFwC6ESW&^4kigj1##m7B;K75(j~_GE)$y-b!PwY%|Ni}_PoFXd2Q!9; zKYH{?Z2fwm8xA+kw+6aOuO!GX7|10aFf{cShXQrZ@^o#^YP#D`n{_18xs>=g--q|uxZzorMHh>;Ej^n>N-(;Qk`OoXw(Z2FUgaEuP+{0 zoAv1Yl;h{M@>mo;FyEiQ+_L@wKZ8!Pn)n=@MnF95Yo@pN$vskjw$ij%KdLBusMLv$ufVBqTz>+SFA8*3$e zqx4zo{Oo3yPn`L0+X0Ww8+B?mUx+%Tt=oC7MPO#emOLh#Rl9ch?yCrOJ?{(&>z{g^W+0JbC{7IiD$`YyqQy9ivz%qmT=u zfDPm0$B#vP86P}&AXmmH5yL1N#3-A`c>n%=K4V7F0LG_JpFVo@h~I({Xm77$YY5OK zS|ve#!9Xr?fWc_RhZvx)>7Fi*Ar-e`PDKheD+sUz2(hGu#u(@YZa)4y-k^7>{6@)y zSD}-i3T!es^}=dLNo(h?mFreV1+yx4hXhrw-Fn?eQ|#eA)2HccPL+q72~D_p=2oK2 zD)xUo2e{>m4{CDpy|{d3&19+MDhDHV!}~wZa6Y)nwn=phz-JPBHyuB9~8+TY)^*?#?q_y?d^XJbyI__3ho_qZGv9IqUXXhC$ zEjN36AGx{B*4J-|h*+DQeIOuU>4OIkl9PAX+D@{x?7M&e{?n&VV`4Twdi1EN>3VGJ zrtaV@SoVm{Zq>MH(%**rIs)R-s8 zSKd;ZFEk-$^4>;Kfs1+hE{@L|T&tP2AN&zNplHv?#&GeQ(8Ehl_vHf}$>8bg=d#Wz Gp$Pyn?%kXK literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/opencomputers/textures/items/floppy_lightGray.png b/src/main/resources/assets/opencomputers/textures/items/floppy_lightGray.png new file mode 100644 index 0000000000000000000000000000000000000000..439e9fa638e1cb2504faceb1091416accf646ff2 GIT binary patch literal 451 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8_5hy{*L(Nw{r~@8TU*=D&(GG@*2TpoGc(iI*VoI-OHWU) zxVShYBjee#XJ%$*Zf<5)>>OzhlPbbefl&!Jlw*< z0_Xsxq&1gLoP2F^YxM2u-&bke z&%IgfAagYEN{DaaQF-P+XSPcgZaTw$#Zlo7i&KZxgVK3tFWb#!|G{T@a}vL$L+zE! z?kY`(BF}GZVGbV8_X=*h$;AJiE$qNg{RZbcCLV^1Q-mJMUc0gh=tu@nS3j3^P6^9kF&z`C6S7VH0WUOIij9^sRtMcT@6UG$A=g*%j?N*Z5C?T|3NaLUeV*{h$DnZ6p zM#f-9mboks9z0OorN~&s$k@;L`0-=LQbz72+>FVLj2VoK(-_qcsNcVTpJ67$qeqXP zK7FdNQvv9P#)k>lfv(ak3GxdDa)}2FP5s58K%KKZT^vIyZpEC66lzuwUBz9y{hsX6BAyAPW~#esp`t&+ea_(dPz;soVBFMP9f##q|*@`g57SXjvd%8 zwW)l5%6u(p3k9A-3NwCNRzBiq%zHO0rr^^Z)}EfLJ)%6pSCkJ#%1oYJDaKy#*5u}5 zYu*6;(p!t)aS8ZN%uQhZv1Kdo{cPTX`(_)M&eb!@d=gGz;5a56Shv1>HPDp|p00i_ I>zopr04XTMhyVZp literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/opencomputers/textures/items/floppy_magenta.png b/src/main/resources/assets/opencomputers/textures/items/floppy_magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..c719bc171e7a7a6fc898502ef8e1e1b46d736bec GIT binary patch literal 451 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8_5hy{*L(Nw{r~?zhB2j8tiP14zJ|ALuHNz%(Y_|(oVnSpT5rELdgcR?M>$dHW{2P(Q5H`aT?La5#mIV0)1Gz*4hNbVh{{l76^mK6yskjw$>bg*~f(T21P{^#N8{TVP zcK-ig8!1!UahmnroXAZwPGWA7vFy{=8C*y?@!2H&3zuT|1t)c{l`f@G<$QLjp*G95 zR7`hOWhj(rPqhE~Qn;SygYo^RO_NjY68M;Q`Y9}(!x;B=XU*N<>W1j#lVZ0c8g|aU zEcV%`A*1ITTNuOgxAz{bDOLD!?*Ny@f7XH%{tb)_cOrxynn#t!10BiW>FVdQ&MBb@ E00;BRX#fBK literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/opencomputers/textures/items/floppy_pink.png b/src/main/resources/assets/opencomputers/textures/items/floppy_pink.png new file mode 100644 index 0000000000000000000000000000000000000000..e743807b91a5c42535c238007b1a050f6c0750dd GIT binary patch literal 456 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8t^l79*L(Nw{r~?zl~1+9(4$M zai?wm>SUf}Y~)!o=d@-01Ad0QN3&uICLLil=?U#|K)78&q Iol`;+0A~Z#`~Uy| literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/opencomputers/textures/items/floppy_purple.png b/src/main/resources/assets/opencomputers/textures/items/floppy_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..ac3748eaa28cd77948f89b0a8ea59a498426bd8c GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8#sHrX*L(Nw{r~^pfw3|{WN|S2v`F4LaY75rw06b|FLGgQ zDAn9iYj~i=;`p;?&wLpA{g@_3^UrHEJ<@D`?8%cSfvi(1b@x1f{ybK2L968nH^!E1 z`E|+S%N{&<&|q@7KxK0T&+NyKABS(AER%s& z*B8o$0v)4W666;Qq5;6A}j$yU0#CRNu5%@{r~?r zM#|K7oMwGDCvuaF)3h1KN@QbpIXQP9`+Z4zm12ru)QdwB!4eC%a(r0T{^#QKpPSFM zGt4|SW!A5idmf)>*z-s+e9o#z4VGO`tR_w=V%spW_0AzPnLYxHDK8 zSEwm&)Yp3U?AaD0-3ff0RcwqUtc=@D4Yrx+KY#vwt+rYV8{?BFPbTtnEm4xqW@UW* z`0-A2qh4;d8DfGD9z2*V$TMG7qMMUtj+AI48)F9><7`Qh&4xNV%nYACeR}`?{YQ@; z0c{ucln1$8rzFTP7|10SFdVN;ajZnsBzD1K*XMJ}yY?xhJezjgNi%fC!CQ(4J}>#Y{rj)p zlZ-RZEXnzOt=_=cA;e8Feb1&IhTusZONA7Vuq2pr?`&V6)^IywqUqHL#xqxCuFYs? zd@{Xe_W>@C%+0Y&3WXb%-)0Rv@KL`ZwvLI1VPd~fX?3Wn3DA)Yp00i_>zopr00Q>N Axc~qF literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/opencomputers/textures/items/floppy_white.png b/src/main/resources/assets/opencomputers/textures/items/floppy_white.png new file mode 100644 index 0000000000000000000000000000000000000000..f51564d17092680979cd6d4ac029099466617e7e GIT binary patch literal 457 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8-ToPapH^_Gjeiro<4ng z|Ni|)j~?yayLZ;CSwLsp^-(zvbeMigkY6y6O9EhsT59nfsCBxhi(^Q|t(a5Sg_;#a zTmywfTm?gN43AB__v8Qh(+4NE?^wC{nb79W84YYDH!VsUJD*LyHuKpRW<@to)#7uN z=d?Aoxt|A%>^-hi^(eGK#qZG$+1qbg%^5c|-Q4{rP{l?lAAUwb}MfXmvw& z@T9GqG#MXhmt{ZFV|Y1X7iSIQ!?nf250`E(;JM4Pui^Sq@ee6%4K7I7)(YEcJ_wV1obC;pBQ+mr* zu7^(;CQOh7I$&nxJ6E8SbW4K#f`MG30mIVw+<$=@XL!0ehE&{&ITb0?tRUbTC?p~n zC{k$VH&gig{(Uw&KRdQd?D8{>FVdQ I&MBb@08d-pi~s-t literal 0 HcmV?d00001 diff --git a/src/main/scala/li/cil/oc/common/item/Delegate.scala b/src/main/scala/li/cil/oc/common/item/Delegate.scala index 3892e4ab4..ad05246c6 100644 --- a/src/main/scala/li/cil/oc/common/item/Delegate.scala +++ b/src/main/scala/li/cil/oc/common/item/Delegate.scala @@ -59,6 +59,8 @@ trait Delegate { } } + def color(stack: ItemStack, pass: Int) = 0xFFFFFF + def displayName(stack: ItemStack): Option[String] = None @SideOnly(Side.CLIENT) diff --git a/src/main/scala/li/cil/oc/common/item/Delegator.scala b/src/main/scala/li/cil/oc/common/item/Delegator.scala index f3639b158..f3cef751c 100644 --- a/src/main/scala/li/cil/oc/common/item/Delegator.scala +++ b/src/main/scala/li/cil/oc/common/item/Delegator.scala @@ -81,6 +81,12 @@ class Delegator(id: Int) extends Item(id) { case _ => EnumRarity.common } + override def getColorFromItemStack(stack: ItemStack, pass: Int) = + subItem(stack) match { + case Some(subItem) => subItem.color(stack, pass) + case _ => super.getColorFromItemStack(stack, pass) + } + override def getChestGenBase(chest: ChestGenHooks, rnd: Random, original: WeightedRandomChestContent) = original override def shouldPassSneakingClickToBlock(world: World, x: Int, y: Int, z: Int) = { @@ -166,6 +172,9 @@ class Delegator(id: Int) extends Item(id) { case _ => super.getIcon(stack, pass) } + @SideOnly(Side.CLIENT) + override def getIconIndex(stack: ItemStack) = getIcon(stack, 0) + @SideOnly(Side.CLIENT) override def getIconFromDamage(damage: Int): Icon = subItem(damage) match { diff --git a/src/main/scala/li/cil/oc/common/item/FloppyDisk.scala b/src/main/scala/li/cil/oc/common/item/FloppyDisk.scala index 3d81c76bf..719b8700e 100644 --- a/src/main/scala/li/cil/oc/common/item/FloppyDisk.scala +++ b/src/main/scala/li/cil/oc/common/item/FloppyDisk.scala @@ -2,14 +2,25 @@ package li.cil.oc.common.item import java.util +import cpw.mods.fml.relauncher.{SideOnly, Side} import li.cil.oc.Settings import net.minecraft.client.renderer.texture.IconRegister import net.minecraft.entity.player.EntityPlayer import net.minecraft.item.ItemStack +import net.minecraft.util.Icon class FloppyDisk(val parent: Delegator) extends Delegate { val unlocalizedName = "FloppyDisk" + val icons = Array.fill[Icon](16)(null) + + @SideOnly(Side.CLIENT) + override def icon(stack: ItemStack, pass: Int) = + if (stack.hasTagCompound && stack.getTagCompound.hasKey(Settings.namespace + "color")) + Some(icons(stack.getTagCompound.getInteger(Settings.namespace + "color") max 0 min 15)) + else + Some(icons(8)) + override def tooltipLines(stack: ItemStack, player: EntityPlayer, tooltip: util.List[String], advanced: Boolean) = { if (stack.hasTagCompound && stack.getTagCompound.hasKey(Settings.namespace + "data")) { val nbt = stack.getTagCompound.getCompoundTag(Settings.namespace + "data") @@ -23,6 +34,21 @@ class FloppyDisk(val parent: Delegator) extends Delegate { override def registerIcons(iconRegister: IconRegister) { super.registerIcons(iconRegister) - icon = iconRegister.registerIcon(Settings.resourceDomain + ":disk_floppy") + icons(0) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_black") + icons(1) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_red") + icons(2) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_green") + icons(3) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_brown") + icons(4) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_blue") + icons(5) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_purple") + icons(6) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_cyan") + icons(7) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_lightGray") + icons(8) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_gray") + icons(9) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_pink") + icons(10) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_lime") + icons(11) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_yellow") + icons(12) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_lightBlue") + icons(13) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_magenta") + icons(14) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_orange") + icons(15) = iconRegister.registerIcon(Settings.resourceDomain + ":floppy_white") } } diff --git a/src/main/scala/li/cil/oc/common/recipe/ExtendedRecipe.scala b/src/main/scala/li/cil/oc/common/recipe/ExtendedRecipe.scala index 5c62675e5..943af74e8 100644 --- a/src/main/scala/li/cil/oc/common/recipe/ExtendedRecipe.scala +++ b/src/main/scala/li/cil/oc/common/recipe/ExtendedRecipe.scala @@ -3,14 +3,17 @@ 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.{Settings, api} import net.minecraft.inventory.InventoryCrafting import net.minecraft.item.{Item, ItemStack} +import net.minecraft.nbt.NBTTagCompound object ExtendedRecipe { private lazy val navigationUpgrade = api.Items.get("navigationUpgrade") private lazy val linkedCard = api.Items.get("linkedCard") + private lazy val floppy = api.Items.get("floppy") def addNBTToResult(craftedStack: ItemStack, inventory: InventoryCrafting) = { if (api.Items.get(craftedStack) == navigationUpgrade) { @@ -32,6 +35,21 @@ object ExtendedRecipe { }) } + if (api.Items.get(craftedStack) == floppy) { + if (!craftedStack.hasTagCompound) { + craftedStack.setTagCompound(new NBTTagCompound("tag")) + } + val nbt = craftedStack.getTagCompound + for (i <- 0 until inventory.getSizeInventory) { + val stack = inventory.getStackInSlot(i) + if (stack != null) Color.findDye(stack) match { + case Some(oreDictName) => + nbt.setInteger(Settings.namespace + "color", Color.dyes.indexOf(oreDictName)) + case _ => + } + } + } + craftedStack } } diff --git a/src/main/scala/li/cil/oc/common/recipe/Recipes.scala b/src/main/scala/li/cil/oc/common/recipe/Recipes.scala index 8e7dc5982..13fbbb656 100644 --- a/src/main/scala/li/cil/oc/common/recipe/Recipes.scala +++ b/src/main/scala/li/cil/oc/common/recipe/Recipes.scala @@ -6,6 +6,7 @@ import java.util.logging.Level import com.typesafe.config._ import cpw.mods.fml.common.Loader import cpw.mods.fml.common.registry.GameRegistry +import li.cil.oc.util.Color import li.cil.oc.util.mods.GregTech import li.cil.oc.{Items, OpenComputers, api, common} import net.minecraft.block.Block @@ -97,6 +98,12 @@ object Recipes { // Navigation upgrade recrafting. val navigationUpgrade = api.Items.get("navigationUpgrade").createItemStack(1) GameRegistry.addRecipe(new ExtendedShapelessOreRecipe(navigationUpgrade, navigationUpgrade, new ItemStack(Item.map, 1, OreDictionary.WILDCARD_VALUE))) + + // Floppy disk coloring. + val floppy = api.Items.get("floppy").createItemStack(1) + for (dye <- Color.dyes) { + GameRegistry.addRecipe(new ExtendedShapelessOreRecipe(floppy, floppy, dye)) + } } catch { case e: Throwable => OpenComputers.log.log(Level.SEVERE, "Error parsing recipes, you may not be able to craft any items from this mod!", e) diff --git a/src/main/scala/li/cil/oc/util/Color.scala b/src/main/scala/li/cil/oc/util/Color.scala index eb7363cae..6ae500f36 100644 --- a/src/main/scala/li/cil/oc/util/Color.scala +++ b/src/main/scala/li/cil/oc/util/Color.scala @@ -31,6 +31,24 @@ object Color { val Orange = 0xEB8844 val White = 0xF0F0F0 + val dyes = Array( + "dyeBlack", + "dyeRed", + "dyeGreen", + "dyeBrown", + "dyeBlue", + "dyePurple", + "dyeCyan", + "dyeLightGray", + "dyeGray", + "dyePink", + "dyeLime", + "dyeYellow", + "dyeLightBlue", + "dyeMagenta", + "dyeOrange", + "dyeWhite") + val byOreName = Map( "dyeBlack" -> Black, "dyeRed" -> Red,